]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/compute/requests/v2/public/add_floating_ip.rb
add aimonb/aviator to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / aviator / lib / puppet / feature / aviator / openstack / compute / requests / v2 / public / add_floating_ip.rb
diff --git a/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/compute/requests/v2/public/add_floating_ip.rb b/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/compute/requests/v2/public/add_floating_ip.rb
new file mode 100644 (file)
index 0000000..56ff624
--- /dev/null
@@ -0,0 +1,38 @@
+module Aviator
+
+  define_request :add_floating_ip, :inherit => [:openstack, :common, :v2, :public, :base] do
+
+    meta :service, :compute
+
+    link 'documentation',
+         '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'
+
+    param :server_id, :required => true
+    param :address,   :required => true
+
+    def body
+      {
+        :addFloatingIp => {
+          :address => params[:address]
+        }
+      }
+    end
+
+
+    def headers
+      super
+    end
+
+
+    def http_method
+      :post
+    end
+
+
+    def url
+      "#{ base_url }/servers/#{ params[:server_id] }/action"
+    end
+
+  end
+
+end