get_url

        High-level api: get_url returns a Restconf URL of the config node.

        Parameters
        ----------

        instance : `bool`
            True if the Restconf URL refers to only one instance of a list or
            leaf-list. False if the Restconf URL refers to all instances of a
            list or leaf-list.

        Returns
        -------

        str
            A Restconf URL.

def get_url(self, instance=True):
        '''get_url

        High-level api: get_url returns a Restconf URL of the config node.

        Parameters
        ----------

        instance : `bool`
            True if the Restconf URL refers to only one instance of a list or
            leaf-list. False if the Restconf URL refers to all instances of a
            list or leaf-list.

        Returns
        -------

        str
            A Restconf URL.
        '''

        def convert(default_ns, nodes):
            ret = ''
            for node in nodes:
                default_ns, id = self.device.convert_tag(default_ns, node.tag,
                                                         dst=Tag.JSON_NAME)
                ret += '/' + quote(id, safe='')
                if self.is_config:
                    n = Composer(self.device, node)
                    if n.schema_node.get('type') == 'leaf-list':
                        if node != self.node or instance:
                            ret += '={}'.format(quote(node.text, safe=''))
                    elif n.schema_node.get('type') == 'list':
                        if node != self.node or instance:
                            values = []
                            for key in n.keys:
                                values.append(quote(node.find(key).text,
                                                    safe=''))
                            ret += '={}'.format(','.join(values))
            return ret

        nodes = list(reversed(list(self.node.iterancestors())))[1:] + \
                [self.node]
        return '/restconf/data' + convert('', nodes)