You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by dk...@apache.org on 2013/07/09 08:25:07 UTC
[1/9] git commit: CIMI: changed CEP key names and order to match spec
Updated Branches:
refs/heads/master a2436c7ef -> 9e36a2296
CIMI: changed CEP key names and order to match spec
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7a22299f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7a22299f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7a22299f
Branch: refs/heads/master
Commit: 7a22299fe2ffbdeed931d0bfe5de3f888d18b22e
Parents: a2436c7
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Mon Jul 1 14:13:23 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:45:35 2013 +1000
----------------------------------------------------------------------
server/lib/cimi/models/cloud_entry_point_collections.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7a22299f/server/lib/cimi/models/cloud_entry_point_collections.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/cloud_entry_point_collections.rb b/server/lib/cimi/models/cloud_entry_point_collections.rb
index 6cf4866..e383037 100644
--- a/server/lib/cimi/models/cloud_entry_point_collections.rb
+++ b/server/lib/cimi/models/cloud_entry_point_collections.rb
@@ -24,23 +24,23 @@ class CIMI::Model::CloudEntryPoint < CIMI::Model::Base
"systemTemplates" => CIMI::Model::SystemTemplate,
"machines" => CIMI::Model::Machine,
"machineTemplates" => CIMI::Model::MachineTemplate,
+ "machineConfigs" => CIMI::Model::MachineConfiguration,
"machineImages" => CIMI::Model::MachineImage,
"credentials" => CIMI::Model::Credential,
"volumes" => CIMI::Model::Volume,
"volumeTemplates" => CIMI::Model::VolumeTemplate,
+ "volumeConfigs" => CIMI::Model::VolumeConfiguration,
"volumeImages" => CIMI::Model::VolumeImage,
"networks" => CIMI::Model::Network,
"networkTemplates" => CIMI::Model::NetworkTemplate,
+ "networkConfigs" => CIMI::Model::NetworkConfiguration,
"networkPorts" => CIMI::Model::NetworkPort,
"networkPortTemplates" => CIMI::Model::NetworkPortTemplate,
+ "networkPortConfigs" => CIMI::Model::NetworkPortConfiguration,
"addresses" => CIMI::Model::Address,
"addressTemplates" => CIMI::Model::AddressTemplate,
"forwardingGroups" => CIMI::Model::ForwardingGroup,
"forwardingGroupTemplates" => CIMI::Model::ForwardingGroupTemplate,
- "volumeConfigurations" => CIMI::Model::VolumeConfiguration,
- "machineConfigurations" => CIMI::Model::MachineConfiguration,
- "networkConfigurations" => CIMI::Model::NetworkConfiguration,
- "networkPortConfigurations" => CIMI::Model::NetworkPortConfiguration,
"jobs" => nil,
"meters" => nil,
"meterTemplates" => nil,
[2/9] git commit: CIMI: added block to ensure config collection urls
in CEP spell out configuration. Fix for query on DTACLOUD-577
Posted by dk...@apache.org.
CIMI: added block to ensure config collection urls in CEP
spell out configuration. Fix for query on DTACLOUD-577
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8249f4b1
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8249f4b1
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8249f4b1
Branch: refs/heads/master
Commit: 8249f4b1b43fc14aaa755718d72974dc0bee73d8
Parents: 7a22299
Author: marios <ma...@redhat.com>
Authored: Wed Jul 3 10:54:20 2013 +0300
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:12 2013 +1000
----------------------------------------------------------------------
server/lib/cimi/models/resource.rb | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8249f4b1/server/lib/cimi/models/resource.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/resource.rb b/server/lib/cimi/models/resource.rb
index 89021cb..ff08eb9 100644
--- a/server/lib/cimi/models/resource.rb
+++ b/server/lib/cimi/models/resource.rb
@@ -172,9 +172,14 @@ module CIMI
next if self[n].nil?
next if self[n].kind_of? Array
if @select_attrs.empty? or @select_attrs.include?(n)
- self[n].href = "#{self.base_id}/#{n}" if !self[n].href
- self[n].id = "#{self.base_id}/#{n}" if !self[n].entries.empty?
-
+ if n.to_s =~ /config/
+ fixed_name = (n.to_s.singularize + "uration").pluralize
+ self[n].href = "#{self.base_id}/#{fixed_name}" if !self[n].href
+ self[n].id = "#{self.base_id}/#{fixed_name}" if !self[n].entries.empty?
+ else
+ self[n].href = "#{self.base_id}/#{n}" if !self[n].href
+ self[n].id = "#{self.base_id}/#{n}" if !self[n].entries.empty?
+ end
self[n].href["cloudEntryPoint/"] = "" \
if self[n].href and self[n].href.include? "cloudEntryPoint/"
self[n].id["cloudEntryPoint/"] = "" \
[4/9] git commit: CIMI: removed redundant password and key
declarations
Posted by dk...@apache.org.
CIMI: removed redundant password and key declarations
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/e3ce3604
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/e3ce3604
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/e3ce3604
Branch: refs/heads/master
Commit: e3ce36046c428af93bfdc9b4a2b0cf969048e6e3
Parents: 2e6c993
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Wed Jul 3 20:57:56 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:21 2013 +1000
----------------------------------------------------------------------
server/lib/cimi/models/credential.rb | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/e3ce3604/server/lib/cimi/models/credential.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/credential.rb b/server/lib/cimi/models/credential.rb
index a9869ba..6fc0a20 100644
--- a/server/lib/cimi/models/credential.rb
+++ b/server/lib/cimi/models/credential.rb
@@ -16,8 +16,6 @@
class CIMI::Model::Credential < CIMI::Model::Base
text :username, :password, :key
- text :password
- text :key
array :operations do
scalar :rel, :href
[6/9] git commit: CIMI: replaced machine admin with credential and
made its views consistent with others
Posted by dk...@apache.org.
CIMI: replaced machine admin with credential
and made its views consistent with others
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/cacd6552
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/cacd6552
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/cacd6552
Branch: refs/heads/master
Commit: cacd655270337a4d02bb0a944a87d857b2faa7ca
Parents: e3ce360
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Wed Jul 3 23:40:29 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:22 2013 +1000
----------------------------------------------------------------------
clients/cimi/app.rb | 2 +-
clients/cimi/lib/entities.rb | 2 +-
clients/cimi/lib/entities/credential.rb | 66 +++++++++++++++++++++++
clients/cimi/lib/entities/machine.rb | 10 ++--
clients/cimi/lib/entities/machine_admin.rb | 66 -----------------------
clients/cimi/views/credentials/index.haml | 53 ++++++++++++++++++
clients/cimi/views/credentials/show.haml | 35 ++++++++++++
clients/cimi/views/machine_admins/index.haml | 54 -------------------
clients/cimi/views/machine_admins/show.haml | 35 ------------
clients/cimi/views/machines/index.haml | 12 ++---
10 files changed, 167 insertions(+), 168 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index 67c3f8f..ea6a3c7 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -22,12 +22,12 @@ module CIMI::Frontend
use CIMI::Frontend::Address
use CIMI::Frontend::AddressTemplate
use CIMI::Frontend::CloudEntryPoint
+ use CIMI::Frontend::Credential
use CIMI::Frontend::ForwardingGroup
use CIMI::Frontend::ForwardingGroupTemplate
use CIMI::Frontend::MachineConfiguration
use CIMI::Frontend::MachineImage
use CIMI::Frontend::Machine
- use CIMI::Frontend::MachineAdmin
use CIMI::Frontend::MachineTemplate
use CIMI::Frontend::VolumeConfiguration
use CIMI::Frontend::VolumeImage
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 522c10e..6099802 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -22,10 +22,10 @@ require 'entities/base_entity'
require 'entities/cloud_entry_point'
require 'entities/address'
require 'entities/address_template'
+require 'entities/credential'
require 'entities/forwarding_group'
require 'entities/forwarding_group_template'
require 'entities/machine_configuration'
-require 'entities/machine_admin'
require 'entities/machine_image'
require 'entities/machine'
require 'entities/machine_template'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/lib/entities/credential.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/credential.rb b/clients/cimi/lib/entities/credential.rb
new file mode 100644
index 0000000..3916704
--- /dev/null
+++ b/clients/cimi/lib/entities/credential.rb
@@ -0,0 +1,66 @@
+# 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::Credential < CIMI::Frontend::Entity
+
+ get '/cimi/credentials/new' do
+ haml :'credentials/new'
+ end
+
+ get '/cimi/credentials/:id' do
+ credentials_xml = get_entity('credentials', params[:id], credentials)
+ @cred = CIMI::Model::Credential.from_xml(credentials_xml)
+ haml :'credentials/show'
+ end
+
+ delete '/cimi/credentials/:id/delete' do
+ result = destroy_entity('credentials', params[:id], credentials)
+ if result.code == 200
+ flash[:success] = "Credential '#{params[:id]}' was successfully destroyed."
+ redirect '/cimi/credentials'
+ else
+ flash[:error] = "Unable to destroy Credential #{params[:id]}"
+ end
+ end
+
+ get '/cimi/credentials' do
+ credential_xml = get_entity_collection('credentials', credentials)
+ @creds = collection_class_for(:credential).from_xml(credential_xml)
+ haml :'credentials/index'
+ end
+
+ post '/cimi/credential' do
+ credential_xml = Nokogiri::XML::Builder.new do |xml|
+ xml.Credential(:xmlns => CIMI::Frontend::CMWG_NAMESPACE) {
+ xml.name params[:credential][:name]
+ xml.description params[:credential][:description]
+ xml.username params[:credential][:username]
+ xml.password params[:credential][:password]
+ xml.key params[:credential][:key]
+ }
+ end.to_xml
+ begin
+ result = create_entity('credentials', credential_xml, credentials)
+ cred = collection_class_for(:credential).from_xml(result)
+ flash[:success] = "Credential was successfully created."
+ redirect "/cimi/credentials/#{cred.name}", 302
+ rescue => e
+ flash[:error] = "Credential could not be created: #{e.message}"
+ redirect(back)
+ end
+ end
+
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/lib/entities/machine.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/machine.rb b/clients/cimi/lib/entities/machine.rb
index 72286d0..05f1e14 100644
--- a/clients/cimi/lib/entities/machine.rb
+++ b/clients/cimi/lib/entities/machine.rb
@@ -42,11 +42,11 @@ class CIMI::Frontend::Machine < CIMI::Frontend::Entity
machine_conf_xml = get_entity_collection('machine_configurations', credentials)
@machine_configurations = collection_class_for(:machine_configuration).from_xml(machine_conf_xml)
begin
- machine_admins_xml = get_entity_collection('machine_admins', credentials)
- @machine_admins = collection_class_for(:machine_admin).from_xml(machine_admins_xml)
- # In case backend does not support MachineAdmin collection
+ credentials_xml = get_entity_collection('credentials', credentials)
+ @creds = collection_class_for(:credential).from_xml(credentials_xml)
+ # In case backend does not support Credential collection
rescue RestClient::ResourceNotFound
- @machine_admins = []
+ @creds = []
end
machine_xml = get_entity_collection('machines', credentials)
@machines = collection_class_for(:machine).from_xml(machine_xml)
@@ -104,7 +104,7 @@ class CIMI::Frontend::Machine < CIMI::Frontend::Entity
xml.machineTemplate {
xml.machineConfig( :href => params[:machine][:machine_configuration] )
xml.machineImage( :href => params[:machine][:machine_image] )
- xml.machineAdmin( :href => params[:machine][:machine_admin] ) unless params[:machine][:machine_admin].nil?
+ xml.credential( :href => params[:machine][:credential] ) unless params[:machine][:credential].nil?
}
}
end.to_xml
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/lib/entities/machine_admin.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/machine_admin.rb b/clients/cimi/lib/entities/machine_admin.rb
deleted file mode 100644
index c7077cc..0000000
--- a/clients/cimi/lib/entities/machine_admin.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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::MachineAdmin < CIMI::Frontend::Entity
-
- get '/cimi/machine_admins/new' do
- haml :'machine_admins/new'
- end
-
- get '/cimi/machine_admins/:id' do
- machine_admins_xml = get_entity('machine_admins', params[:id], credentials)
- @machine_admin = CIMI::Model::MachineAdmin.from_xml(machine_admins_xml)
- haml :'machine_admins/show'
- end
-
- delete '/cimi/machine_admins/:id/delete' do
- result = destroy_entity('machine_admins', params[:id], credentials)
- if result.code == 200
- flash[:success] = "MachineAdmin '#{params[:id]}' was successfully destroyed."
- redirect '/cimi/machine_admins'
- else
- flash[:error] = "Unable to destroy Machine Admin #{params[:id]}"
- end
- end
-
- get '/cimi/machine_admins' do
- machine_admin_xml = get_entity_collection('machine_admins', credentials)
- @machine_admins = collection_class_for(:machine_admin).from_xml(machine_admin_xml)
- haml :'machine_admins/index'
- end
-
- post '/cimi/machine_admin' do
- machine_admin_xml = Nokogiri::XML::Builder.new do |xml|
- xml.MachineAdmin(:xmlns => CIMI::Frontend::CMWG_NAMESPACE) {
- xml.name params[:machine_admin][:name]
- xml.description params[:machine_admin][:description]
- xml.username params[:machine_admin][:username]
- xml.password params[:machine_admin][:password]
- xml.key params[:machine_admin][:key]
- }
- end.to_xml
- begin
- result = create_entity('machine_admins', machine_admin_xml, credentials)
- machine_admin = collection_class_for(:machine_admin).from_xml(result)
- flash[:success] = "MachineAdmin was successfully created."
- redirect "/cimi/machine_admins/#{machine_admin.name}", 302
- rescue => e
- flash[:error] = "Machine Admin could not be created: #{e.message}"
- redirect(back)
- end
- end
-
-
-end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/views/credentials/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/credentials/index.haml b/clients/cimi/views/credentials/index.haml
new file mode 100644
index 0000000..e737447
--- /dev/null
+++ b/clients/cimi/views/credentials/index.haml
@@ -0,0 +1,53 @@
+- @title=collection_name @creds
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li.active
+ CredentialCollection
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@creds.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@creds.id}?format=json", :class => 'label warning' } JSON
+ %p
+ %a{ :href => '#credModal', :class => 'btn btn-primary', :'data-toggle' => :modal } New Credential
+
+ %div{ :id => :credModal, :class => 'modal hide fade' }
+ .modal-header
+ %h3 Create mew Credential entity
+ .modal-body
+ %form{ :action => "/cimi/credential", :method => :post }
+ %fieldset
+ .control-group
+ %label.control-label{ :for => 'credential[name]' } Key Name
+ .controls
+ %input{ :type => :text, :name => 'credential[name]' }
+ %label.control-label{ :for => 'credential[description]' } Key Description
+ .controls
+ %input{ :type => :text, :name => 'credential[description]' }
+ %label.control-label{ :for => 'credential[key]' } PEM data
+ .controls
+ %textarea{:name => 'credential[key]', :class => 'input-xlarge', :rows => 3}
+ .modal-footer
+ %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Credential...', :onclick => "postModalForm(this, 'credModal')"} Continue
+ %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
+
+%blockquote
+ %p
+ A Credential Collection entity represents the collection of Credential
+ entities within a Provider. This entity can be used to locate and create
+ Credentials.
+
+%h3 CredentialCollection
+
+%ul
+ - @creds.credentials.each do |conf|
+ %li
+ %a{ :href => "/cimi/credentials/#{conf.id.split('/').last}"}=conf.id.split('/').last
+
+- details 'Collection details' do
+ - row 'ID', @creds.id
+ - row 'Count', @creds.count
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/views/credentials/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/credentials/show.haml b/clients/cimi/views/credentials/show.haml
new file mode 100644
index 0000000..6a9ac76
--- /dev/null
+++ b/clients/cimi/views/credentials/show.haml
@@ -0,0 +1,35 @@
+- @title="#{@cred.name}"
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li
+ %a{ :href => "/cimi/credentials"} CredentialCollection
+ %span.divider="/"
+ %li.active
+ = @cred.name
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@cred.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@cred.id}?format=json", :class => 'label warning' } JSON
+ %p
+ %form{ :action => "/cimi/credentials/#{@cred.name}/delete", :method => :post, :style => 'display:inline'}
+ %input{ :type => :hidden, :name => '_method', :value => 'delete'}
+ %button{ :class => 'btn btn-danger'} Destroy
+
+%blockquote
+ %p
+ A Credential entity contains the information required to create the
+ initial administrative super-user of a newly created Machine
+
+- details 'Credential Details' do
+ - row 'ID', @cred.id
+ - row 'Description', @cred.description
+ - row 'Created', @cred.created
+ - row 'Username', boolean_span_for(@cred.username)
+ - row 'Password', boolean_span_for(@cred.password)
+ - row 'Key', '<pre>'+boolean_span_for(@cred.key)+'</pre>'
+
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/views/machine_admins/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machine_admins/index.haml b/clients/cimi/views/machine_admins/index.haml
deleted file mode 100644
index 3b0e1ae..0000000
--- a/clients/cimi/views/machine_admins/index.haml
+++ /dev/null
@@ -1,54 +0,0 @@
-- @title=@machine_admins.name
-
-- content_for :breadcrumb do
- %ul.breadcrumb
- %li
- %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
- %span.divider="/"
- %li.active
- MachineAdminCollection
-
-- content_for :actions do
- %p
- %a{ :href => "#{@machine_admins.id}?format=xml", :class => 'label warning' } XML
- %a{ :href => "#{@machine_admins.id}?format=json", :class => 'label warning' } JSON
- %p
- %a{ :href => '#adminModal', :class => 'btn btn-primary', :'data-toggle' => :modal } New Machine Admin
-
- %div{ :id => :adminModal, :class => 'modal hide fade' }
- .modal-header
- %h3 Create mew MachineAdmin entity
- .modal-body
- %form{ :action => "/cimi/machine_admin", :method => :post }
- %fieldset
- .control-group
- %label.control-label{ :for => 'machine_admin[name]' } Key Name
- .controls
- %input{ :type => :text, :name => 'machine_admin[name]' }
- %label.control-label{ :for => 'machine_admin[description]' } Key Description
- .controls
- %input{ :type => :text, :name => 'machine_admin[description]' }
- %label.control-label{ :for => 'machine_admin[key]' } PEM data
- .controls
- %textarea{:name => 'machine_admin[key]', :class => 'input-xlarge', :rows => 3}
- .modal-footer
- %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating MachineAdmin...', :onclick => "postModalForm(this, 'adminModal')"} Continue
- %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
-
-%blockquote
- %p
- A Machine Admin Collection entity represents the collection of Machine Admin
- entities within a Provider. This entity can be used to locate and create
- MachineAdmins.
-
-%h3 MachineAdminCollection
-
-%ul
- - @machine_admins.machine_admins.each do |conf|
- %li
- %a{ :href => "/cimi/machine_admins/#{conf.href.split('/').last}"}=conf.href.split('/').last
-
-- details 'Collection details' do
- - row 'ID', @machine_admins.id
- - row 'Description', @machine_admins.description
- - row 'Created', @machine_admins.created
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/views/machine_admins/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machine_admins/show.haml b/clients/cimi/views/machine_admins/show.haml
deleted file mode 100644
index 2e95ea7..0000000
--- a/clients/cimi/views/machine_admins/show.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-- @title="#{@machine_admin.name}"
-
-- content_for :breadcrumb do
- %ul.breadcrumb
- %li
- %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
- %span.divider="/"
- %li
- %a{ :href => "/cimi/machine_admins"} MachineAdminCollection
- %span.divider="/"
- %li.active
- = @machine_admin.name
-
-- content_for :actions do
- %p
- %a{ :href => "#{@machine_admin.id}?format=xml", :class => 'label warning' } XML
- %a{ :href => "#{@machine_admin.id}?format=json", :class => 'label warning' } JSON
- %p
- %form{ :action => "/cimi/machine_admins/#{@machine_admin.name}/delete", :method => :post, :style => 'display:inline'}
- %input{ :type => :hidden, :name => '_method', :value => 'delete'}
- %button{ :class => 'btn btn-danger'} Destroy
-
-%blockquote
- %p
- A Machine Admin entity contains the information required to create the
- initial administrative super- user of a newly created Machine
-
-- details 'MachineAdmin Details' do
- - row 'ID', @machine_admin.id
- - row 'Description', @machine_admin.description
- - row 'Created', @machine_admin.created
- - row 'Username', boolean_span_for(@machine_admin.username)
- - row 'Password', boolean_span_for(@machine_admin.password)
- - row 'Key', '<pre>'+boolean_span_for(@machine_admin.key)+'</pre>'
-
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/cacd6552/clients/cimi/views/machines/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/machines/index.haml b/clients/cimi/views/machines/index.haml
index 85aaaf6..aa195ab 100644
--- a/clients/cimi/views/machines/index.haml
+++ b/clients/cimi/views/machines/index.haml
@@ -33,14 +33,14 @@
%select{ :name => 'machine[machine_configuration]' }
- @machine_configurations.machine_configurations.each do |configuration|
%option{ :value => configuration.id }=href_to_id(configuration.id)
- - unless @machine_admins.kind_of?(Array)
- %label.control-label{ :for => 'machine[machine_admin]' } Machine Admin
+ - unless @creds.kind_of?(Array)
+ %label.control-label{ :for => 'machine[credential]' } Credential
.controls
- %select{ :name => 'machine[machine_admin]' }
- - @machine_admins.machine_admins.each do |admin|
- %option{ :value => admin.id }=href_to_id(admin.id)
+ %select{ :name => 'machine[credential]' }
+ - @creds.credentials.each do |cred|
+ %option{ :value => cred.id }=href_to_id(cred.id)
.modal-footer
- %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating MachineAdmin...', :onclick => "postModalForm(this, 'machineModal')"} Continue
+ %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Credential...', :onclick => "postModalForm(this, 'machineModal')"} Continue
%a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
%p{:style => 'text-align:right;'}
%a{ :href => "#{@machines.id}?format=xml", :class => 'label warning' } XML
[8/9] git commit: CIMI: changed CEP hrefs to use client's paths
Posted by dk...@apache.org.
CIMI: changed CEP hrefs to use client's paths
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/3306c61b
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/3306c61b
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/3306c61b
Branch: refs/heads/master
Commit: 3306c61be723d58a0df0584f89d36c5cca06cd96
Parents: 58d1f36
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Fri Jul 5 21:40:24 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Fri Jul 5 21:42:43 2013 +1000
----------------------------------------------------------------------
clients/cimi/lib/cimi_frontend_helper.rb | 5 +++++
clients/cimi/views/cloud_entry_point/index.haml | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3306c61b/clients/cimi/lib/cimi_frontend_helper.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/cimi_frontend_helper.rb b/clients/cimi/lib/cimi_frontend_helper.rb
index 314ec91..14c9ea3 100644
--- a/clients/cimi/lib/cimi_frontend_helper.rb
+++ b/clients/cimi/lib/cimi_frontend_helper.rb
@@ -35,6 +35,11 @@ module CIMI
href.split('/').last.strip
end
+ def id_to_href(id)
+ return '' unless id
+ id.gsub(/([A-Z])/, '_\1').sub('Configs', 'Configurations').downcase
+ end
+
def collection_name(obj)
obj.class.name.split('::').last
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3306c61b/clients/cimi/views/cloud_entry_point/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/cloud_entry_point/index.haml b/clients/cimi/views/cloud_entry_point/index.haml
index 866adb7..0779687 100644
--- a/clients/cimi/views/cloud_entry_point/index.haml
+++ b/clients/cimi/views/cloud_entry_point/index.haml
@@ -13,4 +13,4 @@
%ul
- entry_point.select { |k, v| !v.kind_of?(String) and v.first['href'] }.each do |k, v|
%li
- %a{ :href => '/cimi/'+href_to_id(v.first['href']) }=k
+ %a{ :href => '/cimi/'+id_to_href(k) }=k
[5/9] git commit: CIMI: don't render Create views in client UI if no
Add operation returned in networks or addresses collection
Posted by dk...@apache.org.
CIMI: don't render Create views in client UI if no Add operation
returned in networks or addresses collection
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/2e6c993d
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/2e6c993d
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/2e6c993d
Branch: refs/heads/master
Commit: 2e6c993d453ee571777380e2db96518c1950c429
Parents: df198d0
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Mon Jul 1 15:25:16 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:21 2013 +1000
----------------------------------------------------------------------
clients/cimi/lib/entities/address.rb | 6 ++-
clients/cimi/lib/entities/network.rb | 18 +++++++--
clients/cimi/views/addresses/index.haml | 43 +++++++++++-----------
clients/cimi/views/networks/index.haml | 55 +++++++++++++++-------------
4 files changed, 69 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2e6c993d/clients/cimi/lib/entities/address.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/address.rb b/clients/cimi/lib/entities/address.rb
index 7973dbf..95c76d8 100644
--- a/clients/cimi/lib/entities/address.rb
+++ b/clients/cimi/lib/entities/address.rb
@@ -22,10 +22,12 @@ class CIMI::Frontend::Address < CIMI::Frontend::Entity
end
get '/cimi/addresses' do
- address_template_xml = get_entity_collection('address_templates', credentials)
- @address_templates = collection_class_for(:address_template).from_xml(address_template_xml)
addresses_xml = get_entity_collection('addresses', credentials)
@addresses = collection_class_for(:address).from_xml(addresses_xml)
+ if @addresses.operations.find {|o| o.rel == 'add'}
+ address_template_xml = get_entity_collection('address_templates', credentials)
+ @address_templates = collection_class_for(:address_template).from_xml(address_template_xml)
+ end
haml :'addresses/index'
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2e6c993d/clients/cimi/lib/entities/network.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/network.rb b/clients/cimi/lib/entities/network.rb
index af81726..361d4d9 100644
--- a/clients/cimi/lib/entities/network.rb
+++ b/clients/cimi/lib/entities/network.rb
@@ -22,12 +22,22 @@ class CIMI::Frontend::Network < CIMI::Frontend::Entity
end
get '/cimi/networks' do
- forwarding_groups_xml = get_entity_collection('forwarding_groups', credentials)
- @forwarding_groups = collection_class_for(:forwarding_group).from_xml(forwarding_groups_xml)
- network_config_xml = get_entity_collection('network_configurations', credentials)
- @network_configurations = collection_class_for(:network_configuration).from_xml(network_config_xml)
networks_xml = get_entity_collection('networks', credentials)
@networks = collection_class_for(:network).from_xml(networks_xml)
+ if @networks.operations.find {|o| o.rel == 'add'}
+ # note that even if 'add' is supported, both forwarding group and
+ # network config are optional in network template
+ begin
+ forwarding_groups_xml = get_entity_collection('forwarding_groups', credentials)
+ @forwarding_groups = collection_class_for(:forwarding_group).from_xml(forwarding_groups_xml)
+ rescue RestClient::ResourceNotFound
+ end
+ begin
+ network_config_xml = get_entity_collection('network_configurations', credentials)
+ @network_configurations = collection_class_for(:network_configuration).from_xml(network_config_xml)
+ rescue RestClient::ResourceNotFound
+ end
+ end
haml :'networks/index'
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2e6c993d/clients/cimi/views/addresses/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/addresses/index.haml b/clients/cimi/views/addresses/index.haml
index 6224291..34994b1 100644
--- a/clients/cimi/views/addresses/index.haml
+++ b/clients/cimi/views/addresses/index.haml
@@ -8,28 +8,29 @@
%li.active
AddressCollection
-- content_for :actions do
- %p
- %a{ :href => '#addressModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Address
+- if @addresses.operations.find {|o| o.rel == 'add'}
+ - content_for :actions do
+ %p
+ %a{ :href => '#addressModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Address
- %div{ :id => :addressModal, :class => 'modal hide fade' }
- .modal-header
- %h3 Create new Address entity
- .modal-body
- %form{ :action => "/cimi/addresses", :method => :post }
- %fieldset
- .control-group
- %label.control-label{ :for => 'address[name]' } Address Name
- .controls
- %input{ :type => :text, :name => 'address[name]' }
- %label.control-label{ :for => 'address[address_template]' } Address Image
- .controls
- %select{ :name => 'address[address_template]' }
- - @address_templates.address_templates.each do |template|
- %option{ :value => template.id }=href_to_id(template.id)
- .modal-footer
- %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Address...', :onclick => "postModalForm(this, 'addressModal')"} Continue
- %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
+ %div{ :id => :addressModal, :class => 'modal hide fade' }
+ .modal-header
+ %h3 Create new Address entity
+ .modal-body
+ %form{ :action => "/cimi/addresses", :method => :post }
+ %fieldset
+ .control-group
+ %label.control-label{ :for => 'address[name]' } Address Name
+ .controls
+ %input{ :type => :text, :name => 'address[name]' }
+ %label.control-label{ :for => 'address[address_template]' } Address Image
+ .controls
+ %select{ :name => 'address[address_template]' }
+ - @address_templates.address_templates.each do |template|
+ %option{ :value => template.id }=href_to_id(template.id)
+ .modal-footer
+ %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Address...', :onclick => "postModalForm(this, 'addressModal')"} Continue
+ %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
%p
%a{ :href => "#{@addresses.id}?format=xml", :class => 'label warning' } XML
%a{ :href => "#{@addresses.id}?format=json", :class => 'label warning' } JSON
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/2e6c993d/clients/cimi/views/networks/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/networks/index.haml b/clients/cimi/views/networks/index.haml
index 405cd11..7a2720c 100644
--- a/clients/cimi/views/networks/index.haml
+++ b/clients/cimi/views/networks/index.haml
@@ -9,34 +9,37 @@
NetworkCollection
-- content_for :actions do
+- if @networks.operations.find {|o| o.rel == 'add'}
+ - content_for :actions do
- %p
- %a{ :href => '#networkModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Network
+ %p
+ %a{ :href => '#networkModal', :class => 'btn btn-primary', :'data-toggle' => :modal} New Network
- %div{ :id => :networkModal, :class => 'modal hide fade' }
- .modal-header
- %h3 Create new Network entity
- .modal-body
- %form{ :action => "/cimi/networks", :method => :post }
- %fieldset
- .control-group
- %label.control-label{ :for => 'network[name]' } Network Name
- .controls
- %input{ :type => :text, :name => 'network[name]' }
- %label.control-label{ :for => 'network[forwarding_group]' } Forwarding Group
- .controls
- %select{ :name => 'network[forwarding_group]' }
- - @forwarding_groups.forwarding_groups.each do |group|
- %option{ :value => group.id }=href_to_id(group.id)
- %label.control-label{ :for => 'network[network_configuration]' } Network Configuration
- .controls
- %select{ :name => 'network[network_configuration]' }
- - @network_configurations.network_configurations.each do |configuration|
- %option{ :value => configuration.id }=href_to_id(configuration.id)
- .modal-footer
- %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Network...', :onclick => "postModalForm(this, 'networkModal')"} Continue
- %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
+ %div{ :id => :networkModal, :class => 'modal hide fade' }
+ .modal-header
+ %h3 Create new Network entity
+ .modal-body
+ %form{ :action => "/cimi/networks", :method => :post }
+ %fieldset
+ .control-group
+ %label.control-label{ :for => 'network[name]' } Network Name
+ .controls
+ %input{ :type => :text, :name => 'network[name]' }
+ - if @forwarding_groups
+ %label.control-label{ :for => 'network[forwarding_group]' } Forwarding Group
+ .controls
+ %select{ :name => 'network[forwarding_group]' }
+ - @forwarding_groups.forwarding_groups.each do |group|
+ %option{ :value => group.id }=href_to_id(group.id)
+ - if @network_configurations
+ %label.control-label{ :for => 'network[network_configuration]' } Network Configuration
+ .controls
+ %select{ :name => 'network[network_configuration]' }
+ - @network_configurations.network_configurations.each do |configuration|
+ %option{ :value => configuration.id }=href_to_id(configuration.id)
+ .modal-footer
+ %a{ :href => '#', :class => 'btn btn-primary', :'data-loading-text' => 'Creating Network...', :onclick => "postModalForm(this, 'networkModal')"} Continue
+ %a{ :href => '#', :class => 'btn', :'data-dismiss' => 'modal'} Cancel
%p
%a{ :href => "#{@networks.id}?format=xml", :class => 'label warning' } XML
%a{ :href => "#{@networks.id}?format=json", :class => 'label warning' } JSON
[3/9] git commit: CIMI: take entity collection url from CEP
Posted by dk...@apache.org.
CIMI: take entity collection url from CEP
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/df198d01
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/df198d01
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/df198d01
Branch: refs/heads/master
Commit: df198d01b476602d647c49cbfba8e274054cd7da
Parents: 8249f4b
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Sun Jun 30 14:32:24 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Wed Jul 3 23:51:20 2013 +1000
----------------------------------------------------------------------
clients/cimi/lib/client.rb | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/df198d01/clients/cimi/lib/client.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/client.rb b/clients/cimi/lib/client.rb
index 7e56255..0418682 100644
--- a/clients/cimi/lib/client.rb
+++ b/clients/cimi/lib/client.rb
@@ -27,7 +27,20 @@ module CIMI
end
def get_entity_collection(entity_type, credentials)
- client[entity_type].get(auth_header(credentials))
+ return client[entity_type].get(auth_header(credentials)) if entity_type == 'cloudEntryPoint'
+ entity_href = get_entity_collection_href(entity_type, credentials)
+ raise RestClient::ResourceNotFound if not entity_href
+ RestClient::Resource.new(entity_href).get(auth_header(credentials))
+ end
+
+ # look up entity collection url from cloud entry point
+ # returns nil if entity not in cloud entry point (i.e. not supported)
+ def get_entity_collection_href(entity_type, credentials)
+ entity_type.sub!('configurations', 'configs')
+ entity_type = entity_type.camelize.uncapitalize
+ entry_point_xml = client['cloudEntryPoint'].get(auth_header(credentials))
+ entity_el = XmlSimple.xml_in(entry_point_xml)[entity_type]
+ entity_href = entity_el ? entity_el[0]['href'] : nil
end
def create_entity(entity_type, body, credentials)
[7/9] git commit: CIMI: added test to ensure spec order of CEP
elements
Posted by dk...@apache.org.
CIMI: added test to ensure spec order of CEP elements
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/58d1f364
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/58d1f364
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/58d1f364
Branch: refs/heads/master
Commit: 58d1f3640e3069cf13328f554869da3fcaf08076
Parents: cacd655
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Thu Jul 4 22:13:25 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Thu Jul 4 22:13:25 2013 +1000
----------------------------------------------------------------------
server/tests/cimi/collections/cloud_entry_point_test.rb | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/58d1f364/server/tests/cimi/collections/cloud_entry_point_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/cimi/collections/cloud_entry_point_test.rb b/server/tests/cimi/collections/cloud_entry_point_test.rb
index e132c4b..d8e812d 100644
--- a/server/tests/cimi/collections/cloud_entry_point_test.rb
+++ b/server/tests/cimi/collections/cloud_entry_point_test.rb
@@ -29,6 +29,15 @@ describe CIMI::Collections::CloudEntryPoint do
json['id'].wont_be_empty
end
+ it 'advertises CIMI collections in spec order' do
+ get root_url + '/cloudEntryPoint?format=json'
+ json.wont_be_empty
+
+ resources_with_href = ['resourceMetadata', 'systems', 'systemTemplates', 'machines', 'machineTemplates', 'machineConfigs', 'machineImages', 'credentials', 'credentialTemplates', 'volumes', 'volumeTemplates', 'volumeConfigs', 'volumeImages', 'networks', 'networkTemplates', 'networkConfigs', 'networkPorts', 'networkPortTemplates', 'networkPortConfigs', 'addresses', 'addressTemplates', 'forwardingGroups', 'forwardingGroupTemplates']
+
+ (resources_with_href & json.keys).must_equal(json.keys & resources_with_href)
+ end
+
it 'allow to force authentication using force_auth parameter in URI' do
get root_url + '/cloudEntryPoint?force_auth=1'
status.must_equal 401
[9/9] git commit: CIMI: added resource metadata to client UI
Posted by dk...@apache.org.
CIMI: added resource metadata to client UI
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/9e36a229
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/9e36a229
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/9e36a229
Branch: refs/heads/master
Commit: 9e36a22966c96c80f8e24763b325103e3e3bea11
Parents: 3306c61
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Sat Jun 22 21:49:45 2013 +1000
Committer: Dies Koper <di...@fast.au.fujitsu.com>
Committed: Mon Jul 8 22:27:16 2013 +1000
----------------------------------------------------------------------
clients/cimi/app.rb | 1 +
clients/cimi/lib/entities.rb | 1 +
clients/cimi/lib/entities/resource_metadata.rb | 30 ++++++++
clients/cimi/views/resource_metadata/index.haml | 24 +++++++
clients/cimi/views/resource_metadata/show.haml | 76 ++++++++++++++++++++
5 files changed, 132 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e36a229/clients/cimi/app.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
index ea6a3c7..104afde 100644
--- a/clients/cimi/app.rb
+++ b/clients/cimi/app.rb
@@ -38,6 +38,7 @@ module CIMI::Frontend
use CIMI::Frontend::NetworkPortTemplate
use CIMI::Frontend::NetworkTemplate
use CIMI::Frontend::NetworkPort
+ use CIMI::Frontend::ResourceMetadata
use Rack::Session::Cookie
helpers CIMI::Frontend::Helper
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e36a229/clients/cimi/lib/entities.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
index 6099802..680d52d 100644
--- a/clients/cimi/lib/entities.rb
+++ b/clients/cimi/lib/entities.rb
@@ -38,3 +38,4 @@ require 'entities/network_port'
require 'entities/network_port_configuration'
require 'entities/network_port_template'
require 'entities/network_template'
+require 'entities/resource_metadata'
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e36a229/clients/cimi/lib/entities/resource_metadata.rb
----------------------------------------------------------------------
diff --git a/clients/cimi/lib/entities/resource_metadata.rb b/clients/cimi/lib/entities/resource_metadata.rb
new file mode 100644
index 0000000..92d6677
--- /dev/null
+++ b/clients/cimi/lib/entities/resource_metadata.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::ResourceMetadata < CIMI::Frontend::Entity
+
+ get '/cimi/resource_metadata/:id' do
+ resource_metadata_xml = get_entity('resource_metadata', params[:id], credentials)
+ @resource_metadata = CIMI::Model::ResourceMetadata.from_xml(resource_metadata_xml)
+ haml :'resource_metadata/show'
+ end
+
+ get '/cimi/resource_metadata' do
+ resource_metadata_xml = get_entity_collection('resource_metadata', credentials)
+ @resource_metadata = collection_class_for(:resource_metadata).from_xml(resource_metadata_xml)
+ haml :'resource_metadata/index'
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e36a229/clients/cimi/views/resource_metadata/index.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/resource_metadata/index.haml b/clients/cimi/views/resource_metadata/index.haml
new file mode 100644
index 0000000..55b3e34
--- /dev/null
+++ b/clients/cimi/views/resource_metadata/index.haml
@@ -0,0 +1,24 @@
+- @title=collection_name @resource_metadata
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li.active
+ ResourceMetadataCollection
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@resource_metadata.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@resource_metadata.id}?format=json", :class => 'label warning' } JSON
+
+%h3 ResourceMetadataCollection
+%ul
+ - @resource_metadata.resource_metadata.each do |meta|
+ %li
+ %a{ :href => "/cimi/resource_metadata/#{href_to_id(meta.id)}"}=href_to_id(meta.id)
+
+- details do
+ - row 'ID', @resource_metadata.id
+ - row 'Count', @resource_metadata.count
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9e36a229/clients/cimi/views/resource_metadata/show.haml
----------------------------------------------------------------------
diff --git a/clients/cimi/views/resource_metadata/show.haml b/clients/cimi/views/resource_metadata/show.haml
new file mode 100644
index 0000000..c96d1fa
--- /dev/null
+++ b/clients/cimi/views/resource_metadata/show.haml
@@ -0,0 +1,76 @@
+- @title="#{@resource_metadata.name}"
+
+- content_for :breadcrumb do
+ %ul.breadcrumb
+ %li
+ %a{ :href => "/cimi/cloudEntryPoint"} CloudEntryPoint
+ %span.divider="/"
+ %li
+ %a{ :href => "/cimi/resource_metadata"} ResourceMetadataCollection
+ %span.divider="/"
+ %li.active
+ = @resource_metadata.name
+
+- content_for :actions do
+ %p
+ %a{ :href => "#{@resource_metadata.id}?format=xml", :class => 'label warning' } XML
+ %a{ :href => "#{@resource_metadata.id}?format=json", :class => 'label warning' } JSON
+
+- details do
+ - row 'ID', @resource_metadata.id
+ - row 'Name', @resource_metadata.name
+ - row 'TypeURI', @resource_metadata.type_uri
+
+%h5 Attributes
+%table{ :class => 'table table-bordered table-striped' }
+ %thead
+ %tr
+ %th Name
+ %th Namespace
+ %th Type
+ %th Required
+ %th Constraints
+ %tbody
+ - @resource_metadata.attributes.each do |attribute|
+ %tr
+ %td=attribute.name
+ %td=attribute.namespace||'N/A'
+ %td=attribute.type||'N/A'
+ %td=attribute.required||'false'
+ %td=attribute.constraints.collect {|c| c.value}.join ', '
+
+%h5 Capabilities
+%table{ :class => 'table table-bordered table-striped' }
+ %thead
+ %tr
+ %th Name
+ %th URI
+ %th Description
+ %th Value
+ %tbody
+ - @resource_metadata.capabilities.each do |capability|
+ %tr
+ %td=capability.name
+ %td=capability.uri
+ %td=capability.description
+ %td=capability.value||'true'
+
+%h5 Actions
+%table{ :class => 'table table-bordered table-striped' }
+ %thead
+ %tr
+ %th Name
+ %th URI
+ %th Description
+ %th Method
+ %th InputMessage
+ %th OutputMessage
+ %tbody
+ - @resource_metadata.actions.each do |action|
+ %tr
+ %td=action.name
+ %td=action.uri
+ %td=action.description
+ %td=action.method
+ %td=action.inputMessage
+ %td=action.outputMessage