Class: ForemanProxmox::ProxmoxserversController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForemanProxmox::ProxmoxserversController
- Defined in:
- app/controllers/foreman_proxmox/proxmoxservers_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #reboot_node ⇒ Object
- #setcurrent ⇒ Object
- #show ⇒ Object
- #shutdown_node ⇒ Object
- #start_all_vms ⇒ Object
- #stop_all_vms ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
17 18 19 20 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 17 def create Proxmoxserver.create(params[:proxmoxserver]) redirect_to '/proxmox' end |
#destroy ⇒ Object
29 30 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 29 def destroy end |
#edit ⇒ Object
22 23 24 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 22 def edit @proxmox = Proxmoxserver.find(params[:id]) end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 4 def index @proxmoxservers = Proxmoxserver.all end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 13 def new @proxmox = Proxmoxserver.new end |
#reboot_node ⇒ Object
53 54 55 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 53 def reboot_node redirect_to :back end |
#setcurrent ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 32 def setcurrent oldcurrent = Proxmoxserver.where("current = 'true'").first if oldcurrent != nil then oldcurrent.current = false end newcurrent = Proxmoxserver.find(params[:id]) newcurrent.current= true if newcurrent.save then flash[:notice] = newcurrent.current end redirect_to :back end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 8 def show @proxmox = Proxmoxserver.find(params[:id]) end |
#shutdown_node ⇒ Object
57 58 59 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 57 def shutdown_node redirect_to :back end |
#start_all_vms ⇒ Object
45 46 47 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 45 def start_all_vms redirect_to :back end |
#stop_all_vms ⇒ Object
49 50 51 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 49 def stop_all_vms redirect_to :back end |
#update ⇒ Object
26 27 |
# File 'app/controllers/foreman_proxmox/proxmoxservers_controller.rb', line 26 def update end |