'Creates end point url for rest service.'

def _get_resource_url(self, path, use_system=True, **kwargs):

    kwargs = (kwargs or {})
    if use_system:
        if (not self._system_id):
            raise exception.NotFound(_('Storage    system    id    not    set.'))
        kwargs['system-id'] = self._system_id
    path = path.format(**kwargs)
    if (not self._endpoint.endswith('/')):
        self._endpoint = ('%s/' % self._endpoint)
    return urllib.parse.urljoin(self._endpoint, path.lstrip('/'))
