def populate_vxlan_fdb(self, req):
        # populate vxlan fdb
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = PopulateVxlanFdbResponse

        interf = "vxlan" + str(cmd.vni)
        rsp.success = linux.populate_vxlan_fdb(interf, cmd.peers)

        if rsp.success != True:
            rsp.error = "error on populate fdb"

        return jsonobject.dumps(rsp)
Esempio n. 2
0
    def populate_vxlan_fdb(self, req):
        # populate vxlan fdb
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = PopulateVxlanFdbResponse

        interf = "vxlan" + str(cmd.vni)
        rsp.success = linux.populate_vxlan_fdb(interf, cmd.peers)

        if rsp.success != True:
            rsp.error = "error on populate fdb"

        return jsonobject.dumps(rsp)
    def populate_vxlan_fdbs(self, req):
        # populate vxlan fdb
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = PopulateVxlanFdbResponse

        interfs = linux.get_interfs_from_uuids(cmd.networkUuids)
        if interfs == []:
            rsp.success = True
            return jsonobject.dumps(rsp)

        for interf in interfs:
            if interf == "":
                continue
            if (linux.populate_vxlan_fdb(interf, cmd.peers) == False):
                rsp.success = False
                rsp.error = "error on populate fdb"
                return jsonobject.dumps(rsp)

        rsp.success = True
        return jsonobject.dumps(rsp)
Esempio n. 4
0
    def populate_vxlan_fdbs(self, req):
        # populate vxlan fdb
        cmd = jsonobject.loads(req[http.REQUEST_BODY])
        rsp = PopulateVxlanFdbResponse

        interfs = linux.get_interfs_from_uuids(cmd.networkUuids)
        if interfs == []:
            rsp.success = True
            return jsonobject.dumps(rsp)

        for interf in interfs:
            if interf == "":
                continue
            if (linux.populate_vxlan_fdb(interf, cmd.peers) == False):
                rsp.success = False
                rsp.error = "error on populate fdb"
                return jsonobject.dumps(rsp)

        rsp.success = True
        return jsonobject.dumps(rsp)