'Get the id of the configured storage pool'

def _get_storage_pool_id(self, domain_name, pool_name):

    if ((not domain_name) or (not pool_name)):
        msg = (_('Unable    to    query    the    storage    pool    id    for    Pool    %(pool_name)s    and    Domain    %(domain_name)s.') % {'pool_name': pool_name, 'domain_name': domain_name})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    fullname = '{}:{}'.format(domain_name, pool_name)
    if (fullname in self.cache_sp):
        return self.cache_sp[fullname]
    domain_id = self._get_protection_domain_id(domain_name)
    encoded_pool_name = urllib.parse.quote(pool_name, '')
    req_vars = {'server_ip': self.server_ip, 'server_port': self.server_port, 'domain_id': domain_id, 'encoded_pool_name': encoded_pool_name}
    request = ('https://%(server_ip)s:%(server_port)s/api/types/Pool/instances/getByName::%(domain_id)s,%(encoded_pool_name)s' % req_vars)
    LOG.debug('ScaleIO    get    pool    id    by    name    request:    %s.', request)
    (r, pool_id) = self._execute_scaleio_get_request(request)
    if (not pool_id):
        msg = (_("Pool    with    name    %(pool_name)s    wasn't    found    in    domain    %(domain_id)s.") % {'pool_name': pool_name, 'domain_id': domain_id})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    if ((r.status_code != http_client.OK) and ('errorCode' in pool_id)):
        msg = (_('Error    getting    pool    id    from    name    %(pool_name)s:    %(err_msg)s.') % {'pool_name': pool_name, 'err_msg': pool_id['message']})
        LOG.error(msg)
        raise exception.VolumeBackendAPIException(data=msg)
    LOG.info('Pool    id    is    %s.', pool_id)
    self.cache_sp[fullname] = pool_id
    return pool_id
