Sha256: 2ebc2349d10ab447114f9cfa737555eb83615ae1fff90d42e7510e1aba6161cb

Contents?: true

Size: 1.89 KB

Versions: 36

Compression:

Stored size: 1.89 KB

Contents

module ForemanPuppet
  module Extensions
    module ApiTemplateCombinationsController
      extend ActiveSupport::Concern

      included do
        if Gem::Dependency.new('', '>= 3.1').match?('', SETTINGS[:version].notag)
          index_desc = Apipie.get_method_description(self, :index)
          index_desc.apis << Apipie::MethodDescription::Api.new(:GET, '/environments/:environment_id/template_combinations', N_('List template combination'), {})

          create_desc = Apipie.get_method_description(self, :create)
          create_desc.apis << Apipie::MethodDescription::Api.new(:POST, '/environments/:environment_id/template_combinations', N_('Add a template combination'), {})

          show_desc = Apipie.get_method_description(self, :show)
          show_desc.apis << Apipie::MethodDescription::Api.new(:GET, '/environments/:environment_id/template_combinations/:id', N_('Show template combination'), {})

          update_desc = Apipie.get_method_description(self, :update)
          update_desc.apis << Apipie::MethodDescription::Api.new(:PUT, '/environments/:environment_id/template_combinations/:id', N_('Update template combination'), {})

          apipie_update_methods(%i[index create show update]) do
            param :environment_id, String, desc: N_('ID of Puppet environment')
          end

          apipie_update_methods(%i[create update]) do
            param :template_combination, Hash do
              param :environment_id, :number, allow_nil: true, desc: N_('environment id')
            end
          end
        elsif ForemanPuppet.extracted_from_core?
          apipie_update_methods(%i[index create show update]) do
            param :environment_id, nil, desc: N_('ID of environment')
          end
        end

        prepend PrependedMethods
      end

      module PrependedMethods
        def allowed_nested_id
          super | ['environment_id']
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
foreman_puppet-8.0.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.4.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-7.0.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.3.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.2.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.1.1 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-5.1.3 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.1.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.0.1 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-6.0.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-5.1.2 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-4.1.1 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-5.1.1 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-5.1.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-4.1.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-4.0.4 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-5.0.0 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-4.0.3 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-4.0.2 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
foreman_puppet-3.0.7 app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb