def _get_vrf(self, auth, spec, prefix = 'vrf_'):

        # find VRF from attributes vrf, vrf_id or vrf_name
        vrf = []
        if prefix + 'id' in spec:
            # if None, mangle it to being 0, ie our default VRF
            if spec[prefix + 'id'] is None:
                spec[prefix + 'id'] = 0
            vrf = self.list_vrf(auth, { 'id': spec[prefix + 'id'] })
        elif prefix + 'rt' in spec:
            vrf = self.list_vrf(auth, { 'rt': spec[prefix + 'rt'] })
        elif prefix + 'name' in spec:
            vrf = self.list_vrf(auth, { 'name': spec[prefix + 'name'] })
        else:
            # no VRF specified - return VRF "default"
            vrf = self.list_vrf(auth, { 'id': 0 })

        if len(vrf) > 0:
            return vrf[0]

        raise NipapNonExistentError('No matching VRF found.')
Get a VRF based on prefix spec
dataset/ETHPy150Open SpriteLink/NIPAP/nipap/nipap/backend.py/Nipap._get_vrf