]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/compute/requests/v2/public/reboot_server.rb
add aimonb/aviator to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / aviator / lib / puppet / feature / aviator / openstack / compute / requests / v2 / public / reboot_server.rb
1 module Aviator
2
3   define_request :reboot_server, :inherit => [:openstack, :common, :v2, :public, :base] do
4
5     meta :service, :compute
6
7     link 'documentation',
8          'http://docs.openstack.org/api/openstack-compute/2/content/Reboot_Server-d1e3371.html'
9
10     param :id,   :required => true
11     param :type, :required => false
12
13
14     def body
15       p = {
16         :reboot => {
17           :type => params[:type] || 'SOFT'
18         }
19       }
20
21       p
22     end
23
24
25     def headers
26       super
27     end
28
29
30     def http_method
31       :post
32     end
33
34
35     def url
36       "#{ base_url }/servers/#{ params[:id] }/action"
37     end
38
39   end
40
41 end