Class: ForemanIpam::DashboardController

Inherits:
DashboardController
  • Object
show all
Defined in:
app/controllers/foreman_ipam/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#ipamObject



5
6
7
8
9
10
11
# File 'app/controllers/foreman_ipam/dashboard_controller.rb', line 5

def ipam
  begin
    @response = Phpipam.proxy.get_groups
  rescue => e
    flash.now[:notice] = e.message
  end 
end

#subnetsObject



13
14
15
16
17
18
19
20
# File 'app/controllers/foreman_ipam/dashboard_controller.rb', line 13

def subnets
  begin
    @subnets = Phpipam.proxy.get_subnets_by_group(params[:group])
  rescue => e
    flash.now[:notice] = e.message
  end
  render :json => @subnets.to_json, :status => :ok
end