'Calls the placement API to create a new resource class.
:param name: String name of the resource class to create.
:returns: None on successful creation.
:raises: `exception.InvalidResourceClass` upon error.'

def _create_resource_class(self, name):

    url = '/resource_classes'
    payload = {'name': name}
    resp = self.post(url, payload, version='1.2')
    if (200 <= resp.status_code < 300):
        msg = _LI('Created    resource    class    record    via    placement    API    for    resource    class    %s.')
        LOG.info(msg, name)
    elif (resp.status_code == 409):
        msg = _LI('Another    thread    already    created    a    resource    class    with    the    name    %s.    Returning.')
        LOG.info(msg, name)
    else:
        msg = _LE('Failed    to    create    resource    class    %(resource_class)s    in    placement    API.    Got    %(status_code)d:    %(err_text)s.')
        args = {'resource_class': name, 'status_code': resp.status_code, 'err_text': resp.text}
        LOG.error(msg, args)
        raise exception.InvalidResourceClass(resource_class=name)
