deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [4/4] git commit: CIMI: Adds VSPTemplate entity and views to CIMI Client
Date Tue, 20 Mar 2012 10:16:04 GMT
CIMI: Adds VSPTemplate entity and views to CIMI Client


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

Branch: refs/heads/master
Commit: a0996bcd0c63d351e187a8fd30a4a83a32e73c67
Parents: 8c557c2
Author: marios <marios@redhat.com>
Authored: Mon Mar 19 18:14:04 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Tue Mar 20 12:14:20 2012 +0200

----------------------------------------------------------------------
 clients/cimi/app.rb                         |    1 +
 clients/cimi/lib/entities.rb                |    1 +
 clients/cimi/lib/entities/vsp_template.rb   |   30 ++++++++++++++++++++++
 clients/cimi/views/vsp_templates/index.haml |   30 ++++++++++++++++++++++
 clients/cimi/views/vsp_templates/show.haml  |   29 +++++++++++++++++++++
 5 files changed, 91 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a0996bcd/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 6a124e5..d9423f9 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -35,6 +35,7 @@ module CIMI::Frontend
     use CIMI::Frontend::RoutingGroupTemplate
     use CIMI::Frontend::VSP
     use CIMI::Frontend::VSPConfiguration
+    use CIMI::Frontend::VSPTemplate
     use Rack::Session::Cookie
 
     helpers CIMI::Frontend::Helper

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a0996bcd/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 7071bf2..3442360 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -35,3 +35,4 @@ require 'entities/routing_group'
 require 'entities/routing_group_template'
 require 'entities/vsp'
 require 'entities/vsp_configuration'
+require 'entities/vsp_template'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a0996bcd/clients/cimi/lib/entities/vsp_template.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/vsp_template.rb b/clients/cimi/lib/entities/vsp_template.rb
new file mode 100644
index 0000000..93f238f
--- /dev/null
+++ b/clients/cimi/lib/entities/vsp_template.rb
@@ -0,0 +1,30 @@
+# 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::Frontend::VSPTemplate < CIMI::Frontend::Entity
+
+  get '/cimi/vsp_templates/:id' do
+    vsp_template_xml = get_entity('vsp_templates', params[:id], credentials)
+    @vsp_template = CIMI::Model::VSPTemplate.from_xml(vsp_template_xml)
+    haml :'vsp_templates/show'
+  end
+
+  get '/cimi/vsp_templates' do
+    vsp_templates_xml = get_entity_collection('vsp_templates', credentials)
+    @vsp_templates = CIMI::Model::VSPTemplateCollection.from_xml(vsp_templates_xml)
+    haml :'vsp_templates/index'
+  end
+
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a0996bcd/clients/cimi/views/vsp_templates/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/vsp_templates/index.haml b/clients/cimi/views/vsp_templates/index.haml
new file mode 100644
index 0000000..025f438
--- /dev/null
+++ b/clients/cimi/views/vsp_templates/index.haml
@@ -0,0 +1,30 @@
+- @title=@vsp_templates.description
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      VSPTemplateCollection
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@vsp_templates.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@vsp_templates.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+  %p
+    A VSP Template Collection entity represents the collection of VSP Templates within a
Provider.
+    This entity can be used to locate and create VSP Templates.
+
+%h3 VSPTemplateCollection
+%ul
+  - @vsp_templates.vsp_templates.each do |vsp_templ|
+    %li
+      %a{ :href => "/cimi/vsp_templates/#{vsp_templ.href.split('/').last}"}=vsp_templ.href.split('/').last
+
+-details 'VSPTemplateCollection details' do
+  -row 'ID', @vsp_templates.id
+  -row 'Description', @vsp_templates.description
+  -row 'Created', @vsp_templates.created

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a0996bcd/clients/cimi/views/vsp_templates/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/vsp_templates/show.haml b/clients/cimi/views/vsp_templates/show.haml
new file mode 100644
index 0000000..157a8fd
--- /dev/null
+++ b/clients/cimi/views/vsp_templates/show.haml
@@ -0,0 +1,29 @@
+- @title="#{@vsp_template.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/vsp_templates"} VSPTemplateCollection
+      %span.divider="/"
+    %li.active
+      = @vsp_template.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@vsp_template.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@vsp_template.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+  %p
+    The VSP Template is a set of Configuration values for realizing a VSP.
+    A VSP Template may be used to create multiple VSPs
+
+-details 'VSPTemplate details' do
+  -row 'ID', @vsp_template.id
+  -row 'Description', @vsp_template.description
+  -row 'Created', @vsp_template.created
+  -row 'Network', @vsp_template.network.href
+  -row 'VSP Config', @vsp_template.vsp_config.href


Mime
View raw message