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 3B4E9D342 for ; Fri, 18 Jan 2013 09:52:52 +0000 (UTC) Received: (qmail 8890 invoked by uid 500); 18 Jan 2013 09:52:52 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 8870 invoked by uid 500); 18 Jan 2013 09:52:52 -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 8859 invoked by uid 99); 18 Jan 2013 09:52:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 09:52:51 +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 (nike.apache.org: domain of martha.c.chumo@gmail.com designates 74.125.82.54 as permitted sender) Received: from [74.125.82.54] (HELO mail-wg0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 09:52:44 +0000 Received: by mail-wg0-f54.google.com with SMTP id fg15so2065545wgb.33 for ; Fri, 18 Jan 2013 01:52:24 -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=Jkk+JkMIqeyOpU4ArTx/UFjejajkC4cBgsFdTVuOr6M=; b=iQ4GOi7BjDeCFAPnftw/h0S9rUnmEPU7fCK9T2rrJfVrc5jXjrUE2dQ+DvsFUM9ZjF fBYZBElhTdQ8qC69OBEkTod/ZmiDtAr/wJjy1sC4GmiH3SDAGLiM4ygIXGnH47prAMMn B0FXnk2RY2wbqNaRZuqEnUCbIuN0wKlMJ6nW0Kz+zfIfHPWaXbAkcuyuDxw8ZKU0RCmn RxKVOiCmCnftv/Y5yLmy1KaN/MDK2ApIG7KQqZmoc9aljGv+DSDV8SL8Laj9jIo1MnzQ 5FrvUR5UOOMlDX0+qSxnpFJ4cmBmUSvasVeos8XsoOpKeiU/mxO/Ibel/lUDsGweKKAw 0Ssw== X-Received: by 10.180.80.170 with SMTP id s10mr2458731wix.27.1358502744336; Fri, 18 Jan 2013 01:52:24 -0800 (PST) Received: from localhost.localdomain ([212.49.88.101]) by mx.google.com with ESMTPS id dm3sm2659866wib.9.2013.01.18.01.52.21 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jan 2013 01:52:23 -0800 (PST) From: martha.c.chumo@gmail.com To: dev@deltacloud.apache.org Subject: [PATCH 2/4] DTACLOUD-409:added network port templates view files and network_port_template to entities Date: Fri, 18 Jan 2013 12:52:08 +0300 Message-Id: <1358502730-12713-2-git-send-email-martha.c.chumo@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358502730-12713-1-git-send-email-martha.c.chumo@gmail.com> References: <1358502730-12713-1-git-send-email-martha.c.chumo@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org From: NjeriChelimo --- clients/cimi/app.rb | 1 + clients/cimi/lib/entities.rb | 1 + clients/cimi/lib/entities/network_port_template.rb | 30 ++++++++++++++++++++ .../cimi/views/network_port_templates/index.haml | 23 +++++++++++++++ .../cimi/views/network_port_templates/show.haml | 25 ++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 clients/cimi/lib/entities/network_port_template.rb create mode 100644 clients/cimi/views/network_port_templates/index.haml create mode 100644 clients/cimi/views/network_port_templates/show.haml diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb index e29419c..c326b8b 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::NetworkPortConfiguration + use CIMI::Frontend::NetworkPortTemplate use CIMI::Frontend::NetworkTemplate use CIMI::Frontend::NetworkPort use CIMI::Frontend::RoutingGroup diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb index f3a99cd..292f647 100644 --- a/clients/cimi/lib/entities.rb +++ b/clients/cimi/lib/entities.rb @@ -32,6 +32,7 @@ require 'entities/network' require 'entities/network_configuration' require 'entities/network_port' require 'entities/network_port_configuration' +require 'entities/network_port_template' require 'entities/network_template' require 'entities/routing_group' require 'entities/routing_group_template' diff --git a/clients/cimi/lib/entities/network_port_template.rb b/clients/cimi/lib/entities/network_port_template.rb new file mode 100644 index 0000000..bab4acf --- /dev/null +++ b/clients/cimi/lib/entities/network_port_template.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::NetworkPortTemplate < CIMI::Frontend::Entity + + get '/cimi/network_port_templates/:id' do + network_port_template_xml = get_entity('network_port_templates', params[:id], credentials) + @network_port_template = CIMI::Model::NetworkPortTemplate.from_xml(network_port_template_xml) + haml :'network_port_templates/show' + end + + get '/cimi/network_port_templates' do + network_port_templates_xml = get_entity_collection('network_port_templates', credentials) + @network_port_templates = CIMI::Model::NetworkPortTemplateCollection.from_xml(network_port_templates_xml) + haml :'network_port_templates/index' + end + +end diff --git a/clients/cimi/views/network_port_templates/index.haml b/clients/cimi/views/network_port_templates/index.haml new file mode 100644 index 0000000..57216c9 --- /dev/null +++ b/clients/cimi/views/network_port_templates/index.haml @@ -0,0 +1,23 @@ +- @title=collection_name @network_port_templates + +- content_for :breadcrumb do + %ul.breadcrumb + %li + %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint + %span.divider="/" + %li.active + NetworkPortTemplateCollection + +- content_for :actions do + %p + %a{ :href => "#{@network_port_templates.id}?format=xml", :class => 'label warning' } XML + %a{ :href => "#{@network_port_templates.id}?format=json", :class => 'label warning' } JSON + +%ul + - @network_port_templates.network_port_templates.each do |template| + %li + %a{ :href => "/cimi/network_port_templates/#{href_to_id(template.id)}"}=href_to_id(template.id) + +-details do + -row 'ID', @network_port_templates.id + -row 'Count', @network_port_templates.count diff --git a/clients/cimi/views/network_port_templates/show.haml b/clients/cimi/views/network_port_templates/show.haml new file mode 100644 index 0000000..7fda54c --- /dev/null +++ b/clients/cimi/views/network_port_templates/show.haml @@ -0,0 +1,25 @@ +- @title="#{@network_port_template.name}" + +- content_for :breadcrumb do + %ul.breadcrumb + %li + %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint + %span.divider="/" + %li + %a{ :href => "/cimi/network_port_templates"} NetworkPortTemplateCollection + %span.divider="/" + %li.active + = @network_port_template.name + +- content_for :actions do + %p + %a{ :href => "#{@network_port_template.id}?format=xml", :class => 'label warning' } XML + %a{ :href => "#{@network_port_template.id}?format=json", :class => 'label warning' } JSON + +-details do + -row 'ID', @network_port_template.id + -row 'Name',@network_port_template.name + -row 'Description',@network_port_template.description + -row 'Created',@network_port_template.created + -row 'Network', url("/cimi/networks/#{href_to_id @network_port_template.network.href}") + -row 'Network Port Config', url("/cimi/network_port_configurations/#{href_to_id @network_port_template.network_port_config.href}") -- 1.7.9.5