deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [2/3] git commit: CIMI client: display ForwardingGroups
Date Wed, 20 Feb 2013 00:29:39 GMT
CIMI client: display ForwardingGroups

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/5ca2f0c3
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/5ca2f0c3
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/5ca2f0c3

Branch: refs/heads/master
Commit: 5ca2f0c384216077b031d61f3068f621092c4a43
Parents: dc40499
Author: NjeriChelimo <martha.c.chumo@gmail.com>
Authored: Tue Jan 22 11:39:22 2013 +0300
Committer: David Lutterkort <lutter@redhat.com>
Committed: Tue Feb 19 16:00:32 2013 -0800

----------------------------------------------------------------------
 clients/cimi/app.rb                             |    1 +
 clients/cimi/lib/entities.rb                    |    1 +
 clients/cimi/lib/entities/forwarding_group.rb   |   30 ++++++++++++++++++
 clients/cimi/views/forwarding_groups/index.haml |   24 ++++++++++++++
 clients/cimi/views/forwarding_groups/show.haml  |   30 ++++++++++++++++++
 5 files changed, 86 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ca2f0c3/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index ef96e12..9f29980 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::ForwardingGroup
     use CIMI::Frontend::ForwardingGroupTemplate
     use Rack::Session::Cookie
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ca2f0c3/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index b6da8e8..49f74f5 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'
 require 'entities/forwarding_group_template'
 require 'entities/machine_configuration'
 require 'entities/machine_admin'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ca2f0c3/clients/cimi/lib/entities/forwarding_group.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/forwarding_group.rb b/clients/cimi/lib/entities/forwarding_group.rb
new file mode 100644
index 0000000..344a162
--- /dev/null
+++ b/clients/cimi/lib/entities/forwarding_group.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::ForwardingGroup < CIMI::Frontend::Entity
+
+  get '/cimi/forwarding_groups/:id' do
+    fg_xml = get_entity('forwarding_groups', params[:id], credentials)
+    @fg = CIMI::Model::ForwardingGroup.from_xml(fg_xml)
+    haml :'forwarding_groups/show'
+  end
+
+  get '/cimi/forwarding_groups' do
+    fgs_xml = get_entity_collection('forwarding_groups', credentials)
+    @fgs = CIMI::Model::ForwardingGroupCollection.from_xml(fgs_xml)
+    haml :'forwarding_groups/index'
+  end
+
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ca2f0c3/clients/cimi/views/forwarding_groups/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/forwarding_groups/index.haml b/clients/cimi/views/forwarding_groups/index.haml
new file mode 100644
index 0000000..e940ff8
--- /dev/null
+++ b/clients/cimi/views/forwarding_groups/index.haml
@@ -0,0 +1,24 @@
+- @title=collection_name @fgs
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li.active
+      ForwardingGroupCollection
+- content_for :actions do
+  %p
+    %a{ :href => "#{@fgs.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@fgs.id}?format=json", :class => 'label warning' } JSON
+
+
+%h3 ForwardingGroupCollection
+%ul
+  - @fgs.forwarding_groups.each do |fg|
+    %li
+      %a{ :href => "/cimi/forwarding_groups/#{href_to_id fg.id}"}=href_to_id(fg.id)
+
+-details 'ForwardingGroupCollection details' do
+  -row 'ID', @fgs.id
+  -row 'Count', @fgs.count

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/5ca2f0c3/clients/cimi/views/forwarding_groups/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/forwarding_groups/show.haml b/clients/cimi/views/forwarding_groups/show.haml
new file mode 100644
index 0000000..bece2f1
--- /dev/null
+++ b/clients/cimi/views/forwarding_groups/show.haml
@@ -0,0 +1,30 @@
+- @title="#{@fg.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/forwarding_groups"} ForwardingGroupCollection
+      %span.divider="/"
+    %li.active
+      =@fg.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@fg.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@fg.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+  %p
+
+
+-details 'ForwardingGroup details' do
+  -row 'ID', @fg.id
+  -row 'Description', @fg.description
+  -row 'Created', @fg.created
+
+-details 'ForwardingGroup networks' do
+  -@fg.networks.each do |net|
+    -row 'ID', net.href


Mime
View raw message