-
Notifications
You must be signed in to change notification settings - Fork 64
Kathara.manager.kubernetes.KubernetesLink
Tommaso Caiazzi edited this page Jun 17, 2024
·
13 revisions
- MAX_K8S_LINK_NUMBER
- K8S_NET_GROUP
- K8S_NET_VERSION
- K8S_NET_PLURAL
The class responsible for deploying Kathara collision domains as Kubernetes networks and interact with them.
__init__(
kubernetes_namespace: Kathara.manager.kubernetes.KubernetesNamespace.KubernetesNamespace
) → None
create(link: Kathara.model.Link.Link, network_id: int) → None
Create a Kubernetes Network representing the collision domain object and assign it to link.api_object.
Args:
-
link
(Kathara.model.Link.Link): A Kathara collision domain. -
network_id
(int): The Network ID.
Returns: None
deploy_links(
lab: Kathara.model.Lab.Lab,
selected_links: Set[str] = None,
excluded_links: Set[str] = None
) → None
Deploy all the links contained in lab.links.
Args:
-
lab
(Kathara.model.Lab.Lab): A Kathara network scenario. -
selected_links
(Set[str]): A set containing the name of the collision domains to deploy. -
excluded_links
(Set[str]): A set containing the name of the collision domains to exclude.
Returns: None
Raises:
-
InvocationError
: If bothselected_links
andexcluded_links
are specified.
get_links_api_objects_by_filters(
lab_hash: str = None,
link_name: str = None
) → List[Any]
Return the List of Kubernetes networks.
Args:
-
lab_hash
(str): The hash of a network scenario. If specified, return only the networks in the scenario, else return the networks in the 'default' namespace. -
link_name
(str): The name of a network. If specified, return the specified network of the scenario.
Returns:
-
List[Any]
: A list of Kubernetes networks.
get_links_stats(
lab_hash: str = None,
link_name: str = None
) → Generator[Dict[str, Kathara.manager.kubernetes.stats.KubernetesLinkStats.KubernetesLinkStats], NoneType, NoneType]
Return a generator containing the Kubernetes networks' stats.
Args:
-
lab_hash
(str): The hash of a network scenario. If specified, return all the stats of the networks in the scenario. -
link_name
(str): The name of a device. If specified, return the specified network stats.
Returns:
-
Generator[Dict[str, KubernetesLinkStats], None, None]
: A generator containing network names as keys and KubernetesLinkStats as values.
get_network_name(name: str) → str
Return the name of a Kubernetes Network.
Args:
-
name
(str): The name of a Kathara collision domain.
Returns:
-
str
: The name of the Kubernetes Network in the format "<net_prefix>-".
undeploy(lab_hash: str, selected_links: Optional[Set[str]] = None) → None
Undeploy all the links of the scenario specified by lab_hash.
Args:
-
lab_hash
(str): The hash of the network scenario to undeploy. -
selected_links
(Set[str]): If specified, delete only the collision domains contained in the set.
Returns: None
wipe() → None
Undeploy all the running networks of the specified user.
Returns: None
This file was automatically generated via lazydocs.
Website: kathara.org
Contact us: [email protected]