Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAC1195E2 for ; Mon, 19 Mar 2012 16:29:11 +0000 (UTC) Received: (qmail 94820 invoked by uid 500); 19 Mar 2012 16:29:11 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 94792 invoked by uid 500); 19 Mar 2012 16:29:11 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 94767 invoked by uid 99); 19 Mar 2012 16:29:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 16:29:11 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marios@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 16:29:00 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JGSdcE009029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 12:28:39 -0400 Received: from name.redhat.com (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2JGSX8B016500 for ; Mon, 19 Mar 2012 12:28:38 -0400 From: marios@redhat.com To: dev@deltacloud.apache.org Subject: [PATCH 2/4] CIMI: Adds VSP entity and views to CIMI Client Date: Mon, 19 Mar 2012 18:28:27 +0200 Message-Id: <1332174509-28369-3-git-send-email-marios@redhat.com> In-Reply-To: <1332174509-28369-1-git-send-email-marios@redhat.com> References: <1332174509-28369-1-git-send-email-marios@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Virus-Checked: Checked by ClamAV on apache.org From: marios Signed-off-by: marios --- 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(-) create mode 100644 clients/cimi/lib/entities/vsp.rb create mode 100644 clients/cimi/views/vsps/index.haml create mode 100644 clients/cimi/views/vsps/show.haml 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 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' 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 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 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 -- 1.7.6.5