cterasdk.edge.network module#
- class cterasdk.edge.network.BaseMTU(edge)#
Bases:
BaseCommand- modify(interface, size)#
- reset(interface)#
- class cterasdk.edge.network.BaseStaticRoutes(edge)#
Bases:
BaseCommandEdge Filer Static Routes Configuration
- add(interface, route_gateway, route_network)#
Add a route.
- Parameters:
interface (object) – Interface name or port number
route_gateway (str) – Gateway IP address
route_network (str) – Network (CIDR)
- clear()#
- delete(route)#
Delete a route.
- Parameters:
route (cterasdk.edge.types.StaticRoute) – Static Route
- class cterasdk.edge.network.Diagnostics(edge)#
Bases:
BaseCommand- diagnose(services)#
Test a TCP connection to a host over a designated port
- Parameters:
services (list[cterasdk.edge.types.TCPService]) – List of services, identified by a host and a port
- Returns:
A list of named-tuples including the host, port and a boolean value indicating whether TCP connection can be established
- Return type:
- iperf(address, port=5201, threads=1, protocol='TCP', direction='Upload', timeout=None)#
Invoke a network throughput test
- Parameters:
address (str) – The host running the iperf server
port (int,optional) – The iperf server port, defaults to 5201
threads (int,optional) – The number of threads, defaults to 1
protocol (cterasdk.edge.enum.IPProtocol,optional) – IP protocol, defaults to ‘TCP’
direction (cterasdk.edge.enum.Traffic,optional) – Traffic direction, defaults to ‘Upload’
timeout (float,optional) – Timeout (in seconds).
- Returns:
A string containing the iperf output
- Return type:
str
- tcp_connect(service)#
Test a TCP connection between the Edge Filer and the provided host address
- Parameters:
service (cterasdk.edge.types.TCPService) – A service, identified by a host and a port
- Returns:
A named-tuple including the host, port and a boolean value indicating whether TCP connection can be established
- Return type:
- class cterasdk.edge.network.Hosts(edge)#
Bases:
BaseCommandEdge Filer Static Route Configuration APIs
- add(ipaddr, hostname)#
Add entry to the Edge Filer’s hosts file.
- Parameters:
ipaddr (str) – IP Address
hostname (str) – Hostname
- delete(hostname)#
- get()#
Get the Edge Filer’s hosts file entries.
- class cterasdk.edge.network.LegacyMTU(edge)#
Bases:
BaseMTUSingle Network Interface MTU Configuration
- modify(size)#
Set Custom Network Maximum Transmission Unit (MTU)
- Parameters:
size (int) – Maximum Transmission Unit
- reset()#
Reset to defaults.
- class cterasdk.edge.network.LegacyNetwork(edge)#
Bases:
NetworkEdge Filer Legacy Network API
- get_status()#
Retrieve the network interface status
- ifconfig()#
Retrieve the IP address settings
- ipconfig()#
Retrieve the IP address settings
- set_static_ipaddr(address, subnet, gateway, primary_dns_server, secondary_dns_server=None)#
Set a Static IP Address
- Parameters:
interface (object) – Interface name or port number
address (str) – The static address
subnet (str) – The subnet for the static address
gateway (str) – The default gateway
primary_dns_server (str) – The primary DNS server
secondary_dns_server (str,optinal) – The secondary DNS server, defaults to None
- class cterasdk.edge.network.LegacyStaticRoutes(edge)#
Bases:
BaseStaticRoutesLegacy Static Routes Configuration
- add(gateway, network)#
Add a route.
- Parameters:
gateway (str) – Gateway IP address
network (str) – Network (CIDR)
- get()#
Get Routes.
- class cterasdk.edge.network.Network(edge)#
Bases:
BaseCommand- deduce_port(interface)#
- interface(name)#
Get Network Interface
- Parameters:
name (str) – Interface name
- property interfaces#
Get Network Interfaces.
- Returns:
A list of network interfaces
- Return type:
- ipconfig(interface)#
Get Interface Configuration
- Parameters:
interface (object) – Interface name or port number
- port(name)#
Get Port
- Parameters:
name (str) – Interface name
- set_static_ipaddr(interface, address, subnet, gateway, primary_dns_server, secondary_dns_server=None)#
Set a Static IP Address
- Parameters:
interface (object) – Interface name or port number
address (str) – The static address
subnet (str) – The subnet for the static address
gateway (str) – The default gateway
primary_dns_server (str) – The primary DNS server
secondary_dns_server (str,optinal) – The secondary DNS server, defaults to None
- class cterasdk.edge.network.Proxy(edge)#
Bases:
BaseCommandEdge Filer Proxy Configuration APIs
- disable()#
Disable Proxy
- Returns:
Proxy settings
- Return type:
- get_configuration()#
Get Proxy Configuration
- is_enabled()#
Check if Proxy Configuration is Enabled
- Returns:
Trueif a proxy server was configured andFalseotherwise.- Return type:
bool
- modify(address, port=None, username=None, password=None)#
Modify Proxy Configuration
- Parameters:
address (str) – Proxy address
port (int,optional) – Proxy port, defaults to
8080username (str,optional) – Username
password (str,optional) – Password
- Returns:
Proxy settings
- Return type:
- class cterasdk.edge.network.StaticRoutes711(edge)#
Bases:
BaseStaticRoutesEdge Filer 7.11 Static Routes Configuration
- get()#
Get Routes.