Class: ForemanKatelloEngine::ActivationKeysController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/foreman_katello_engine/activation_keys_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
# File 'app/controllers/foreman_katello_engine/activation_keys_controller.rb', line 3

def index
  environment = ::Environment.find_by_id(params[:environment_id])
  raise "Selected environment has now Katello connection" unless environment.katello_id
  kt_org_label, kt_env_label, kt_cv_label = environment.katello_id.split('/')

  ak_data = ForemanKatelloEngine::Bindings.activation_keys_to_subscriptions(kt_org_label, kt_env_label, kt_cv_label)
  render :status => 200, :json => ak_data, :content_type => 'application/json'
end