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 90CA5E2F2 for ; Thu, 10 Jan 2013 09:29:48 +0000 (UTC) Received: (qmail 18172 invoked by uid 500); 10 Jan 2013 09:29:47 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 17785 invoked by uid 500); 10 Jan 2013 09:29:46 -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 17404 invoked by uid 99); 10 Jan 2013 09:29:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2013 09:29:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of martha.c.chumo@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2013 09:29:39 +0000 Received: by mail-we0-f169.google.com with SMTP id t49so145428wey.0 for ; Thu, 10 Jan 2013 01:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=f/YKdd6HTlHF/I6ZHQZ4Nr2Zkuqu8pAk+aNl6+PlLEI=; b=Lv3JlA4Narr122QREGCa45J+PCpqn6WkEwgxy2O01wSEu+eLVcgV3Y2yERAvOnW62n mg3kbpw97eAcyc7U22NaBzErDnrZjdR0cu7LBNzxd+mWfPG7nAGH+NU0KO0zxNN5eFTL bLSEmEFq+2tyFFgWSxNWweOuYOUDvYUJa8dt9oB8pRpKxqhovXO0a16HdBEozG94yKpz eymatFXt8h55Ggm0AwA3HrTjNDb1FCZfTFQzCJfCH7XVpIngcX4x4o18f9YDqvHZl1lU 9O9LBA+yypGbx6AR1mBzyvPPzk2aR1QIqLWHJq27Oz5Dxuzocd/3zRIUaMmKpSABqCNC doVQ== X-Received: by 10.180.88.138 with SMTP id bg10mr7850953wib.13.1357810158529; Thu, 10 Jan 2013 01:29:18 -0800 (PST) Received: from localhost.localdomain ([212.49.88.100]) by mx.google.com with ESMTPS id s10sm1415732wiw.4.2013.01.10.01.29.16 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jan 2013 01:29:18 -0800 (PST) From: martha.c.chumo@gmail.com To: dev@deltacloud.apache.org Subject: [PATCH 2/2] Added network port routes and index.haml file Date: Thu, 10 Jan 2013 12:29:04 +0300 Message-Id: <1357810145-11115-2-git-send-email-martha.c.chumo@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357810145-11115-1-git-send-email-martha.c.chumo@gmail.com> References: <1357810145-11115-1-git-send-email-martha.c.chumo@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org From: NjeriChelimo NOTE: When I do a curl, it works fine, but returns a 404 in the browser. --- clients/cimi/Gemfile.lock | 12 ------------ clients/cimi/app.rb | 1 + clients/cimi/lib/entities.rb | 1 + clients/cimi/lib/entities/network_port.rb | 4 ++-- clients/cimi/views/network_ports/index.haml | 23 +++++++++++++++++++++++ 5 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 clients/cimi/views/network_ports/index.haml diff --git a/clients/cimi/Gemfile.lock b/clients/cimi/Gemfile.lock index 5ce2c94..93cb338 100644 --- a/clients/cimi/Gemfile.lock +++ b/clients/cimi/Gemfile.lock @@ -1,8 +1,6 @@ GEM remote: http://rubygems.org/ specs: - backports (2.6.4) - eventmachine (1.0.0) haml (3.1.7) json (1.7.5) mime-types (1.19) @@ -12,21 +10,12 @@ GEM rack (>= 0.4) rack-protection (1.2.0) rack - rack-test (0.6.1) - rack (>= 1.0) rest-client (1.6.7) mime-types (>= 1.16) sinatra (1.3.3) rack (~> 1.3, >= 1.3.6) rack-protection (~> 1.2) tilt (~> 1.3, >= 1.3.3) - sinatra-contrib (1.3.1) - backports (>= 2.0) - eventmachine - rack-protection - rack-test - sinatra (~> 1.3.0) - tilt (~> 1.3) tilt (1.3.3) PLATFORMS @@ -39,4 +28,3 @@ DEPENDENCIES rack-accept rest-client sinatra - sinatra-contrib diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb index e26f2b9..d6702d7 100644 --- a/clients/cimi/app.rb +++ b/clients/cimi/app.rb @@ -25,6 +25,7 @@ module CIMI::Frontend use CIMI::Frontend::Machine use CIMI::Frontend::MachineAdmin use CIMI::Frontend::MachineTemplate + use CIMI::Frontend::NetworkPort use CIMI::Frontend::VolumeConfiguration use CIMI::Frontend::VolumeImage use CIMI::Frontend::Volume diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb index 3442360..75bd6bd 100644 --- a/clients/cimi/lib/entities.rb +++ b/clients/cimi/lib/entities.rb @@ -31,6 +31,7 @@ require 'entities/volume' require 'entities/network' require 'entities/network_configuration' require 'entities/network_template' +require 'entities/network_port' require 'entities/routing_group' require 'entities/routing_group_template' require 'entities/vsp' diff --git a/clients/cimi/lib/entities/network_port.rb b/clients/cimi/lib/entities/network_port.rb index 16923ee..3f3da2c 100644 --- a/clients/cimi/lib/entities/network_port.rb +++ b/clients/cimi/lib/entities/network_port.rb @@ -21,10 +21,10 @@ class CIMI::Frontend::NetworkPort < CIMI::Frontend::Entity haml :'network_ports/show' end - get '/cimi/network_templates' do + get '/cimi/network_ports' do network_port_xml = get_entity_collection('network_ports', credentials) @network_ports = CIMI::Model::NetworkPortCollection.from_xml(network_port_xml) haml :'network_ports/index' end - end +end diff --git a/clients/cimi/views/network_ports/index.haml b/clients/cimi/views/network_ports/index.haml new file mode 100644 index 0000000..bfa34d4 --- /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 + -- 1.7.9.5