Sha256: 8a70d6e510ad68e352d5746588792e2807cf341fe01439bc4bbf0174e6742b5f

Contents?: true

Size: 405 Bytes

Versions: 6

Compression:

Stored size: 405 Bytes

Contents

module ForemanHdm
  class KeysController < ::ApplicationController
    before_action :find_host

    def index
      render json: proxy.keys(@host)
    end

    def show
      render json: proxy.key(@host, params[:id])
    end

    private

    def proxy
      ::ProxyAPI::Hdm.new(url: @host.hdm_proxy.url)
    end

    def find_host
      @host = ::Host.friendly.find(params[:host_id])
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_hdm-1.0.0 app/controllers/foreman_hdm/keys_controller.rb
foreman_hdm-0.1.4 app/controllers/foreman_hdm/keys_controller.rb
foreman_hdm-0.1.3 app/controllers/foreman_hdm/keys_controller.rb
foreman_hdm-0.1.2 app/controllers/foreman_hdm/keys_controller.rb
foreman_hdm-0.1.1 app/controllers/foreman_hdm/keys_controller.rb
foreman_hdm-0.1.0 app/controllers/foreman_hdm/keys_controller.rb