def save(self):
xmlrpc = XMLRPCConnection()<EOL>data = {<EOL>'<STR_LIT:name>': self.name,<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT>': self.default_type,<EOL>'<STR_LIT>': self.ipv4_default_prefix_length,<EOL>'<STR_LIT>': self.ipv6_default_prefix_length,<EOL>'<STR_LIT>': [],<EOL>'<STR_LIT>': self.avps<EOL>}<EOL>for tag_name in self.tags:<EOL><INDENT>data['<STR_LIT>'].append(tag_name)<EOL><DEDENT>if self.id is None:<EOL><INDENT>try:<EOL><INDENT>pool = xmlrpc.connection.add_pool(<EOL>{<EOL>'<STR_LIT>': data,<EOL>'<STR_LIT>': self._auth_opts.options<EOL>})<EOL><DEDENT>except xmlrpclib.Fault as xml_fault:<EOL><INDENT>raise _fault_to_exception(xml_fault)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>pools = xmlrpc.connection.edit_pool(<EOL>{<EOL>'<STR_LIT>': { '<STR_LIT:id>': self.id },<EOL>'<STR_LIT>': data,<EOL>'<STR_LIT>': self._auth_opts.options<EOL>})<EOL><DEDENT>except xmlrpclib.Fault as xml_fault:<EOL><INDENT>raise _fault_to_exception(xml_fault)<EOL><DEDENT>if len(pools) != <NUM_LIT:1>:<EOL><INDENT>raise NipapError('<STR_LIT>' % len(pools))<EOL><DEDENT>pool = pools[<NUM_LIT:0>]<EOL><DEDENT>Pool.from_dict(pool, self)<EOL>_cache['<STR_LIT>'][self.id] = self<EOL>
Save changes made to pool to NIPAP.

            If the object represents a new pool unknown to NIPAP (attribute
            `id` is `None`) this function maps to the function
            :py:func:`nipap.backend.Nipap.add_pool` in the backend, used to
            create a new pool. Otherwise it maps to the function
            :py:func:`nipap.backend.Nipap.edit_pool` in the backend, used to
            modify the pool. Please see the documentation for the backend
            functions for information regarding input arguments and return
            values.