deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/4] git commit: CIMI: Added 'created' attribute to MachineTemplate
Date Mon, 14 Jan 2013 13:17:34 GMT
CIMI: Added 'created' attribute to MachineTemplate

- New dependency: dm-timestamps


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

Branch: refs/heads/master
Commit: d35002c8b5dc9b0775e81847cc253104bc713b2e
Parents: e733875
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Dec 14 13:20:32 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Jan 14 13:16:53 2013 +0100

----------------------------------------------------------------------
 server/deltacloud-core.gemspec             |    1 +
 server/lib/cimi/models/machine_template.rb |    1 +
 server/lib/db/entity.rb                    |    2 ++
 3 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d35002c8/server/deltacloud-core.gemspec
----------------------------------------------------------------------
diff --git a/server/deltacloud-core.gemspec b/server/deltacloud-core.gemspec
index f022b2e..7fad5be 100644
--- a/server/deltacloud-core.gemspec
+++ b/server/deltacloud-core.gemspec
@@ -80,6 +80,7 @@ Gem::Specification.new do |s|
 
   s.add_dependency('data_mapper')
   s.add_dependency('dm-sqlite-adapter')
+  s.add_dependency('dm-timestamps')
 
   # dependencies for various cloud providers:
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d35002c8/server/lib/cimi/models/machine_template.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_template.rb b/server/lib/cimi/models/machine_template.rb
index 90ed025..4fb8cd5 100644
--- a/server/lib/cimi/models/machine_template.rb
+++ b/server/lib/cimi/models/machine_template.rb
@@ -103,6 +103,7 @@ class CIMI::Model::MachineTemplate < CIMI::Model::Base
         :machine_config => { :href => model.machine_config },
         :machine_image => { :href => model.machine_image },
         :property => model.ent_properties,
+        :created => Time.parse(model.created_at.to_s).xmlschema,
         :operations => [
           { :href => context.destroy_machine_template_url(model.id), :rel => 'http://schemas.dmtf.org/cimi/1/action/delete'
}
         ]

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d35002c8/server/lib/db/entity.rb
----------------------------------------------------------------------
diff --git a/server/lib/db/entity.rb b/server/lib/db/entity.rb
index c9845a4..2f2afd7 100644
--- a/server/lib/db/entity.rb
+++ b/server/lib/db/entity.rb
@@ -12,6 +12,8 @@ module Deltacloud
       property :be_kind, String, :required => true # => Machine, MachineImage, ...
       property :be_id, String, :required => true # => Original Machine 'id'
 
+      property :created_at, DateTime
+      property :updated_at, DateTime
     end
 
     class Entity < BaseEntity


Mime
View raw message