-
- def __init__(self, name, ip, mac):
- r"Initialize Host object, see class documentation for details."
- self.name = name
- self.ip = ip
- self.mac = mac
-
- def as_tuple(self):
- r"Return a tuple representing the host."
- return (self.name, self.ip, self.mac)
-
- def update(self, ip=None, mac=None):
- if ip is not None:
- self.ip = ip
- if mac is not None:
- self.mac = mac
+ name = Field(Any(HostName(not_empty=True),
+ FullyQualifiedHostName(not_empty=True)))
+ ip = Field(IPAddress(not_empty=True))
+ mac = Field(MACAddress(add_colons=True, not_empty=True))