deltacloud-commits mailing list archives

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


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

Branch: refs/heads/master
Commit: 8c557c2d2999d5e0e3c1c2b1d454e68724c0ac22
Parents: b8f6b16
Author: marios <marios@redhat.com>
Authored: Mon Mar 19 18:09: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.rb                 |    1 -
 clients/cimi/lib/entities/vsp_configuration.rb   |   30 ++++++++++++++++
 clients/cimi/views/vsp_configurations/index.haml |   31 +++++++++++++++++
 clients/cimi/views/vsp_configurations/show.haml  |   31 +++++++++++++++++
 6 files changed, 94 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8c557c2d/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 53ab6bf..7071bf2 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -34,3 +34,4 @@ require 'entities/network_template'
 require 'entities/routing_group'
 require 'entities/routing_group_template'
 require 'entities/vsp'
+require 'entities/vsp_configuration'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8c557c2d/clients/cimi/lib/entities/vsp.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/vsp.rb b/clients/cimi/lib/entities/vsp.rb
index 13c90bd..ccf02c9 100644
--- a/clients/cimi/lib/entities/vsp.rb
+++ b/clients/cimi/lib/entities/vsp.rb
@@ -1,4 +1,3 @@
-
 # 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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8c557c2d/clients/cimi/lib/entities/vsp_configuration.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/vsp_configuration.rb b/clients/cimi/lib/entities/vsp_configuration.rb
new file mode 100644
index 0000000..9d50090
--- /dev/null
+++ b/clients/cimi/lib/entities/vsp_configuration.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::VSPConfiguration < CIMI::Frontend::Entity
+
+  get '/cimi/vsp_configurations/:id' do
+    vsp_config_xml = get_entity('vsp_configurations', params[:id], credentials)
+    @vsp_config = CIMI::Model::VSPConfiguration.from_xml(vsp_config_xml)
+    haml :'vsp_configurations/show'
+  end
+
+  get '/cimi/vsp_configurations' do
+    vsp_configs_xml = get_entity_collection('vsp_configurations', credentials)
+    @vsp_configs = CIMI::Model::VSPConfigurationCollection.from_xml(vsp_configs_xml)
+    haml :'vsp_configurations/index'
+  end
+
+end

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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8c557c2d/clients/cimi/views/vsp_configurations/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/vsp_configurations/show.haml b/clients/cimi/views/vsp_configurations/show.haml
new file mode 100644
index 0000000..3ab2dfb
--- /dev/null
+++ b/clients/cimi/views/vsp_configurations/show.haml
@@ -0,0 +1,31 @@
+- @title="#{@vsp_config.name}"
+
+- content_for :breadcrumb do
+  %ul.breadcrumb
+    %li
+      %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+      %span.divider="/"
+    %li
+      %a{ :href => "/cimi/vsp_configurations"} VSPConfigurationCollection
+      %span.divider="/"
+    %li.active
+      = @vsp_config.name
+
+- content_for :actions do
+  %p
+    %a{ :href => "#{@vsp_config.id}?format=xml", :class => 'label warning' } XML
+    %a{ :href => "#{@vsp_config.id}?format=json", :class => 'label warning' } JSON
+
+%blockquote
+  %p
+    The set of configuration values representing the information needed to create a VSP with
certain characteristics.
+
+-details 'VSPConfiguration details' do
+  -row 'ID', @vsp_config.id
+  -row 'Description', @vsp_config.description
+  -row 'Created', @vsp_config.created
+  -row 'Bandwidth Reservation', @vsp_config.bandwidth_reservation
+  -row 'Traffic Priority', @vsp_config.traffic_priority
+  -row 'Maximum Traffic Delay', @vsp_config.max_traffic_delay
+  -row 'Maximum Traffic Loss', @vsp_config.max_traffic_loss
+  -row 'Maximum Traffic Jitter', @vsp_config.max_traffic_jitter


Mime
View raw message