Skip to content

Kathara.manager.docker.DockerLink

tcaiazzi edited this page Oct 8, 2021 · 15 revisions

module Kathara.manager.docker.DockerLink

Global Variables

  • PLUGIN_NAME
  • BRIDGE_LINK_NAME

class DockerLink

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

method DockerLink.__init__

__init__(client: docker.client.DockerClient) → None

method DockerLink.create

create(link: Kathara.model.Link.Link) → None

Create a Docker network representing the collision domain object and assign it to link.api_object. Also, connect external collision domains, if present.

Args:

  • link (Kathara.model.Link.Link): A Kathara collision domain.

Returns: None


method DockerLink.deploy_links

deploy_links(lab: Kathara.model.Lab.Lab) → None

Deploy all the lab collision domains as Docker networks.

Args:

  • lab (Kathara.model.Lab.Lab): A Kathara network scenario.

Returns: None


method DockerLink.get_docker_bridge

get_docker_bridge() → Union[NoneType, docker.models.networks.Network]

Return the Docker bridged network.

Returns:

  • Union[None, docker.models.networks.Network]: The Docker bridged network if exists, else None

method DockerLink.get_links_api_objects_by_filters

get_links_api_objects_by_filters(
    lab_hash: str = None,
    link_name: str = None,
    user: str = None
) → List[docker.models.networks.Network]

Return the Docker networks specified by lab_hash, machine_name and user.

Args:

  • lab_hash (str): The hash of a network scenario. If specified, return all the networks in the scenario.
  • link_name (str): The name of a network. If specified, return the specified networks of the scenario.
  • user (str): The name of a user on the host. If specified, return only the networks of the user.

Returns:

  • List[docker.models.networks.Network]: A list of Docker networks.

method DockerLink.get_network_name

get_network_name(name: str) → str

Return the name of a Docker network.

Args:

  • name (str): The name of a Kathara collision domain.

Returns:

  • str: The name of the Docker network in the format "|net_prefix||username_prefix||name|".
  • If shared collision domains, the format is: "|net_prefix|_|lab_hash|".

method DockerLink.undeploy

undeploy(lab_hash: str) → None

Undeploy all the collision domains of the scenario specified by lab_hash.

Args:

  • lab_hash (str): The hash of the network scenario to undeploy.

Returns: None


method DockerLink.wipe

wipe(user: str = None) → None

Undeploy all the Docker networks of the specified user. If user is None, it undeploy all the Docker networks.

Args:

  • user (str): The name of a current user on the host

Returns: None


This file was automatically generated via lazydocs.

Clone this wiki locally