Ejemplo n.º 1
0
    def get_vports(self, parent, parent_id, **filters):
        if parent == constants.L2DOMAIN:
            parent = nuagelib.NuageL2Domain
        elif parent == constants.SUBNET:
            parent = nuagelib.NuageSubnet
        else:
            return []

        return helper.get_vports(self.restproxy, parent, parent_id, **filters)
Ejemplo n.º 2
0
 def get_host_and_bridge_vports(self, subnet_id, subnet_type):
     if subnet_type == constants.L2DOMAIN:
         parent = nuagelib.NuageL2Domain
     elif subnet_type == constants.SUBNET:
         parent = nuagelib.NuageSubnet
     else:
         return []
     vport = nuagelib.NuageVPort()
     return helper.get_vports(self.restproxy,
                              parent=parent,
                              parent_id=subnet_id,
                              headers=vport.extra_headers_host_or_bridge())