deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: created view files for network ports; added network port in entities
Date Mon, 14 Jan 2013 08:11:22 GMT
Updated Branches:
  refs/heads/master 182cca6eb -> 3ebe770fd


created view files for network ports; added network port in entities


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

Branch: refs/heads/master
Commit: 3ebe770fddebdc54ec4b36bbfa3972dbddec1c83
Parents: 182cca6
Author: NjeriChelimo <martha.c.chumo@gmail.com>
Authored: Fri Jan 11 17:09:43 2013 +0300
Committer: marios <marios@redhat.com>
Committed: Mon Jan 14 10:02:23 2013 +0200

----------------------------------------------------------------------
 clients/cimi/app.rb                         |    1 +
 clients/cimi/lib/entities.rb                |    1 +
 clients/cimi/lib/entities/network_port.rb   |   30 ++++++++++++++++++++++
 clients/cimi/views/network_ports/index.haml |   23 ++++++++++++++++
 clients/cimi/views/network_ports/show.haml  |   26 +++++++++++++++++++
 5 files changed, 81 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3ebe770f/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index e26f2b9..f7b133e 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -31,6 +31,7 @@ module CIMI::Frontend
     use CIMI::Frontend::Network
     use CIMI::Frontend::NetworkConfiguration
     use CIMI::Frontend::NetworkTemplate
+    use CIMI::Frontend::NetworkPort
     use CIMI::Frontend::RoutingGroup
     use CIMI::Frontend::RoutingGroupTemplate
     use CIMI::Frontend::VSP

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3ebe770f/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 3442360..91b95c3 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -30,6 +30,7 @@ require 'entities/volume_image'
 require 'entities/volume'
 require 'entities/network'
 require 'entities/network_configuration'
+require 'entities/network_port'
 require 'entities/network_template'
 require 'entities/routing_group'
 require 'entities/routing_group_template'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3ebe770f/clients/cimi/lib/entities/network_port.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/network_port.rb b/clients/cimi/lib/entities/network_port.rb
new file mode 100644
index 0000000..3e823ad
--- /dev/null
+++ b/clients/cimi/lib/entities/network_port.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::NetworkPort < CIMI::Frontend::Entity
+
+  get '/cimi/network_ports/:id' do
+    network_port_xml = get_entity('network_ports', params[:id], credentials)
+    @network_port = CIMI::Model::NetworkPort.from_xml(network_port_xml)
+    haml :'network_ports/show'
+  end
+
+  get '/cimi/network_ports' do
+    network_ports_xml = get_entity_collection('network_ports', credentials)
+    @network_ports = CIMI::Model::NetworkPortCollection.from_xml(network_ports_xml)
+    haml :'network_ports/index'
+  end
+
+end

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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3ebe770f/clients/cimi/views/network_ports/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/network_ports/show.haml b/clients/cimi/views/network_ports/show.haml
new file mode 100644
index 0000000..8682c43
--- /dev/null
+++ b/clients/cimi/views/network_ports/show.haml
@@ -0,0 +1,26 @@
+- @title="#{@network_port.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/network_ports"} NetworkPortCollection
+      %span.divider="/"
+    %li.active
+      = @network_port.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@network_port.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@network_port.id}?format=json", :class => 'label warning' } JSON
+
+-details do
+  -row 'ID', @network_port.id
+  -row 'Name',@network_port.name
+  -row 'Description',@network_port.description
+  -row 'Created',@network_port.created
+  -row 'State',@network_port.state
+  -row 'Port Type',@network_port.port_type
+  -row 'State',@network_port.state


Mime
View raw message