deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/2] git commit: CIMI: Added missing VolumeConfigurationCreate (DTACLOUD-524)
Date Wed, 10 Apr 2013 19:30:40 GMT
Updated Branches:
  refs/heads/master 8231db2f1 -> 7b3e61e32


CIMI: Added missing VolumeConfigurationCreate (DTACLOUD-524)


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/706c7f9e
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/706c7f9e
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/706c7f9e

Branch: refs/heads/master
Commit: 706c7f9e975b5bb8a38fcf29b72de26d4a87824c
Parents: 8231db2
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Apr 10 16:43:11 2013 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed Apr 10 16:43:11 2013 +0200

----------------------------------------------------------------------
 server/lib/cimi/models.rb                          |    1 +
 server/lib/cimi/models/volume_configuration.rb     |    2 +-
 .../lib/cimi/models/volume_configuration_create.rb |   22 +++++++++++
 server/lib/cimi/service.rb                         |    1 +
 .../cimi/service/volume_configuration_create.rb    |   29 +++++++++++++++
 5 files changed, 54 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/706c7f9e/server/lib/cimi/models.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models.rb b/server/lib/cimi/models.rb
index 9a86990..99b3545 100644
--- a/server/lib/cimi/models.rb
+++ b/server/lib/cimi/models.rb
@@ -56,6 +56,7 @@ require_relative './models/credential_template'
 require_relative './models/credential_create'
 require_relative './models/volume'
 require_relative './models/volume_configuration'
+require_relative './models/volume_configuration_create'
 require_relative './models/volume_image'
 require_relative './models/volume_template'
 require_relative './models/volume_create'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/706c7f9e/server/lib/cimi/models/volume_configuration.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration.rb b/server/lib/cimi/models/volume_configuration.rb
index 7393b53..882bff5 100644
--- a/server/lib/cimi/models/volume_configuration.rb
+++ b/server/lib/cimi/models/volume_configuration.rb
@@ -19,7 +19,7 @@ class CIMI::Model::VolumeConfiguration < CIMI::Model::Base
 
   href :type
   text :format
-  text :capacity, :required => true
+  text :capacity
 
   array :operations do
     scalar :rel, :href

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/706c7f9e/server/lib/cimi/models/volume_configuration_create.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/volume_configuration_create.rb b/server/lib/cimi/models/volume_configuration_create.rb
new file mode 100644
index 0000000..18ef74e
--- /dev/null
+++ b/server/lib/cimi/models/volume_configuration_create.rb
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Model::VolumeConfigurationCreate < CIMI::Model::Base
+
+  href :type
+  text :format
+  text :capacity, :required => true
+
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/706c7f9e/server/lib/cimi/service.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service.rb b/server/lib/cimi/service.rb
index 58bed94..6c6b4ed 100644
--- a/server/lib/cimi/service.rb
+++ b/server/lib/cimi/service.rb
@@ -65,6 +65,7 @@ require_relative './service/network_port'
 require_relative './service/forwarding_group_template'
 require_relative './service/credential_template'
 require_relative './service/volume_configuration'
+require_relative './service/volume_configuration_create'
 require_relative './service/cloud_entry_point'
 require_relative './service/network_configuration'
 require_relative './service/address_template'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/706c7f9e/server/lib/cimi/service/volume_configuration_create.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/volume_configuration_create.rb b/server/lib/cimi/service/volume_configuration_create.rb
new file mode 100644
index 0000000..83feb76
--- /dev/null
+++ b/server/lib/cimi/service/volume_configuration_create.rb
@@ -0,0 +1,29 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+class CIMI::Service::VolumeConfigurationCreate < CIMI::Service::Base
+
+  def create
+    new_config = self.class.current_db.add_volume_configuration(
+      :name => name,
+      :description => description,
+      :format => format,
+      :capacity => capacity,
+      :ent_properties => property.to_json
+    )
+    CIMI::Service::VolumeConfiguration.from_db(new_config, context)
+  end
+
+end


Mime
View raw message