WattsonNetworkVirtualMachineHost#

class wattson.cosimulation.simulators.network.components.wattson_network_virtual_machine_host.WattsonNetworkVirtualMachineHost(*, id: str, system_name: Optional[str] = None, display_name: Optional[str] = None, network_emulator: Optional[ForwardRef('NetworkEmulator')] = None, emulation_instance: Optional[Any] = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: Optional[logging.Logger] = None, interfaces: List[ForwardRef('WattsonNetworkInterface')] = <factory>, priority: float = 4, _services: Dict[int, wattson.services.wattson_service.WattsonService] = <factory>, _processes: List[subprocess.Popen] = <factory>, _min_interface_id: int = 0, _is_outside_namespace: bool = False)#

Bases: WattsonNetworkHost, NetworkVirtualMachineHost

Methods

__init__

clear_routes

get_class_id

get_namespace

get_prefix

interface_down

Set an interface down

interface_flush_ip

Flush (remove) the IP address of an interface

interface_rename

Renames a physical interface on the node

interface_set_ip

Set the IP address for an interface

interface_up

Set an interface up

interfaces_list_existing

Returns a list of actual interfaces existing on the node.

set_class_id

set_route

start

stop

to_remote_representation

Creates a dictionary for synchronization with a RemoteNetworkEntity.

Attributes

os

interfaces

config

id

__init__(*, id: str, system_name: str | None = None, display_name: str | None = None, network_emulator: NetworkEmulator | None = None, emulation_instance: ~typing.Any | None = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: ~logging.Logger | None = None, interfaces: ~typing.List[WattsonNetworkInterface] = <factory>, priority: float = 4, _services: ~typing.Dict[int, ~wattson.services.wattson_service.WattsonService] = <factory>, _processes: ~typing.List[~subprocess.Popen] = <factory>, _min_interface_id: int = 0, _is_outside_namespace: bool = False) None#
interface_down(interface: WattsonNetworkInterface) bool#

Set an interface down

Parameters:

interface ('NetworkInterface') – The interface to set down

Returns:

Whether the action has been successfully performed

Return type:

bool

interface_flush_ip(interface: WattsonNetworkInterface) bool#

Flush (remove) the IP address of an interface

Parameters:

interface ('NetworkInterface') – The interface to flush the IP address of

Returns:

Whether the action has been successfully performed

Return type:

bool

interface_rename(old_name: str, new_name: str) bool#

Renames a physical interface on the node

Parameters:
  • old_name (str) – The original interface name

  • new_name (str) – The new interface name

Returns:

Whether the action was successful

Return type:

bool

interface_set_ip(interface: WattsonNetworkInterface) bool#

Set the IP address for an interface

Parameters:

interface ('NetworkInterface') – The interface to set the IP address of

Returns:

Whether the action has been successfully performed

Return type:

bool

interface_up(interface: WattsonNetworkInterface) bool#

Set an interface up

Parameters:

interface ('NetworkInterface') – The interface to set up

Returns:

Whether the action has been successfully performed

Return type:

bool

interfaces_list_existing() List[Dict]#

Returns a list of actual interfaces existing on the node. Each interface information consists of the interface’s name, its hardware address, ip addresses, and potential statistics.

Returns:

A list of dictionaries containing interface information

Return type:

List[Dict]

to_remote_representation(force_state_synchronization: bool = True) RemoteNetworkEntityRepresentation#

Creates a dictionary for synchronization with a RemoteNetworkEntity.

Parameters:

force_state_synchronization (bool, optional) – Whether to force a synchronization of the internal state with the actual state (Default value = True)

Returns:

A dictionary representation of this WattsonNetworkEntity for synchronization with a RemoteNetworkEntity.

Return type:

RemoteNetworkEntityRepresentation