56ff624579b2e04ced6d5b56de7ed49240a2900c
[mirror/dsa-puppet.git] /
1 module Aviator
2
3   define_request :add_floating_ip, :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/POST_os-floating-ips-v2_AddFloatingIP__v2__tenant_id__servers__server_id__action_ext-os-floating-ips.html#POST_os-floating-ips-v2_AddFloatingIP__v2__tenant_id__servers__server_id__action_ext-os-floating-ips-Request'
9
10     param :server_id, :required => true
11     param :address,   :required => true
12
13     def body
14       {
15         :addFloatingIp => {
16           :address => params[:address]
17         }
18       }
19     end
20
21
22     def headers
23       super
24     end
25
26
27     def http_method
28       :post
29     end
30
31
32     def url
33       "#{ base_url }/servers/#{ params[:server_id] }/action"
34     end
35
36   end
37
38 end