You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2012/03/20 11:16:04 UTC
[3/4] git commit: CIMI: Adds VSP entity and views to CIMI Client
CIMI: Adds VSP 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/b8f6b16d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/b8f6b16d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/b8f6b16d
Branch: refs/heads/master
Commit: b8f6b16da267d975f2d963569356ae7a3ec15a75
Parents: 308f1b5
Author: marios <ma...@redhat.com>
Authored: Mon Mar 19 18:05:16 2012 +0200
Committer: marios <ma...@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.rb | 31 +++++++++++++++++++++++++++++
clients/cimi/views/vsps/index.haml | 30 ++++++++++++++++++++++++++++
clients/cimi/views/vsps/show.haml | 33 +++++++++++++++++++++++++++++++
5 files changed, 96 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b8f6b16d/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 5064712..3d32cc5 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -33,6 +33,7 @@ module CIMI::Frontend
use CIMI::Frontend::NetworkTemplate
use CIMI::Frontend::RoutingGroup
use CIMI::Frontend::RoutingGroupTemplate
+ use CIMI::Frontend::VSP
use Rack::Session::Cookie
helpers CIMI::Frontend::Helper
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b8f6b16d/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 5f9ed53..53ab6bf 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -33,3 +33,4 @@ require 'entities/network_configuration'
require 'entities/network_template'
require 'entities/routing_group'
require 'entities/routing_group_template'
+require 'entities/vsp'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b8f6b16d/clients/cimi/lib/entities/vsp.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/vsp.rb b/clients/cimi/lib/entities/vsp.rb
new file mode 100644
index 0000000..13c90bd
--- /dev/null
+++ b/clients/cimi/lib/entities/vsp.rb
@@ -0,0 +1,31 @@
+
+# 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::VSP < CIMI::Frontend::Entity
+
+ get '/cimi/vsps/:id' do
+ vsp_xml = get_entity('vsps', params[:id], credentials)
+ @vsp = CIMI::Model::VSP.from_xml(vsp_xml)
+ haml :'vsps/show'
+ end
+
+ get '/cimi/vsps' do
+ vsps_xml = get_entity_collection('vsps', credentials)
+ @vsps = CIMI::Model::VSPCollection.from_xml(vsps_xml)
+ haml :'vsps/index'
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b8f6b16d/clients/cimi/views/vsps/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/vsps/index.haml b/clients/cimi/views/vsps/index.haml
new file mode 100644
index 0000000..163f777
--- /dev/null
+++ b/clients/cimi/views/vsps/index.haml
@@ -0,0 +1,30 @@
+- @title=@vsps.description
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li.active
+ VSPCollection
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@vsps.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@vsps.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+ %p
+ A VSP Collection entity represents the collection of VSPs within a Provider.
+ This entity can be used to locate and create VSPs.
+
+%h3 VSPCollection
+%ul
+ - @vsps.vsps.each do |vsp|
+ %li
+ %a{ :href => "/cimi/vsps/#{vsp.href.split('/').last}"}=vsp.href.split('/').last
+
+-details 'VSPCollection details' do
+ -row 'ID', @vsps.id
+ -row 'Description', @vsps.description
+ -row 'Created', @vsps.created
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/b8f6b16d/clients/cimi/views/vsps/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/vsps/show.haml b/clients/cimi/views/vsps/show.haml
new file mode 100644
index 0000000..432b45e
--- /dev/null
+++ b/clients/cimi/views/vsps/show.haml
@@ -0,0 +1,33 @@
+- @title="#{@vsp.name}"
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li
+ %a{ :href => "/cimi/vsps"} VSPCollection
+ %span.divider="/"
+ %li.active
+ = @vsp.name
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@vsp.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@vsp.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+ %p
+ A VSP represents the connection parameters of a network port.
+
+-details 'VSP details' do
+ -row 'ID', @vsp.id
+ -row 'Description', @vsp.description
+ -row 'Created', @vsp.created
+ -row 'State', @vsp.state
+ -row 'Network', @vsp.network.href
+ -row 'Bandwidth Reservation', @vsp.bandwidth_reservation
+ -row 'Traffic Priority', @vsp.traffic_priority
+ -row 'Maximum Traffic Delay', @vsp.max_traffic_delay
+ -row 'Maximum Traffic Loss', @vsp.max_traffic_loss
+ -row 'Maximum Traffic Jitter', @vsp.max_traffic_jitter