thousandeyes-sdk-python/thousandeyes-sdk-endpoint-test-results/test/test_network_dynamic_tests_results_api.py
2024-08-11 08:40:23 +00:00

1093 lines
49 KiB
Python

# 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_tests_results_api import NetworkDynamicTestsResultsApi
class TestNetworkDynamicTestsResultsApi(unittest.TestCase):
"""NetworkDynamicTestsResultsApi unit test stubs"""
def setUp(self) -> None:
self.api = NetworkDynamicTestsResultsApi()
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.DynamicTestsDataRoundSearch.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" : 120,
"testId" : "281474976710706",
"aid" : "1234",
"agentSelectorConfig" : {
"agentSelectorType" : "all-agents",
"maxMachines" : 10
},
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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.NetworkDynamicTestResults.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" : 120,
"testId" : "281474976710706",
"aid" : "1234",
"agentSelectorConfig" : {
"agentSelectorType" : "all-agents",
"maxMachines" : 10
},
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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.PathVisDetailDynamicTestResults.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" : 120,
"testId" : "281474976710706",
"aid" : "1234",
"agentSelectorConfig" : {
"agentSelectorType" : "all-agents",
"maxMachines" : 10
},
"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",
"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" : [ {
"numberOfHops" : 15,
"responseTime" : 1500,
"ipAddress" : "196.40.106.237",
"pathId" : "1230899668701775614109128428722974545787322404682781961521"
}, {
"numberOfHops" : 15,
"responseTime" : 1500,
"ipAddress" : "196.40.106.237",
"pathId" : "1230899668701775614109128428722974545787322404682781961521"
} ],
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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" : [ {
"numberOfHops" : 15,
"responseTime" : 1500,
"ipAddress" : "196.40.106.237",
"pathId" : "1230899668701775614109128428722974545787322404682781961521"
}, {
"numberOfHops" : 15,
"responseTime" : 1500,
"ipAddress" : "196.40.106.237",
"pathId" : "1230899668701775614109128428722974545787322404682781961521"
} ],
"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" : "<direct>"
}, {
"bypass" : "*.local;169.254/16",
"proxy" : "<direct>"
} ]
},
"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"
},
"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.PathVisDynamicTestResults.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':
unittest.main()