'Queries the placement API for a resource class supplied resource
class string name. If the resource class does not exist, creates it.
Returns the resource class name if exists or was created, else None.
:param name: String name of the resource class to check/create.'

def _get_or_create_resource_class(self, name):

    resp = self.get(('/resource_classes/%s' % name), version='1.2')
    if (200 <= resp.status_code < 300):
        return name
    elif (resp.status_code == 404):
        self._create_resource_class(name)
        return name
    else:
        msg = _LE('Failed    to    retrieve    resource    class    record    from    placement    API    for    resource    class    %(rc_name)s.    Got    %(status_code)d:    %(err_text)s.')
        args = {'rc_name': name, 'status_code': resp.status_code, 'err_text': resp.text}
        LOG.error(msg, args)
        return None
