def edit_vrf(self, id):
try:<EOL><INDENT>v = VRF.get(int(id))<EOL><DEDENT>except NipapError as e:<EOL><INDENT>return json.dumps({'<STR_LIT:error>': <NUM_LIT:1>, '<STR_LIT:message>': e.args, '<STR_LIT:type>': type(e).__name__})<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>v.rt = validate_string(request.json, '<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:name>' in request.json:<EOL><INDENT>v.name = validate_string(request.json, '<STR_LIT:name>')<EOL><DEDENT>if '<STR_LIT:description>' in request.json:<EOL><INDENT>v.description = validate_string(request.json, '<STR_LIT:description>')<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>v.tags = request.json['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>v.avps = request.json['<STR_LIT>']<EOL><DEDENT>try:<EOL><INDENT>v.save()<EOL><DEDENT>except NipapError as e:<EOL><INDENT>return json.dumps({'<STR_LIT:error>': <NUM_LIT:1>, '<STR_LIT:message>': e.args, '<STR_LIT:type>': type(e).__name__})<EOL><DEDENT>return json.dumps(v, cls=NipapJSONEncoder)<EOL>
Edit a VRF.