deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1211952 - in /deltacloud/trunk/server/lib/cimi: model.rb model/entity_metadata_collection.rb
Date Thu, 08 Dec 2011 16:22:13 GMT
Author: marios
Date: Thu Dec  8 16:22:13 2011
New Revision: 1211952

URL: http://svn.apache.org/viewvc?rev=1211952&view=rev
Log:
Adds CIMI::EntityMetadataCollection - note this is not a 'proper' top-level
collection in CIMI... and won't appear as such in CloudEntryPoint.

Implemented to help avoiding xml parsing by hand in the the CIMI html UI

Added:
    deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb
Modified:
    deltacloud/trunk/server/lib/cimi/model.rb

Modified: deltacloud/trunk/server/lib/cimi/model.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model.rb?rev=1211952&r1=1211951&r2=1211952&view=diff
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model.rb (original)
+++ deltacloud/trunk/server/lib/cimi/model.rb Thu Dec  8 16:22:13 2011
@@ -44,3 +44,4 @@ require 'cimi/model/volume_configuration
 require 'cimi/model/volume_image_collection'
 require 'cimi/model/volume_template_collection'
 require 'cimi/model/entity_metadata'
+require 'cimi/model/entity_metadata_collection'

Added: deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb
URL: http://svn.apache.org/viewvc/deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb?rev=1211952&view=auto
==============================================================================
--- deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb (added)
+++ deltacloud/trunk/server/lib/cimi/model/entity_metadata_collection.rb Thu Dec  8 16:22:13
2011
@@ -0,0 +1,31 @@
+# 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::EntityMetadataCollection < CIMI::Model::Base
+
+  array :entity_metadata do
+    scalar :href
+  end
+
+  def self.default(context)
+    self.new(
+      :uri => context.entity_metadata_url,
+      :name => 'default',
+      :created => Time.now,
+      :entity_metadata => EntityMetadata.all(context).map{|em| {:href => em.uri}}
+   )
+  end
+
+end



Mime
View raw message