@classmethod
    def get_from_elem(cls, node, iface_elem):
        name = iface_elem.get("name")
        
        if not name:
            raise RSpecParsingException("Could not find IfaceSpec name.")
        
        try:
            iface = cls.objects.get(name=name, node=node)
        except cls.DoesNotExist:
            iface = cls(name=name, node=node)
            
        for attr in ["addr", "type", "init_params"]:
            setattr(iface, attr, iface_elem.get(attr, ""))
            
        for attr in ["min_rate", "max_rate", "max_kbyte"]:
            setattr(iface, attr, iface_elem.get(attr, 0))
        
        for attr in ["ip_spoof"]:
            setattr(iface, attr, iface_elem.get(attr, False))
        
        iface.available = True
        iface.save()
        
        return iface
Create or update the planetlab interface in the DB from the Element
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient_geni/planetlab/sfa-models.py/PlanetLabInterface.get_from_elem