COT.platforms
package reference¶
Package for identifying guest platforms and handling platform differences.
The GenericPlatform
class describes the API
and provides a generic implementation that can be overridden by subclasses
to provide platform-specific logic.
In general, other modules should not instantiate subclasses directly but should
instead use the platform_from_product_class()
API to
derive the appropriate subclass instance.
API¶
is_known_product_class |
Determine if the given product class string is a known one. |
platform_from_product_class |
Get the class of Platform corresponding to a product class string. |
Platform modules¶
COT.platforms.generic |
API and generic implementation of platform-specific logic. |
COT.platforms.cisco_csr1000v |
Platform logic for the Cisco CSR1000V virtual router. |
COT.platforms.cisco_iosv |
Platform logic for the Cisco IOSv virtual router. |
COT.platforms.cisco_iosxrv |
Platform logic for the Cisco IOS XRv virtual router and its variants. |
COT.platforms.cisco_iosxrv_9000 |
Platform logic for the Cisco IOS XRv 9000 virtual router. |
COT.platforms.cisco_nexus_9000v |
Platform logic for the Cisco Nexus 9000v virtual switch. |
COT.platforms.cisco_nxosv |
Platform logic for the Cisco NX-OSv virtual switch. |
-
is_known_product_class
(product_class)[source]¶ Determine if the given product class string is a known one.
Parameters: product_class (str) – String such as ‘com.cisco.iosv’ Returns: bool – Whether product_class is known. Examples
>>> is_known_product_class("com.cisco.n9k") True >>> is_known_product_class("foobar") False
-
platform_from_product_class
(product_class)[source]¶ Get the class of Platform corresponding to a product class string.
Parameters: product_class (str) – String such as ‘com.cisco.iosv’ Returns: class – GenericPlatform or a subclass of it Examples
>>> platform_from_product_class("com.cisco.n9k") <class 'COT.platforms.cisco_nexus_9000v.Nexus9000v'> >>> platform_from_product_class(None) <class 'COT.platforms.generic.GenericPlatform'> >>> platform_from_product_class("frobozz") <class 'COT.platforms.generic.GenericPlatform'>