Skip to content

Kathara.manager.kubernetes.KubernetesLink

tcaiazzi edited this page Dec 20, 2021 · 13 revisions

module Kathara.manager.kubernetes.KubernetesLink

Global Variables

  • MAX_K8S_LINK_NUMBER
  • K8S_NET_GROUP
  • K8S_NET_VERSION
  • K8S_NET_PLURAL

class KubernetesLink

Class responsible for interacting with Kubernetes.

method KubernetesLink.__init__

__init__() → None

method KubernetesLink.create

create(link: Kathara.model.Link.Link, network_id: int) → None

Create a Docker Network representing the link 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: Dict[str, Kathara.model.Link.Link] = None
) → None

Deploy all the links contained in lab.links.

Args:

  • lab (Kathara.model.Lab.Lab): A Kathara network scenario.
  • selected_links (Dict[str, Link]): Keys are Link names, values are Link objects.

Returns: None


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 networks of the scenario.

Returns:

  • List[Any]: A list of Kubernetes networks.

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

Returns:

  • str: The name of the Kubernetes Network in the format "<net_prefix>-".

method KubernetesLink.undeploy

undeploy(lab_hash: str, networks_to_delete: Optional[Set] = 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.
  • networks_to_delete (Set): If specified, delete only the networks that contained.

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