'Calls the placement API to create a new resource provider record.
Returns a dict of resource provider information object representing
the newly-created resource provider.
:param uuid: UUID of the new resource provider
:param name: Name of the resource provider'

@safe_connect
def _create_resource_provider(self, uuid, name):

    url = '/resource_providers'
    payload = {'uuid': uuid, 'name': name}
    resp = self.post(url, payload)
    placement_req_id = get_placement_request_id(resp)
    if (resp.status_code == 201):
        msg = _LI('[%(placement_req_id)s]    Created    resource    provider    record    via    placement    API    for    resource    provider    with    UUID    %(uuid)s    and    name    %(name)s.')
        args = {'uuid': uuid, 'name': name, 'placement_req_id': placement_req_id}
        LOG.info(msg, args)
        return dict(uuid=uuid, name=name, generation=0)
    elif (resp.status_code == 409):
        msg = _LI('[%(placement_req_id)s]    Another    thread    already    created    a    resource    provider    with    the    UUID    %(uuid)s.    Grabbing    that    record    from    the    placement    API.')
        args = {'uuid': uuid, 'placement_req_id': placement_req_id}
        LOG.info(msg, args)
        return self._get_resource_provider(uuid)
    else:
        msg = _LE('[%(placement_req_id)s]    Failed    to    create    resource    provider    record    in    placement    API    for    UUID    %(uuid)s.    Got    %(status_code)d:    %(err_text)s.')
        args = {'uuid': uuid, 'status_code': resp.status_code, 'err_text': resp.text, 'placement_req_id': placement_req_id}
        LOG.error(msg, args)
