Sha256: 1bf7a66a284aab73356cdb76ca506e492e958cef81612db44eb15b3faf748743

Contents?: true

Size: 1.44 KB

Versions: 38

Compression:

Stored size: 1.44 KB

Contents

module ForemanPuppet
  module Extensions
    module ApiHostgroupsController
      extend ActiveSupport::Concern

      included do
        prepend PatchMethods

        method_desc = Apipie.get_method_description(self, :index)
        method_desc.apis << Apipie::MethodDescription::Api.new(:GET, '/puppetclasses/:puppetclass_id/hostgroups', N_('List all host groups for a Puppet class'), {})

        apipie_update_methods([:index]) do
          param :puppetclass_id, String, desc: N_('ID of Puppetclass')
        end

        apipie_update_methods(%i[create update]) do
          param :hostgroup, Hash do
            param :environment_id, String, desc: N_('Deprecated in favor of hostgroup/puppet_attributes/environment_id')
            param :puppetclass_ids, Array, desc: N_('Deprecated in favor of hostgroup/puppet_attributes/puppetclass_ids')
            param :config_group_ids, Array, desc: N_('Deprecated in favor of hostgroup/puppet_attributes/config_group_ids')

            param :puppet_attributes, Hash do
              param :environment_id, String, desc: N_('ID of associated puppet Environment')
              param :puppetclass_ids, Array, desc: N_('IDs of associated Puppetclasses')
              param :config_group_ids, Array, desc: N_('IDs of associated ConfigGroups')
            end
          end
        end
      end

      module PatchMethods
        def allowed_nested_id
          super | ['puppetclass_id']
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

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