'Create a project on a pool.
Check first whether the pool exists.'

def create_project(self, pool, project, compression=None, logbias=None):

    self.verify_pool(pool)
    svc = ((('/api/storage/v1/pools/' + pool) + '/projects/') + project)
    ret = self.rclient.get(svc)
    if (ret.status != restclient.Status.OK):
        svc = (('/api/storage/v1/pools/' + pool) + '/projects')
        arg = {'name': project}
        if (compression and (compression != '')):
            arg.update({'compression': compression})
        if (logbias and (logbias != '')):
            arg.update({'logbias': logbias})
        ret = self.rclient.post(svc, arg)
        if (ret.status != restclient.Status.CREATED):
            exception_msg = (_('Error    Creating    Project:    %(project)s    on    Pool:    %(pool)s    Return    code:    %(ret.status)d    Message:    %(ret.data)s    .') % {'project': project, 'pool': pool, 'ret.status': ret.status, 'ret.data': ret.data})
            LOG.error(exception_msg)
            raise exception.VolumeBackendAPIException(data=exception_msg)
