You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/02/20 01:29:39 UTC
[1/3] git commit: CIMI client: display ForwardingGroupTemplates
CIMI client: display ForwardingGroupTemplates
Partial fix for DTACLOUD-409
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/dc404992
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/dc404992
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/dc404992
Branch: refs/heads/master
Commit: dc4049925e2d56b45bab4e3adc1662cfb95a47e2
Parents: db3c40f
Author: NjeriChelimo <ma...@gmail.com>
Authored: Tue Jan 22 11:39:21 2013 +0300
Committer: David Lutterkort <lu...@redhat.com>
Committed: Tue Feb 19 15:59:10 2013 -0800
----------------------------------------------------------------------
clients/cimi/app.rb | 1 +
clients/cimi/lib/entities.rb | 1 +
.../cimi/lib/entities/forwarding_group_template.rb | 30 +++++++++++++++
.../views/forwarding_group_templates/index.haml | 24 ++++++++++++
.../views/forwarding_group_templates/show.haml | 30 +++++++++++++++
5 files changed, 86 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dc404992/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 3809425..ef96e12 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -41,6 +41,7 @@ module CIMI::Frontend
use CIMI::Frontend::VSP
use CIMI::Frontend::VSPConfiguration
use CIMI::Frontend::VSPTemplate
+ use CIMI::Frontend::ForwardingGroupTemplate
use Rack::Session::Cookie
helpers CIMI::Frontend::Helper
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dc404992/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index c5c40df..b6da8e8 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -22,6 +22,7 @@ require 'entities/base_entity'
require 'entities/cloud_entry_point'
require 'entities/address'
require 'entities/address_template'
+require 'entities/forwarding_group_template'
require 'entities/machine_configuration'
require 'entities/machine_admin'
require 'entities/machine_image'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dc404992/clients/cimi/lib/entities/forwarding_group_template.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/forwarding_group_template.rb b/clients/cimi/lib/entities/forwarding_group_template.rb
new file mode 100644
index 0000000..1636ad8
--- /dev/null
+++ b/clients/cimi/lib/entities/forwarding_group_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::ForwardingGroupTemplate < CIMI::Frontend::Entity
+
+ get '/cimi/forwarding_group_templates/:id' do
+ fg_template_xml = get_entity('forwarding_group_templates', params[:id], credentials)
+ @fg_template = CIMI::Model::ForwardingGroupTemplate.from_xml(fg_template_xml)
+ haml :'forwarding_group_templates/show'
+ end
+
+ get '/cimi/forwarding_group_templates' do
+ fg_templates_xml = get_entity_collection('forwarding_group_templates', credentials)
+ @fg_templates = CIMI::Model::ForwardingGroupTemplateCollection.from_xml(fg_templates_xml)
+ haml :'forwarding_group_templates/index'
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dc404992/clients/cimi/views/forwarding_group_templates/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/forwarding_group_templates/index.haml b/clients/cimi/views/forwarding_group_templates/index.haml
new file mode 100644
index 0000000..a7c518a
--- /dev/null
+++ b/clients/cimi/views/forwarding_group_templates/index.haml
@@ -0,0 +1,24 @@
+- @title=collection_name @fg_templates
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li.active
+ ForwardingGroupTemplateCollection
+- content_for :actions do
+ %p
+ %a{ :href => "#{@fg_templates.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@fg_templates.id}?format=json", :class => 'label warning' } JSON
+
+
+%h3 ForwardingGroupTemplateCollection
+%ul
+ - @fg_templates.forwarding_group_templates.each do |fg_template|
+ %li
+ %a{ :href => "/cimi/forwarding_group_templates/#{href_to_id fg_template.id}"}=href_to_id(fg_template.id)
+
+-details 'ForwardingGroupTemplateCollection details' do
+ -row 'ID', @fg_templates.id
+ -row 'Count', @fg_templates.count
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/dc404992/clients/cimi/views/forwarding_group_templates/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/forwarding_group_templates/show.haml b/clients/cimi/views/forwarding_group_templates/show.haml
new file mode 100644
index 0000000..b5e759b
--- /dev/null
+++ b/clients/cimi/views/forwarding_group_templates/show.haml
@@ -0,0 +1,30 @@
+- @title="#{@fg_template.name}"
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li
+ %a{ :href => "/cimi/forwarding_group_templates"} ForwardingGroupTemplateCollection
+ %span.divider="/"
+ %li.active
+ =@fg_template.name
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@fg_template.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@fg_template.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+ %p
+
+
+-details 'ForwardingGroupTemplate details' do
+ -row 'ID', @fg_template.id
+ -row 'Description', @fg_template.description
+ -row 'Created', @fg_template.created
+
+-details 'ForwardingGroupTemplate networks' do
+ -@fg_template.networks.each do |net|
+ -row 'ID', net.href