deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 03/10] CIMI: Added Action model
Date Tue, 29 Nov 2011 13:44:55 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/cimi/model.rb        |    1 +
 server/lib/cimi/model/action.rb |   24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100644 server/lib/cimi/model/action.rb

diff --git a/server/lib/cimi/model.rb b/server/lib/cimi/model.rb
index 5fee012..acd72ce 100644
--- a/server/lib/cimi/model.rb
+++ b/server/lib/cimi/model.rb
@@ -25,6 +25,7 @@ require 'cimi/model/base'
 require 'cimi/model/machine_template'
 require 'cimi/model/machine_image'
 require 'cimi/model/machine_configuration'
+require 'cimi/model/action'
 require 'cimi/model/machine'
 require 'cimi/model/volume'
 require 'cimi/model/machine_admin'
diff --git a/server/lib/cimi/model/action.rb b/server/lib/cimi/model/action.rb
new file mode 100644
index 0000000..627e673
--- /dev/null
+++ b/server/lib/cimi/model/action.rb
@@ -0,0 +1,24 @@
+# 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::Action < CIMI::Model::Base
+
+  text :action
+
+  def name
+    action.split('/').last.intern
+  end
+
+end
-- 
1.7.4.4


Mime
View raw message