Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F9527BA8 for ; Mon, 5 Dec 2011 10:50:02 +0000 (UTC) Received: (qmail 59385 invoked by uid 500); 5 Dec 2011 10:50:01 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 59149 invoked by uid 500); 5 Dec 2011 10:50:01 -0000 Mailing-List: contact commits-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 commits@deltacloud.apache.org Received: (qmail 59107 invoked by uid 99); 5 Dec 2011 10:50:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 10:50:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 10:49:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 67FB423889E0 for ; Mon, 5 Dec 2011 10:49:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1210409 - in /deltacloud/trunk/clients/cimi: app.rb lib/entities.rb lib/entities/machine_template.rb views/machine_templates/ views/machine_templates/index.haml views/machine_templates/show.haml Date: Mon, 05 Dec 2011 10:49:36 -0000 To: commits@deltacloud.apache.org From: mfojtik@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111205104936.67FB423889E0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mfojtik Date: Mon Dec 5 10:49:35 2011 New Revision: 1210409 URL: http://svn.apache.org/viewvc?rev=1210409&view=rev Log: CIMI: Added machine template support for new cimi client Added: deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb - copied, changed from r1210408, deltacloud/trunk/clients/cimi/lib/entities.rb deltacloud/trunk/clients/cimi/views/machine_templates/ deltacloud/trunk/clients/cimi/views/machine_templates/index.haml deltacloud/trunk/clients/cimi/views/machine_templates/show.haml Modified: deltacloud/trunk/clients/cimi/app.rb deltacloud/trunk/clients/cimi/lib/entities.rb Modified: deltacloud/trunk/clients/cimi/app.rb URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/app.rb?rev=1210409&r1=1210408&r2=1210409&view=diff ============================================================================== --- deltacloud/trunk/clients/cimi/app.rb (original) +++ deltacloud/trunk/clients/cimi/app.rb Mon Dec 5 10:49:35 2011 @@ -20,6 +20,7 @@ module CIMI::Frontend use CIMI::Frontend::MachineConfiguration use CIMI::Frontend::MachineImage use CIMI::Frontend::Machine + use CIMI::Frontend::MachineTemplate configure do enable :logging Modified: deltacloud/trunk/clients/cimi/lib/entities.rb URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities.rb?rev=1210409&r1=1210408&r2=1210409&view=diff ============================================================================== --- deltacloud/trunk/clients/cimi/lib/entities.rb (original) +++ deltacloud/trunk/clients/cimi/lib/entities.rb Mon Dec 5 10:49:35 2011 @@ -22,4 +22,5 @@ require 'entities/base_entity' require 'entities/cloud_entry_point' require 'entities/machine_configuration' require 'entities/machine_image' -require 'entities/machine' \ No newline at end of file +require 'entities/machine' +require 'entities/machine_template' \ No newline at end of file Copied: deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb (from r1210408, deltacloud/trunk/clients/cimi/lib/entities.rb) URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb?p2=deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb&p1=deltacloud/trunk/clients/cimi/lib/entities.rb&r1=1210408&r2=1210409&rev=1210409&view=diff ============================================================================== --- deltacloud/trunk/clients/cimi/lib/entities.rb (original) +++ deltacloud/trunk/clients/cimi/lib/entities/machine_template.rb Mon Dec 5 10:49:35 2011 @@ -13,13 +13,18 @@ # License for the specific language governing permissions and limitations # under the License. -module CIMI - module Frontend +class CIMI::Frontend::MachineTemplate < CIMI::Frontend::Entity + + get '/cimi/machine_templates/:id' do + machine_templates_xml = CIMI::Frontend.get_entity('machine_templates', params[:id], credentials) + @machine_template = CIMI::Model::MachineTemplate.from_xml(machine_templates_xml) + haml :'machine_templates/show' + end + + get '/cimi/machine_templates' do + machine_template_xml = CIMI::Frontend.get_entity_collection('machine_templates', credentials) + @machine_templates = CIMI::Model::MachineTemplateCollection.from_xml(machine_template_xml) + haml :'machine_templates/index' end -end -require 'entities/base_entity' -require 'entities/cloud_entry_point' -require 'entities/machine_configuration' -require 'entities/machine_image' -require 'entities/machine' \ No newline at end of file +end \ No newline at end of file Added: deltacloud/trunk/clients/cimi/views/machine_templates/index.haml URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/machine_templates/index.haml?rev=1210409&view=auto ============================================================================== --- deltacloud/trunk/clients/cimi/views/machine_templates/index.haml (added) +++ deltacloud/trunk/clients/cimi/views/machine_templates/index.haml Mon Dec 5 10:49:35 2011 @@ -0,0 +1,21 @@ +- @title=@machine_templates.description + +- content_for :breadcrumb do + %ul.breadcrumb + %li + %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint + %span.divider="/" + %li.active + MachineTemplateCollection + + +%blockquote + %p + A Machine Template Collection entity represents the collection of + Machine Template entities within a Provider. This entity can be used to + locate and create Machine Templates. + +%ul + - @machine_templates.machine_templates.each do |temp| + %li + %a{ :href => "/cimi/machine_templates/#{temp.href.split('/').last}"}=temp.href.split('/').last Added: deltacloud/trunk/clients/cimi/views/machine_templates/show.haml URL: http://svn.apache.org/viewvc/deltacloud/trunk/clients/cimi/views/machine_templates/show.haml?rev=1210409&view=auto ============================================================================== --- deltacloud/trunk/clients/cimi/views/machine_templates/show.haml (added) +++ deltacloud/trunk/clients/cimi/views/machine_templates/show.haml Mon Dec 5 10:49:35 2011 @@ -0,0 +1,28 @@ +- @title="#{@machine_template.name}" + +- content_for :breadcrumb do + %ul.breadcrumb + %li + %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint + %span.divider="/" + %li + %a{ :href => "/cimi/machine_templates"} MachineConfigurationCollection + %span.divider="/" + %li.active + = @machine_template.name + +%blockquote + %p + The Machine Configuration entity represents the set of configuration values + that define the (virtual) hardware resources of a to-be-realized Machine + Instance. Machine Configurations are created by Providers and MAY, at the + Providers discretion, be created by Consumers. + +%dl + %dt URI + %dd + %a{ :href => @machine_template.uri }=@machine_template.uri + %dt Description + %dd=@machine_template.description + %dt Created + %dd #{@machine_template.created}  \ No newline at end of file