3
\Όme γ @ s. G d d dZ G dd dZG dd dZdS )c @ sl e Zd ZdZedd Zedd Zedd Zedd Zed
d Z edd
Z
edd Zdd ZdS )ΪNicBasez{
Define what are expected of each nic.
The following properties should be provided in an implementation class.
c C s t ddS )zb
Retrieves the mac address of the nic
@return (str) : the MACADDR setting
ZMACADDRN)ΪNotImplementedError)Ϊself© r ϊ/usr/lib/python3.6/nic_base.pyΪmac s zNicBase.macc C s t ddS )a
Retrieves whether the nic is the primary nic
Indicates whether NIC will be used to define the default gateway.
If none of the NICs is configured to be primary, default gateway won't
be set.
@return (bool): the PRIMARY setting
ZPRIMARYN)r )r r r r Ϊprimary s zNicBase.primaryc C s t ddS )zu
Retrieves whether the nic should be up at the boot time
@return (bool) : the ONBOOT setting
ZONBOOTN)r )r r r r Ϊonboot" s zNicBase.onbootc C s t ddS )z
Retrieves the boot protocol of the nic
@return (str): the BOOTPROTO setting, valid values: dhcp and static.
Z BOOTPROTON)r )r r r r Ϊ bootProto* s zNicBase.bootProtoc C s t ddS )z‘
Retrieves the IPv4_MODE
@return (str): the IPv4_MODE setting, valid values:
backwards_compatible, static, dhcp, disabled, as_is
Z IPv4_MODEN)r )r r r r Ϊ ipv4_mode2 s zNicBase.ipv4_modec C s t ddS )z
Retrieves the static IPv4 configuration of the nic
@return (StaticIpv4Base list): the static ipv4 setting
zStatic IPv4N)r )r r r r Ϊ
staticIpv4; s zNicBase.staticIpv4c C s t ddS )z|
Retrieves the IPv6 configuration of the nic
@return (StaticIpv6Base list): the static ipv6 setting
zStatic Ipv6N)r )r r r r Ϊ
staticIpv6C s zNicBase.staticIpv6c C s t ddS )z
Validate the object
For example, the staticIpv4 property is required and should not be
empty when ipv4Mode is STATIC
zCheck constraints on propertiesN)r )r r r r ΪvalidateK s zNicBase.validateN)
Ϊ__name__Ϊ
__module__Ϊ__qualname__Ϊ__doc__Ϊpropertyr r r r r
r r r
r r r r r s r c @ s4 e Zd ZdZedd Zedd Zedd ZdS ) ΪStaticIpv4Basez
Define what are expected of a static IPv4 setting
The following properties should be provided in an implementation class.
c C s t ddS )zV
Retrieves the Ipv4 address
@return (str): the IPADDR setting
zIpv4 AddressN)r )r r r r ΪipZ s zStaticIpv4Base.ipc C s t ddS )z_
Retrieves the Ipv4 NETMASK setting
@return (str): the NETMASK setting
zIpv4 NETMASKN)r )r r r r Ϊnetmaskb s zStaticIpv4Base.netmaskc C s t ddS )zl
Retrieves the gateways on this Ipv4 subnet
@return (str list): the GATEWAY setting
zIpv4 GATEWAYN)r )r r r r Ϊgatewaysj s zStaticIpv4Base.gatewaysN)r r r r r r r r r r r r r T s r c @ s4 e Zd ZdZedd Zedd Zedd ZdS ) ΪStaticIpv6BasezDefine what are expected of a static IPv6 setting
The following properties should be provided in an implementation class.
c C s t ddS )zX
Retrieves the Ipv6 address
@return (str): the IPv6ADDR setting
zIpv6 AddressN)r )r r r r r x s zStaticIpv6Base.ipc C s t ddS )zc
Retrieves the Ipv6 NETMASK setting
@return (str): the IPv6NETMASK setting
zIpv6 NETMASKN)r )r r r r r s zStaticIpv6Base.netmaskc C s t ddS )zc
Retrieves the Ipv6 GATEWAY setting
@return (str): the IPv6GATEWAY setting
zIpv6 GATEWAYN)r )r r r r Ϊgateway s zStaticIpv6Base.gatewayN)r r r r r r r r r r r r r s s r N)r r r r r r r Ϊ