deltacloud-core 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/LICENSE +23 -0
  2. data/NOTICE +3 -0
  3. data/Rakefile +32 -20
  4. data/bin/deltacloudd +1 -1
  5. data/config.ru +25 -32
  6. data/deltacloud-core.gemspec +1 -1
  7. data/lib/cimi/collections.rb +4 -1
  8. data/lib/cimi/collections/address_templates.rb +2 -2
  9. data/lib/cimi/collections/addresses.rb +1 -1
  10. data/lib/cimi/collections/base.rb +64 -0
  11. data/lib/cimi/collections/{machine_admins.rb → credentials.rb} +12 -12
  12. data/lib/cimi/collections/{vsp_templates.rb → forwarding_group_templates.rb} +12 -16
  13. data/lib/cimi/collections/{vsp_configurations.rb → forwarding_groups.rb} +12 -13
  14. data/lib/cimi/collections/machine_configurations.rb +2 -2
  15. data/lib/cimi/collections/machine_images.rb +1 -1
  16. data/lib/cimi/collections/machines.rb +8 -2
  17. data/lib/cimi/collections/network_configurations.rb +2 -2
  18. data/lib/cimi/collections/{routing_groups.rb → network_port_configurations.rb} +12 -12
  19. data/lib/cimi/collections/{routing_group_templates.rb → network_port_templates.rb} +15 -12
  20. data/lib/cimi/collections/{vsps.rb → network_ports.rb} +33 -32
  21. data/lib/cimi/collections/network_templates.rb +2 -2
  22. data/lib/cimi/collections/networks.rb +17 -2
  23. data/lib/cimi/collections/{entity_metadata.rb → resource_metadata.rb} +10 -10
  24. data/lib/cimi/collections/volume_configurations.rb +1 -1
  25. data/lib/cimi/collections/volume_images.rb +1 -1
  26. data/lib/cimi/collections/volumes.rb +1 -2
  27. data/lib/cimi/dependencies.rb +1 -1
  28. data/lib/cimi/helpers.rb +3 -84
  29. data/lib/cimi/helpers/cimi_helper.rb +15 -14
  30. data/lib/cimi/models.rb +20 -36
  31. data/lib/cimi/models/address.rb +32 -4
  32. data/lib/cimi/models/address_template.rb +2 -2
  33. data/lib/cimi/models/base.rb +24 -5
  34. data/lib/cimi/models/cloud_entry_point.rb +4 -9
  35. data/lib/cimi/models/collection.rb +101 -0
  36. data/lib/cimi/models/{machine_admin.rb → credential.rb} +6 -4
  37. data/lib/cimi/models/disk_collection.rb +1 -2
  38. data/lib/cimi/models/{routing_group_template.rb → forwarding_group.rb} +5 -3
  39. data/lib/cimi/models/{routing_group.rb → forwarding_group_template.rb} +5 -3
  40. data/lib/cimi/models/machine.rb +9 -7
  41. data/lib/cimi/models/machine_configuration.rb +2 -0
  42. data/lib/cimi/models/machine_image.rb +2 -0
  43. data/lib/cimi/models/machine_template.rb +3 -1
  44. data/lib/cimi/models/machine_volume_collection.rb +1 -1
  45. data/lib/cimi/models/network.rb +2 -0
  46. data/lib/cimi/models/network_configuration.rb +4 -8
  47. data/lib/cimi/models/{vsp.rb → network_port.rb} +7 -11
  48. data/lib/cimi/models/{network_configuration_collection.rb → network_port_collection.rb} +25 -8
  49. data/lib/cimi/models/{vsp_configuration.rb → network_port_configuration.rb} +6 -10
  50. data/lib/cimi/models/{network_collection.rb → network_port_configuration_collection.rb} +9 -9
  51. data/lib/cimi/models/{vsp_template.rb → network_port_template.rb} +6 -4
  52. data/lib/cimi/models/{network_template_collection.rb → network_port_template_collection.rb} +10 -8
  53. data/lib/cimi/models/network_template.rb +3 -1
  54. data/lib/cimi/models/{entity_metadata.rb → resource_metadata.rb} +16 -15
  55. data/lib/cimi/models/schema.rb +23 -12
  56. data/lib/cimi/models/volume.rb +2 -0
  57. data/lib/cimi/models/volume_configuration.rb +2 -0
  58. data/lib/cimi/models/volume_image.rb +2 -0
  59. data/lib/cimi/models/volume_template.rb +2 -0
  60. data/lib/cimi/server.rb +10 -6
  61. data/lib/deltacloud/collections.rb +7 -2
  62. data/lib/deltacloud/collections/addresses.rb +3 -1
  63. data/lib/deltacloud/collections/base.rb +64 -0
  64. data/lib/deltacloud/collections/buckets.rb +14 -4
  65. data/lib/deltacloud/collections/drivers.rb +1 -1
  66. data/lib/deltacloud/collections/firewalls.rb +1 -1
  67. data/lib/deltacloud/collections/instances.rb +5 -1
  68. data/lib/deltacloud/collections/keys.rb +1 -1
  69. data/lib/deltacloud/collections/load_balancers.rb +2 -0
  70. data/lib/deltacloud/collections/storage_volumes.rb +3 -5
  71. data/lib/deltacloud/core_ext.rb +1 -0
  72. data/lib/deltacloud/core_ext/hash.rb +8 -0
  73. data/lib/deltacloud/core_ext/ordered_hash.rb +222 -0
  74. data/lib/deltacloud/core_ext/string.rb +9 -0
  75. data/lib/deltacloud/drivers/aruba/aruba_driver.rb +0 -9
  76. data/lib/deltacloud/drivers/base_driver.rb +22 -4
  77. data/lib/deltacloud/drivers/ec2/ec2_driver.rb +0 -4
  78. data/lib/deltacloud/drivers/exceptions.rb +30 -13
  79. data/lib/deltacloud/drivers/features.rb +7 -0
  80. data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +1 -9
  81. data/lib/deltacloud/drivers/google/google_driver.rb +13 -0
  82. data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.1.yml +3 -0
  83. data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.2.yml +3 -0
  84. data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.3.yml +3 -0
  85. data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.4.yml +3 -0
  86. data/lib/deltacloud/drivers/mock/mock_driver.rb +65 -1
  87. data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +55 -32
  88. data/lib/deltacloud/drivers/openstack/openstack_driver.rb +18 -6
  89. data/lib/deltacloud/helpers.rb +0 -75
  90. data/lib/deltacloud/helpers/deltacloud_helper.rb +66 -28
  91. data/lib/deltacloud/helpers/driver_helper.rb +7 -0
  92. data/lib/deltacloud/helpers/rabbit_helper.rb +51 -0
  93. data/lib/deltacloud/server.rb +12 -14
  94. data/lib/deltacloud/version.rb +1 -1
  95. data/lib/deltacloud_rack.rb +26 -2
  96. data/lib/ec2/query_parser.rb +18 -3
  97. data/lib/sinatra/rack_accept.rb +7 -2
  98. data/lib/sinatra/rack_matrix_params.rb +14 -14
  99. data/public/javascripts/cmwgapp.js +2 -2
  100. data/tests/cimi/collections/cloud_entry_point_test.rb +3 -3
  101. data/tests/cimi/collections/machine_images_test.rb +2 -2
  102. data/tests/cimi/collections/machines_test.rb +1 -1
  103. data/tests/cimi/collections/url_helper_test.rb +31 -0
  104. data/tests/cimi/spec/cimi/model/{machine_admin_spec.rb → credential_spec.rb} +4 -4
  105. data/tests/deltacloud/base_collection_test.rb +0 -5
  106. data/tests/deltacloud/collections/buckets_collection_test.rb +1 -1
  107. data/tests/deltacloud/collections/drivers_collection_test.rb +1 -1
  108. data/tests/deltacloud/collections/hardware_profiles_collection_test.rb +1 -1
  109. data/tests/deltacloud/collections/images_collection_test.rb +1 -1
  110. data/tests/deltacloud/collections/instance_states_collection_test.rb +1 -1
  111. data/tests/deltacloud/collections/instances_collection_test.rb +1 -1
  112. data/tests/deltacloud/collections/keys_collection_test.rb +1 -4
  113. data/tests/deltacloud/deltacloud_helper_test.rb +0 -9
  114. data/tests/deltacloud/server_test.rb +1 -1
  115. data/tests/drivers/base/base_driver_test.rb +30 -0
  116. data/tests/drivers/base/common.rb +14 -0
  117. data/tests/drivers/base/exceptions_test.rb +64 -0
  118. data/tests/drivers/ec2/buckets_test.rb +45 -0
  119. data/tests/drivers/ec2/keys_test.rb +1 -1
  120. data/tests/drivers/google/buckets_test.rb +2 -2
  121. data/tests/drivers/google/common.rb +3 -3
  122. data/tests/test_helper.rb +28 -0
  123. data/views/api/show.html.haml +2 -2
  124. data/views/api/show.xml.haml +1 -1
  125. data/views/buckets/index.html.haml +1 -1
  126. data/views/cimi/cloudEntryPoint/index.xml.haml +1 -1
  127. data/views/cimi/collection/index.html.haml +3 -3
  128. data/views/cimi/collection/response.xml.haml +1 -1
  129. data/views/cimi/error.html.haml +1 -1
  130. data/views/cimi/errors/500.xml.haml +1 -1
  131. data/views/cimi/layout.html.haml +1 -1
  132. data/views/cimi/machine_configurations/show.html.haml +2 -2
  133. data/views/cimi/machine_configurations/show.xml.haml +1 -1
  134. data/views/cimi/machine_images/show.html.haml +2 -2
  135. data/views/cimi/machine_images/show.xml.haml +1 -1
  136. data/views/cimi/machines/show.html.haml +2 -2
  137. data/views/cimi/machines/show.xml.haml +1 -1
  138. data/views/cimi/volumes/show.html.haml +2 -2
  139. data/views/cimi/volumes/show.xml.haml +1 -1
  140. data/views/docs/collection.html.haml +1 -1
  141. data/views/docs/collection.xml.haml +2 -2
  142. data/views/docs/index.html.haml +1 -1
  143. data/views/docs/index.xml.haml +1 -1
  144. data/views/docs/operation.xml.haml +1 -1
  145. data/views/error.html.haml +1 -1
  146. data/views/errors/500.html.haml +7 -4
  147. data/views/firewalls/index.html.haml +1 -1
  148. data/views/firewalls/show.html.haml +1 -1
  149. data/views/images/show.html.haml +2 -2
  150. data/views/index.html.haml +9 -0
  151. data/views/instance_states/show.html.haml +1 -1
  152. data/views/instances/run_command.html.haml +1 -1
  153. data/views/instances/show.html.haml +2 -2
  154. data/views/keys/index.html.haml +1 -1
  155. data/views/layout.html.haml +1 -1
  156. data/views/load_balancers/index.html.haml +1 -1
  157. data/views/load_balancers/show.html.haml +3 -3
  158. data/views/storage_snapshots/show.html.haml +1 -1
  159. data/views/storage_volumes/attach.html.haml +1 -1
  160. data/views/storage_volumes/index.html.haml +1 -1
  161. data/views/storage_volumes/show.html.haml +4 -4
  162. metadata +40 -43
  163. data/lib/cimi/models/address_collection.rb +0 -34
  164. data/lib/cimi/models/address_template_collection.rb +0 -34
  165. data/lib/cimi/models/entity_metadata_collection.rb +0 -31
  166. data/lib/cimi/models/machine_admin_collection.rb +0 -34
  167. data/lib/cimi/models/machine_collection.rb +0 -37
  168. data/lib/cimi/models/machine_configuration_collection.rb +0 -36
  169. data/lib/cimi/models/machine_image_collection.rb +0 -36
  170. data/lib/cimi/models/machine_template_collection.rb +0 -36
  171. data/lib/cimi/models/routing_group_collection.rb +0 -34
  172. data/lib/cimi/models/routing_group_template_collection.rb +0 -35
  173. data/lib/cimi/models/volume_collection.rb +0 -36
  174. data/lib/cimi/models/volume_configuration_collection.rb +0 -36
  175. data/lib/cimi/models/volume_image_collection.rb +0 -36
  176. data/lib/cimi/models/volume_template_collection.rb +0 -36
  177. data/lib/cimi/models/vsp_collection.rb +0 -34
  178. data/lib/cimi/models/vsp_configuration_collection.rb +0 -34
  179. data/lib/cimi/models/vsp_template_collection.rb +0 -34
  180. data/lib/deltacloud/helpers/url_helper.rb +0 -115
@@ -3,7 +3,7 @@ require 'require_relative' if RUBY_VERSION < '1.9'
3
3
 
4
4
  require_relative 'common.rb'
5
5
 
6
- describe 'Ec2Driver Instances' do
6
+ describe 'Ec2Driver Keys' do
7
7
 
8
8
  before do
9
9
  @driver = Deltacloud::new(:ec2, credentials)
@@ -74,13 +74,13 @@ describe 'Deltacloud API' do
74
74
  blob.id.must_equal blob_name_google
75
75
  blob.content_length.to_i.must_be :'>',0
76
76
  blob.last_modified.wont_be_empty
77
- blob.content_type.must_equal 'text/html'
77
+ blob.content_type.must_equal 'image/png'
78
78
  blob.user_metadata.keys.wont_be_empty
79
79
  end
80
80
 
81
81
  it 'can retrieve named blob metadata' do
82
82
  blob_metadata = @driver.blob_metadata({:id => blob_name_google, 'bucket' => bucket_name_google})
83
- {"author"=>"deltacloud", "foo"=>"bar"}.must_equal blob_metadata
83
+ {"name1"=>"Author", "value1"=>"deltacloud", "name2"=>"foo", "value2"=>"bar"}.must_equal blob_metadata
84
84
  end
85
85
 
86
86
  it 'can update blob metadata' do
@@ -4,8 +4,8 @@ require_relative '../../test_helper'
4
4
 
5
5
  def credentials
6
6
  {
7
- :user => 'GOOGXKQLYTEOZTILUBZ5',
8
- :password => 'M3pvZUy2ivT78ipQ+u1xv6TkY83q9DUnGXkov3tA'
7
+ :user => 'GOOG4PBMMHEB2BTY6Q7U',
8
+ :password => '7NxqwXy85xmaWB6o1RZ66IxqP+Rmbu8UFiFdpcSw'
9
9
  }
10
10
  end
11
11
 
@@ -16,5 +16,5 @@ end
16
16
  VCR.configure do |c|
17
17
  c.cassette_library_dir = "#{File.dirname(__FILE__)}/fixtures/"
18
18
  c.hook_into :excon
19
- c.default_cassette_options = { :record => :none }
19
+ c.default_cassette_options = { :record => :new_episodes }
20
20
  end
@@ -20,6 +20,24 @@ if ENV['COVERAGE']
20
20
  end
21
21
  end
22
22
 
23
+ # Make the test output more nice and readable
24
+ #
25
+ begin
26
+ require 'turn'
27
+ Turn.config do |c|
28
+ c.format = :pretty
29
+ c.trace = true
30
+ c.natural = true
31
+ end
32
+ rescue LoadError
33
+ end
34
+
35
+ begin
36
+ require "minitest/reporters"
37
+ MiniTest::Reporters.use!(MiniTest::Reporters::JUnitReporter.new) if !ENV['BUILD_NUMBER'].nil?
38
+ rescue LoadError
39
+ end
40
+
23
41
  def record_retries(name='', opts = {})
24
42
  opts[:before] = Proc.new { |r, &block|
25
43
  VCR.use_cassette("#{__name__}-#{name.empty? ? '' : "#{name}-"}#{r}", &block)
@@ -32,6 +50,16 @@ end
32
50
 
33
51
  include Rack::Test::Methods
34
52
 
53
+ def run_frontend(frontend=:deltacloud)
54
+ Rack::Builder.new {
55
+ use Rack::MatrixParams
56
+ map Deltacloud[frontend].root_url do
57
+ use Rack::MatrixParams
58
+ run Deltacloud[frontend].klass
59
+ end
60
+ }.to_app
61
+ end
62
+
35
63
  def status; last_response.status; end
36
64
  def headers; last_response.headers; end
37
65
  def response_body; last_response.body; end
@@ -3,9 +3,9 @@
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview, :'data-inset' => 'true'}
6
- - supported_collections do |c|
6
+ - @collections.each do |c|
7
7
  %li
8
- %a{ :href => api_url_for(c.collection_name), :'data-icon' => "arrow-r"}=c.collection_name.to_s.gsub('_', ' ').titlecase
8
+ %a{ :href => url_for(c.collection_name), :'data-icon' => "arrow-r"}=c.collection_name.to_s.gsub('_', ' ').titlecase
9
9
 
10
10
 
11
11
  - unless Deltacloud::Drivers.driver_config.nil?
@@ -1,5 +1,5 @@
1
1
  %api{ :version => settings.version, :driver => driver_symbol, :provider => Thread.current[:provider] || ENV['API_PROVIDER'] }
2
- - supported_collections do |c|
2
+ - @collections.each do |c|
3
3
  %link{ :rel => c.collection_name, :href => self.send(:"#{c.collection_name}_url")}
4
4
  - c.features.select { |f| driver.class.has_feature?(c.collection_name, f.name) }.each do |f|
5
5
  %feature{ :name => f.name }
@@ -1,5 +1,5 @@
1
1
  =header "Buckets" do
2
- %a{ :href => api_url_for('buckets/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new bucket
2
+ %a{ :href => url_for('buckets/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new bucket
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
@@ -1,6 +1,6 @@
1
1
  !!!XML
2
2
  %CloudEntryPoint{ :xmlns => CMWG_NAMESPACE }
3
- %uri= api_url_for("/cloudEntryPoint")
3
+ %uri= url_for("/cloudEntryPoint")
4
4
  %name cloud entry point
5
5
  %description cloud entry point
6
6
  %created= Time.new.getutc.to_s
@@ -2,7 +2,7 @@
2
2
  - new_name = new_name.gsub(/[A-Z]/, ' \0')
3
3
  %h1 #{new_name.capitalize}
4
4
 
5
- %form{ :action => api_url_for("/collection/" + @dmtfitem["uri"]) }
5
+ %form{ :action => url_for("/collection/" + @dmtfitem["uri"]) }
6
6
  %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
7
7
  %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
8
8
  %p
@@ -28,7 +28,7 @@
28
28
  - iter += 1
29
29
  %br
30
30
  %label
31
- = operation["rel"].capitalize + ":&nbsp;" + api_url_for(operation["href"])
31
+ = operation["rel"].capitalize + ":&nbsp;" + url_for(operation["href"])
32
32
  %input{ :name => "operation_"+iter.to_s, :oper_type => operation["rel"], :type => :hidden, :value => operation["href"] }
33
33
  %br
34
34
  %p
@@ -42,4 +42,4 @@
42
42
  - @dmtf_col_items.map do |template|
43
43
  %tr
44
44
  %td
45
- %a{ :href => template["href"] }= template["name"]
45
+ %a{ :href => template["href"] }= template["name"]
@@ -1,3 +1,3 @@
1
1
  !!!XML
2
2
  %ReturnCode{ :xmlns => CMWG_NAMESPACE }
3
- %Status= "Success"
3
+ %Status= "Success"
@@ -28,4 +28,4 @@
28
28
  #copyright
29
29
  Copyright 2009-2011
30
30
  %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
31
- and individual contributors.
31
+ and individual contributors.
@@ -3,4 +3,4 @@
3
3
  %message< #{cdata @error.message}
4
4
  %backend{ :driver => driver_symbol }
5
5
  %code=response.status
6
- %backtrace< #{cdata @error.backtrace.join("\n")}
6
+ %backtrace< #{h bt(@error.backtrace)}
@@ -29,4 +29,4 @@
29
29
  #copyright
30
30
  Copyright 2009-2011
31
31
  %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
32
- and individual contributors.
32
+ and individual contributors.
@@ -95,7 +95,7 @@
95
95
  :javascript
96
96
  function fixupXml(theNode) {
97
97
  var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
98
- xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
98
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
99
99
  xmlData += getStandardData(theNode);
100
100
  xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
101
101
  xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
@@ -156,4 +156,4 @@
156
156
  })
157
157
 
158
158
  cellRightBut.appendChild(er);
159
- }
159
+ }
@@ -24,4 +24,4 @@
24
24
  %capacity{ :quantity => disk["capacity"]["quantity"], :units => disk["capacity"]["units"] }
25
25
  %guestInterface= disk["guestInterface"]
26
26
  %operation{ :rel => "edit", :href => machine_configurations_url + "/" + @dmtfitem["uri"] }
27
- %operation{ :rel => "delete", :href => machine_configurations_url + "/" + @dmtfitem["uri"] }
27
+ %operation{ :rel => "delete", :href => machine_configurations_url + "/" + @dmtfitem["uri"] }
@@ -63,7 +63,7 @@
63
63
  :javascript
64
64
  function fixupXml(theNode) {
65
65
  var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
66
- xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
66
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
67
67
  xmlData += getStandardData(theNode);
68
68
  xmlData += "<imageLocation href='" + $(theNode.form).attr("imageLocation").value + "' />";
69
69
  xmlData += "<imageData>" + $(theNode.form).attr("imageData").value + "</imageData>";
@@ -76,4 +76,4 @@
76
76
  xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
77
77
 
78
78
  return xmlData;
79
- }
79
+ }
@@ -14,4 +14,4 @@
14
14
  %property{ :name => key}=value["content"]
15
15
  %imageLocation{ :href => @dmtfitem["imageLocation"]}
16
16
  %operation{ :rel => "edit", :href => machine_images_url + "/" + @dmtfitem["uri"] }
17
- %operation{ :rel => "delete", :href => machine_images_url + "/" + @dmtfitem["uri"] }
17
+ %operation{ :rel => "delete", :href => machine_images_url + "/" + @dmtfitem["uri"] }
@@ -107,7 +107,7 @@
107
107
  :javascript
108
108
  function fixupXml(theNode) {
109
109
  var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
110
- xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
110
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
111
111
  xmlData += getStandardData(theNode);
112
112
  xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
113
113
  xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
@@ -174,4 +174,4 @@
174
174
 
175
175
  cellRightBut.appendChild(er);
176
176
 
177
- }
177
+ }
@@ -25,4 +25,4 @@
25
25
  %capacity{ :quantity => disk["capacity"]["quantity"], :units => disk["capacity"]["units"] }
26
26
  %guestInterface= disk["guestInterface"]
27
27
  %operation{ :rel => "edit", :href => machines_url + "/" + @dmtfitem["uri"] }
28
- %operation{ :rel => "delete", :href => machines_url + "/" + @dmtfitem["uri"] }
28
+ %operation{ :rel => "delete", :href => machines_url + "/" + @dmtfitem["uri"] }
@@ -54,7 +54,7 @@
54
54
  :javascript
55
55
  function fixupXml(theNode) {
56
56
  var xmlData = "<?xml version='1.0' encoding='utf-8' ?>";
57
- xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://www.dmtf.org/cimi'>";
57
+ xmlData += "<" + $(theNode.form).attr("xmlRootNode").value + " xmlns='http://schemas.dmtf.org/cimi/1'>";
58
58
  xmlData += getStandardData(theNode);
59
59
  xmlData += "<cpu>" + $(theNode.form).attr("cpu").value + "</cpu>";
60
60
  xmlData += "<memory quantity='" + $(theNode.form).attr("memory_quantity").value + "' units='";
@@ -65,4 +65,4 @@
65
65
  xmlData += "</" + $(theNode.form).attr("xmlRootNode").value + ">";
66
66
 
67
67
  return xmlData;
68
- }
68
+ }
@@ -14,4 +14,4 @@
14
14
  %property{ :name => key}=value["content"]
15
15
  %capacity{ :quantity => @dmtfitem["capacity"]["quantity"], :units => @dmtfitem["capacity"]["units"]}
16
16
  %operation{ :rel => "edit", :href => volumes_url + "/" + @dmtfitem["uri"] }
17
- %operation{ :rel => "delete", :href => volumes_url + "/" + @dmtfitem["uri"] }
17
+ %operation{ :rel => "delete", :href => volumes_url + "/" + @dmtfitem["uri"] }
@@ -13,7 +13,7 @@
13
13
  %h3 Operations:
14
14
  - @operations.keys.sort_by { |k| k.to_s }.each do |operation|
15
15
  %li{ :'data-role' => 'list-divider'}
16
- %a{:href => api_url_for("docs/#{@collection.name.to_s}/#{operation}"), :'data-ajax' => 'false'} #{operation}
16
+ %a{:href => url_for("docs/#{@collection.name.to_s}/#{operation}"), :'data-ajax' => 'false'} #{operation}
17
17
  %li
18
18
  %br
19
19
  %p=@operations[operation].description
@@ -1,9 +1,9 @@
1
1
  %docs{:status => "unsupported"}
2
- %collection{:url => api_url_for("docs/#{@collection.name}"), :name => "#{@collection.name}"}
2
+ %collection{:url => url_for("docs/#{@collection.name}"), :name => "#{@collection.name}"}
3
3
  %description #{@collection.description}
4
4
  %operations
5
5
  - @operations.keys.sort_by { |k| k.to_s }.each do |operation|
6
- %operation{:url => api_url_for("#{@collection.name.to_s}"), :name => "#{operation}", :href => api_url_for("#{@operations[operation].path}"), :method => "#{@operations[operation].method}"}
6
+ %operation{:url => url_for("#{@collection.name.to_s}"), :name => "#{operation}", :href => url_for("#{@operations[operation].path}"), :method => "#{@operations[operation].method}"}
7
7
  %description #{@operations[operation].description}
8
8
  - @operations[operation].each_param do |param|
9
9
  %parameter{:name => "#{param.name}", :type => "#{param.type}"}
@@ -5,7 +5,7 @@
5
5
  %ul{ :'data-role' => :listview, :'data-inset' => 'true'}
6
6
  - collections.keys.sort_by { |k| k.to_s }.each do |collection|
7
7
  %li
8
- %a{:href => api_url_for("docs/#{collection}"), :'data-ajax' => 'false'}
8
+ %a{:href => url_for("docs/#{collection}"), :'data-ajax' => 'false'}
9
9
  %h3=collection.to_s.capitalize.tr('_', ' ')
10
10
  %p=collections[collection].description
11
11
 
@@ -1,5 +1,5 @@
1
1
  %docs{:status => "unsupported"}
2
2
  - collections.keys.sort_by { |k| k.to_s }.each do |collection|
3
- %collection{:url => api_url_for("docs/#{collection}")}
3
+ %collection{:url => url_for("docs/#{collection}")}
4
4
  %name #{collection}
5
5
  %description #{collections[collection].description}
@@ -1,5 +1,5 @@
1
1
  %docs{:status => "unsupported"}
2
- %operation{:url => api_url_for("docs/#{@collection.name.to_s}"), :name => "#{@operation.name.to_s}", :href => url_for("#{@operation.path}"), :method => "#{@operation.method}"}
2
+ %operation{:url => url_for("docs/#{@collection.name.to_s}"), :name => "#{@operation.name.to_s}", :href => url_for("#{@operation.path}"), :method => "#{@operation.method}"}
3
3
  %description #{@operation.description}
4
4
  - @operation.each_param do |param|
5
5
  %parameter{:name => "#{param.name}", :type => "#{param.type}"}
@@ -26,7 +26,7 @@
26
26
  %div{ 'data-role' => :navbar}
27
27
  %ul
28
28
  %li
29
- %a{ :'data-icon' => 'home', :href => api_url_for(''), :'data-ajax' => 'false'} Home
29
+ %a{ :'data-icon' => 'home', :href => url_for(''), :'data-ajax' => 'false'} Home
30
30
  %li=link_to_format(:xml)
31
31
  %li=link_to_format(:json)
32
32
  %div{ 'data-role' => :header, 'data-theme' => 'a' }
@@ -2,7 +2,7 @@
2
2
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
3
  %li{ :'data-role' => 'list-divider'} Server message
4
4
  %li
5
- %h3=[@error.class.name, @error.message].join(' - ')
5
+ %h3= h [@error.class.name, @error.message].join(' - ')
6
6
  %li{ :'data-role' => 'list-divider'} Original request URI
7
7
  %li
8
8
  %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
@@ -11,15 +11,18 @@
11
11
  %li{ :'data-role' => 'list-divider'} Error details
12
12
  %li
13
13
  - if @error.class.method_defined? :details
14
- %p= @error.details
14
+ %p= h @error.details
15
15
  - else
16
16
  %em No details
17
+ %li{ :'data-role' => 'list-divider'} Backtrace
18
+ %li
19
+ %pre= bt @error.backtrace
17
20
 
18
21
  %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
19
22
  %h3 Backtrace
20
23
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
21
24
  %li
22
- %pre=@error.backtrace.join("\n")
25
+ %pre= h @error.backtrace.join("\n")
23
26
 
24
27
  %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
25
28
  %h3 Parameters
@@ -40,4 +43,4 @@
40
43
  - next if value.inspect.to_s == '#'
41
44
  %li{ :'data-role' => 'list-divider'}=key
42
45
  %li
43
- %span{:style => 'font-weight:normal;'}=value.inspect
46
+ %span{:style => 'font-weight:normal;'}= h value.inspect
@@ -1,5 +1,5 @@
1
1
  =header "Firewalls" do
2
- %a{ :href => api_url_for('firewalls/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new firewall
2
+ %a{ :href => url_for('firewalls/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new firewall
3
3
  =subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
4
4
 
5
5
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
@@ -18,7 +18,7 @@
18
18
  =link_to_action "Destroy", destroy_firewall_url(@firewall.id), :delete
19
19
 
20
20
  =header "Rules", :back => 'false' do
21
- %a{ :href => api_url_for("firewalls/#{@firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
21
+ %a{ :href => url_for("firewalls/#{@firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
22
22
 
23
23
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
24
24
  - @firewall.rules.each do |rule|
@@ -25,9 +25,9 @@
25
25
  %li
26
26
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
27
27
  - @image.hardware_profiles.each do |hwp|
28
- %a{ :href => api_url_for("hardware_profiles/#{hwp.name}"), :'data-role' => "button", :'data-ajax' => 'false'} #{hwp.name}
28
+ %a{ :href => url_for("hardware_profiles/#{hwp.name}"), :'data-role' => "button", :'data-ajax' => 'false'} #{hwp.name}
29
29
  %li{ :'data-role' => 'list-divider'} Actions
30
30
  %li
31
31
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
32
- %a{ :href => api_url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch
32
+ %a{ :href => url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch
33
33
  = link_to_action 'Destroy', destroy_image_url(@image.id), :delete
@@ -0,0 +1,9 @@
1
+ %html
2
+ %head
3
+ %body
4
+ %h1 Deltacloud API
5
+ %h2 Enabled Frontends:
6
+ %ul
7
+ - Deltacloud.enabled_frontends.each do |f|
8
+ %li
9
+ %a{ :href => f.root_url}=f.name
@@ -2,7 +2,7 @@
2
2
  =subheader "#{driver_symbol}@#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'd', :class => 'middle-dialog'}
5
- %img{ :src => api_url_for('instance_states?format=png') }
5
+ %img{ :src => url_for('instance_states?format=png') }
6
6
 
7
7
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-theme' => 'a'}
8
8
  - @machine.states.each do |state|
@@ -2,7 +2,7 @@
2
2
  =subheader "#{@instance.id}"
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
5
- %form{ :action => api_url_for('/instances/%s/run' % @instance.id), :method => :post }
5
+ %form{ :action => url_for('/instances/%s/run' % @instance.id), :method => :post }
6
6
  %p
7
7
  %label{ :for => :cmd } Desired command:
8
8
  %input{ :name => :cmd, :value => "", :type => :text}
@@ -59,6 +59,6 @@
59
59
  - @instance.actions.each do |action|
60
60
  =link_to_action action, self.send(:"#{action}_instance_url", @instance.id), instance_action_method(action)
61
61
  - if @instance.state=="RUNNING" and driver.respond_to?(:run_on_instance)
62
- =link_to_action 'run command', api_url_for('instances/%s/run' % @instance.id), :get
62
+ =link_to_action 'run command', url_for('instances/%s/run' % @instance.id), :get
63
63
  - if @instance.can_create_image?
64
- =link_to_action 'Create Image', api_url_for("images/new?instance_id=#{@instance.id}"), :get
64
+ =link_to_action 'Create Image', url_for("images/new?instance_id=#{@instance.id}"), :get
@@ -1,5 +1,5 @@
1
1
  =header "Keys" do
2
- %a{ :href => api_url_for('keys/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new key
2
+ %a{ :href => url_for('keys/new'), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right'} Create new key
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
@@ -18,7 +18,7 @@
18
18
  %div{ 'data-role' => :navbar}
19
19
  %ul
20
20
  %li
21
- %a{ :'data-icon' => 'home', :href => "#{api_url_for('').chomp("/")}", :'data-ajax' => 'false'} Home
21
+ %a{ :'data-icon' => 'home', :href => "#{url_for('').chomp("/")}", :'data-ajax' => 'false'} Home
22
22
  %li=link_to_format(:xml)
23
23
  %li=link_to_format(:json)
24
24
  %div{ 'data-role' => :header, 'data-theme' => 'a' }