thousandeyes-sdk-python/thousandeyes-sdk-endpoint-agents/test/test_manage_agents_api.py
Shahid Hussain Khan 9c9b350344
Some checks failed
Python CI / build (push) Has been cancelled
[GitHub Bot] Generated python SDK (#40)
* [GitHub Bot] Generated python SDK

* Deleted labels (that's deprecated in v7, being replaced by tags) & Updated some additional files

---------

Co-authored-by: API Team <api-team@thousandeyes.com>
Co-authored-by: Miguel Pragosa <mpragosa@thousandeyes.com>
2024-08-08 09:31:01 +01:00

1370 lines
59 KiB
Python

# 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).
The version of the OpenAPI document: 7.0.14
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.manage_agents_api import ManageAgentsApi
class TestManageAgentsApi(unittest.TestCase):
"""ManageAgentsApi unit test stubs"""
def setUp(self) -> None:
self.api = ManageAgentsApi()
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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : [ "5d0764ac-7e42-4ec8-a0d4-39fc53edccba", "5d0764ac-7e42-4ec8-a0d4-39fc53edccba" ],
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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_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" : "5d0764ac-7e42-4ec8-a0d4-39fc53edccba",
"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()