def consumer_create
      content_view_environment = find_content_view_environment
      host = Katello::Host::SubscriptionFacet.find_or_create_host(content_view_environment.environment.organization, rhsm_params)

      Katello::RegistrationManager.register_host(host, rhsm_params, content_view_environment)
      host.reload

      update_host_registered_through(host, request.headers)

      render :json => Resources::Candlepin::Consumer.get(host.subscription_facet.uuid)
    end
def consumer_create
      content_view_environment = find_content_view_environment
      host = Katello::Host::SubscriptionFacet.find_or_create_host(content_view_environment.environment.organization, rhsm_params)

      Katello::RegistrationManager.register_host(host, rhsm_params, content_view_environment)
      host.reload

      update_host_registered_through(host, request.headers)

      render :json => Resources::Candlepin::Consumer.get(host.subscription_facet.uuid)
    end
api :POST, "/environments/:environment_id/consumers", N_("Register a consumer in environment")