]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/create_tenant.rb
add aimonb/aviator to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / aviator / lib / puppet / feature / aviator / openstack / identity / requests / v2 / admin / create_tenant.rb
diff --git a/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/create_tenant.rb b/3rdparty/modules/aviator/lib/puppet/feature/aviator/openstack/identity/requests/v2/admin/create_tenant.rb
new file mode 100644 (file)
index 0000000..6578ae0
--- /dev/null
@@ -0,0 +1,43 @@
+module Aviator
+
+  define_request :create_tenant, :inherit => [:openstack, :common, :v2, :admin, :base] do
+
+    meta :service, :identity
+
+    link 'documentation',
+         'http://docs.openstack.org/api/openstack-identity-service/2.0/content/'
+
+
+    param :name,        :required => true
+    param :description, :required => true
+    param :enabled,     :required => true
+
+
+    def body
+      {
+        :tenant => {
+          :name        => params[:name],
+          :description => params[:description],
+          :enabled     => params[:enabled]
+        }
+      }
+    end
+
+
+    def headers
+      super
+    end
+
+
+    def http_method
+      :post
+    end
+
+
+    def url
+      "#{ base_url }/tenants"
+    end
+
+  end
+
+end
\ No newline at end of file