def save(self, args=None):
if args is None:<EOL><INDENT>args = {}<EOL><DEDENT>xmlrpc = XMLRPCConnection()<EOL>data = {<EOL>'<STR_LIT:description>': self.description,<EOL>'<STR_LIT>': self.comment,<EOL>'<STR_LIT>': [],<EOL>'<STR_LIT>': self.node,<EOL>'<STR_LIT:type>': self.type,<EOL>'<STR_LIT>': self.country,<EOL>'<STR_LIT>': self.order_id,<EOL>'<STR_LIT>': self.customer_id,<EOL>'<STR_LIT>': self.external_key,<EOL>'<STR_LIT>': self.alarm_priority,<EOL>'<STR_LIT>': self.monitor,<EOL>'<STR_LIT>': self.vlan,<EOL>'<STR_LIT>': self.avps,<EOL>'<STR_LIT>': self.expires<EOL>}<EOL>if self.status is not None:<EOL><INDENT>data['<STR_LIT:status>'] = self.status<EOL><DEDENT>for tag_name in self.tags:<EOL><INDENT>data['<STR_LIT>'].append(tag_name)<EOL><DEDENT>if self.vrf is not None:<EOL><INDENT>if not isinstance(self.vrf, VRF):<EOL><INDENT>raise NipapValueError("<STR_LIT>")<EOL><DEDENT>data['<STR_LIT>'] = self.vrf.id<EOL><DEDENT>if self.prefix is not None:<EOL><INDENT>data['<STR_LIT>'] = self.prefix<EOL><DEDENT>if self.pool is None:<EOL><INDENT>data['<STR_LIT>'] = None<EOL><DEDENT>else:<EOL><INDENT>if not isinstance(self.pool, Pool):<EOL><INDENT>raise NipapValueError("<STR_LIT>")<EOL><DEDENT>data['<STR_LIT>'] = self.pool.id<EOL><DEDENT>if self.id is None:<EOL><INDENT>x_args = {}<EOL>if '<STR_LIT>' in args:<EOL><INDENT>x_args['<STR_LIT>'] = { '<STR_LIT:id>': args['<STR_LIT>'].id }<EOL><DEDENT>if '<STR_LIT>' in args:<EOL><INDENT>x_args['<STR_LIT>'] = args['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in args:<EOL><INDENT>x_args['<STR_LIT>'] = args['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in args:<EOL><INDENT>x_args['<STR_LIT>'] = args['<STR_LIT>']<EOL><DEDENT>try:<EOL><INDENT>prefix = xmlrpc.connection.add_prefix(<EOL>{<EOL>'<STR_LIT>': data,<EOL>'<STR_LIT:args>': x_args,<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>data['<STR_LIT>'] = self.authoritative_source<EOL>try:<EOL><INDENT>prefixes = xmlrpc.connection.edit_prefix(<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(prefixes) != <NUM_LIT:1>:<EOL><INDENT>raise NipapError('<STR_LIT>' % len(prefixes))<EOL><DEDENT>prefix = prefixes[<NUM_LIT:0>]<EOL><DEDENT>Prefix.from_dict(prefix, self)<EOL>_cache['<STR_LIT>'][self.id] = self<EOL>if self.pool is not None:<EOL><INDENT>if self.pool.id in _cache['<STR_LIT>']:<EOL><INDENT>del _cache['<STR_LIT>'][self.pool.id]<EOL><DEDENT><DEDENT>
Save prefix to NIPAP.

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