def edit_pool(self, id):
<EOL>p = Pool.get(int(id))<EOL>if '<STR_LIT:name>' in request.json:<EOL><INDENT>p.name = validate_string(request.json, '<STR_LIT:name>')<EOL><DEDENT>if '<STR_LIT:description>' in request.json:<EOL><INDENT>p.description = validate_string(request.json, '<STR_LIT:description>')<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>p.default_type = validate_string(request.json, '<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>p.ipv4_default_prefix_length = request.json['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>p.ipv6_default_prefix_length = request.json['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>p.tags = request.json['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in request.json:<EOL><INDENT>p.avps = request.json['<STR_LIT>']<EOL><DEDENT>try:<EOL><INDENT>p.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(p, cls=NipapJSONEncoder)<EOL>
Edit a pool.