Class: Api::V2::AnsibleInventoriesController

Inherits:
BaseController
  • Object
show all
Includes:
Api::Version2
Defined in:
app/controllers/api/v2/ansible_inventories_controller.rb

Instance Method Summary collapse

Instance Method Details

#action_permissionObject



34
35
36
37
38
39
40
41
# File 'app/controllers/api/v2/ansible_inventories_controller.rb', line 34

def action_permission
  case params[:action]
  when 'hosts', 'hostgroups'
    :view
  else
    super
  end
end

#hostgroupsObject



30
31
32
# File 'app/controllers/api/v2/ansible_inventories_controller.rb', line 30

def hostgroups
  show_inventory :hostgroup_ids, :hostgroup_id
end

#hostsObject



26
27
28
# File 'app/controllers/api/v2/ansible_inventories_controller.rb', line 26

def hosts
  show_inventory :host_ids, :id
end