Skip to content

Kathara.manager.kubernetes.KubernetesLink

Tommaso Caiazzi edited this page Jun 17, 2024 · 13 revisions

module Kathara.manager.kubernetes.KubernetesLink

Global Variables

  • MAX_K8S_LINK_NUMBER
  • K8S_NET_GROUP
  • K8S_NET_VERSION
  • K8S_NET_PLURAL

class KubernetesLink

The class responsible for deploying Kathara collision domains as Kubernetes networks and interact with them.

method KubernetesLink.__init__

__init__(
    kubernetes_namespace: Kathara.manager.kubernetes.KubernetesNamespace.KubernetesNamespace
) → None

method KubernetesLink.create

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


method KubernetesLink.deploy_links

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 both selected_links and excluded_links are specified.

method KubernetesLink.get_links_api_objects_by_filters

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.

method KubernetesLink.get_links_stats

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.

method KubernetesLink.get_network_name

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>-".

method KubernetesLink.undeploy

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


method KubernetesLink.wipe

wipe() → None

Undeploy all the running networks of the specified user.

Returns: None


This file was automatically generated via lazydocs.

Clone this wiki locally