]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/update_tenant.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / aviator / lib / puppet / feature / aviator / openstack / identity / requests / v2 / admin / update_tenant.rb
diff --git a/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/update_tenant.rb b/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/update_tenant.rb
new file mode 100644 (file)
index 0000000..91ae357
--- /dev/null
@@ -0,0 +1,47 @@
+module Aviator
+
+  define_request :update_tenant, :inherit => [:openstack, :common, :v2, :admin, :base] do
+
+    meta :service, :identity
+
+
+    link 'documentation',
+      'http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_updateTenant_v2.0_tenants__tenantId__.html'
+
+
+    param :id,          :required => true
+    param :name,        :required => false
+    param :enabled,     :required => false
+    param :description, :required => false
+
+
+    def body
+      p = {
+        :tenant => {}
+      }
+
+      [:name, :enabled, :description].each do |key|
+        p[:tenant][key] = params[key] unless params[key].nil?
+      end
+
+      p
+    end
+
+
+    def headers
+      super
+    end
+
+
+    def http_method
+      :put
+    end
+
+
+    def url
+      "#{ base_url }/tenants/#{ params[:id] }"
+    end
+
+  end
+
+end