deltacloud-core 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/Rakefile +63 -7
  2. data/bin/deltacloudd +29 -17
  3. data/config.ru +5 -3
  4. data/config/drivers/ec2.yaml +9 -0
  5. data/config/drivers/google.yaml +3 -0
  6. data/config/drivers/openstack.yaml +3 -0
  7. data/deltacloud-core.gemspec +1 -1
  8. data/lib/cimi/dependencies.rb +62 -0
  9. data/lib/cimi/helpers/cimi_helper.rb +50 -0
  10. data/lib/cimi/model.rb +52 -0
  11. data/lib/cimi/model/action.rb +24 -0
  12. data/lib/cimi/model/base.rb +249 -0
  13. data/lib/cimi/model/cloud_entry_point.rb +48 -0
  14. data/lib/cimi/model/entity_metadata.rb +83 -0
  15. data/lib/cimi/model/entity_metadata_collection.rb +31 -0
  16. data/lib/cimi/model/errors.rb +40 -0
  17. data/lib/cimi/model/machine.rb +227 -0
  18. data/lib/cimi/model/machine_admin.rb +59 -0
  19. data/lib/cimi/model/machine_admin_collection.rb +34 -0
  20. data/lib/cimi/model/machine_collection.rb +34 -0
  21. data/lib/cimi/model/machine_configuration.rb +67 -0
  22. data/lib/cimi/model/machine_configuration_collection.rb +34 -0
  23. data/lib/cimi/model/machine_image.rb +46 -0
  24. data/lib/cimi/model/machine_image_collection.rb +34 -0
  25. data/lib/cimi/model/machine_template.rb +41 -0
  26. data/lib/cimi/model/machine_template_collection.rb +34 -0
  27. data/lib/cimi/model/network.rb +69 -0
  28. data/lib/cimi/model/network_collection.rb +34 -0
  29. data/lib/cimi/model/network_configuration.rb +50 -0
  30. data/lib/cimi/model/network_configuration_collection.rb +34 -0
  31. data/lib/cimi/model/network_template.rb +26 -0
  32. data/lib/cimi/model/schema.rb +277 -0
  33. data/lib/cimi/model/volume.rb +103 -0
  34. data/lib/cimi/model/volume_collection.rb +34 -0
  35. data/lib/cimi/model/volume_configuration.rb +60 -0
  36. data/lib/cimi/model/volume_configuration_collection.rb +34 -0
  37. data/lib/cimi/model/volume_image.rb +49 -0
  38. data/lib/cimi/model/volume_image_collection.rb +34 -0
  39. data/lib/cimi/model/volume_template.rb +23 -0
  40. data/lib/cimi/model/volume_template_collection.rb +34 -0
  41. data/lib/cimi/server.rb +575 -0
  42. data/lib/deltacloud/base_driver/base_driver.rb +11 -1
  43. data/lib/deltacloud/core_ext.rb +2 -0
  44. data/lib/deltacloud/core_ext/array.rb +25 -0
  45. data/lib/deltacloud/core_ext/hash.rb +7 -0
  46. data/lib/deltacloud/core_ext/proc.rb +31 -0
  47. data/lib/deltacloud/core_ext/string.rb +15 -0
  48. data/lib/deltacloud/drivers/condor/condor_driver.rb +2 -1
  49. data/lib/deltacloud/drivers/ec2/ec2_driver.rb +32 -10
  50. data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +1 -1
  51. data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +1 -1
  52. data/lib/deltacloud/drivers/google/google_driver.rb +233 -0
  53. data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +7 -2
  54. data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +7 -2
  55. data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +7 -2
  56. data/lib/deltacloud/drivers/mock/mock_client.rb +17 -0
  57. data/lib/deltacloud/drivers/mock/mock_driver.rb +82 -8
  58. data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +1 -1
  59. data/lib/deltacloud/drivers/openstack/openstack_driver.rb +47 -0
  60. data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +8 -8
  61. data/lib/deltacloud/drivers/rhevm/rhevm_client.rb +122 -49
  62. data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +42 -22
  63. data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +1 -1
  64. data/lib/deltacloud/drivers/sbc/sbc_driver.rb +3 -2
  65. data/lib/deltacloud/drivers/terremark/terremark_driver.rb +2 -2
  66. data/lib/deltacloud/drivers/vsphere/vsphere_client.rb +25 -4
  67. data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +35 -12
  68. data/lib/deltacloud/hardware_profile.rb +34 -10
  69. data/lib/deltacloud/helpers/application_helper.rb +3 -28
  70. data/lib/deltacloud/helpers/blob_stream.rb +2 -1
  71. data/lib/deltacloud/models.rb +2 -0
  72. data/lib/deltacloud/models/bucket.rb +1 -1
  73. data/lib/deltacloud/models/image.rb +1 -1
  74. data/lib/deltacloud/models/instance.rb +2 -1
  75. data/lib/deltacloud/models/instance_address.rb +56 -0
  76. data/lib/deltacloud/models/provider.rb +27 -0
  77. data/{server.rb → lib/deltacloud/server.rb} +72 -14
  78. data/lib/deltacloud/validation.rb +31 -10
  79. data/lib/sinatra/rabbit.rb +34 -26
  80. data/lib/sinatra/rack_accept.rb +5 -5
  81. data/lib/sinatra/rack_matrix_params.rb +6 -2
  82. data/lib/sinatra/rack_syslog.rb +3 -3
  83. data/lib/sinatra/static_assets.rb +1 -1
  84. data/lib/sinatra/url_for.rb +1 -7
  85. data/public/images/bread-bg.png +0 -0
  86. data/public/images/logo-wide.png +0 -0
  87. data/public/images/topbar-bg.png +0 -0
  88. data/public/javascripts/application.js +5 -0
  89. data/public/javascripts/cmwgapp.js +249 -0
  90. data/public/javascripts/jquery-1.4.2.min.js +154 -0
  91. data/public/javascripts/jquery.mobile-1.0rc1.min.js +170 -0
  92. data/public/stylesheets/images/icons-18-black.png +0 -0
  93. data/public/stylesheets/images/icons-18-white.png +0 -0
  94. data/public/stylesheets/images/icons-36-black.png +0 -0
  95. data/public/stylesheets/images/icons-36-white.png +0 -0
  96. data/public/stylesheets/jquery.mobile-1.0rc1.min.css +12 -0
  97. data/public/stylesheets/new.css +4 -0
  98. data/support/fedora/deltacloud-core.init +20 -13
  99. data/tests/cimi/features/step_definitions/common_steps.rb +59 -0
  100. data/tests/cimi/features/step_definitions/machine_images_steps.rb +0 -0
  101. data/tests/cimi/features/step_definitions/machines_steps.rb +99 -0
  102. data/tests/cimi/features/step_definitions/volumes_steps.rb +115 -0
  103. data/tests/cimi/features/support/env.rb +53 -0
  104. data/tests/common.rb +89 -11
  105. data/tests/core_ext/string.rb +31 -0
  106. data/tests/drivers/google/api_test.rb +35 -0
  107. data/tests/drivers/google/buckets_test.rb +116 -0
  108. data/tests/drivers/google/setup.rb +38 -0
  109. data/tests/drivers/mock/instances_test.rb +20 -5
  110. data/tests/drivers/openstack/api_test.rb +41 -0
  111. data/tests/drivers/openstack/hardware_profiles_test.rb +53 -0
  112. data/tests/drivers/openstack/images_test.rb +40 -0
  113. data/tests/drivers/openstack/instances_test.rb +163 -0
  114. data/tests/drivers/openstack/realms_test.rb +36 -0
  115. data/tests/drivers/openstack/setup.rb +20 -0
  116. data/tests/drivers/rackspace/buckets_test.rb +145 -0
  117. data/tests/drivers/rackspace/setup.rb +3 -3
  118. data/tests/drivers/rhevm/api_test.rb +1 -1
  119. data/tests/drivers/rhevm/images_test.rb +2 -2
  120. data/tests/drivers/rhevm/instances_test.rb +10 -12
  121. data/tests/drivers/rhevm/realms_test.rb +4 -4
  122. data/tests/drivers/rhevm/setup.rb +3 -3
  123. data/tests/rabbit_test.rb +1 -1
  124. data/views/api/show.html.haml +13 -0
  125. data/views/cimi/cloudEntryPoint/index.html.haml +5 -0
  126. data/views/cimi/cloudEntryPoint/index.xml.haml +9 -0
  127. data/views/cimi/collection/index.html.haml +45 -0
  128. data/views/cimi/collection/response.xml.haml +3 -0
  129. data/views/cimi/error.html.haml +31 -0
  130. data/views/cimi/errors/400.html.haml +41 -0
  131. data/views/cimi/errors/400.xml.haml +3 -0
  132. data/views/cimi/errors/401.html.haml +41 -0
  133. data/views/cimi/errors/401.xml.haml +2 -0
  134. data/views/cimi/errors/403.html.haml +42 -0
  135. data/views/cimi/errors/403.xml.haml +2 -0
  136. data/views/cimi/errors/404.html.haml +29 -0
  137. data/views/cimi/errors/404.xml.haml +2 -0
  138. data/views/cimi/errors/405.html.haml +29 -0
  139. data/views/cimi/errors/405.xml.haml +5 -0
  140. data/views/cimi/errors/500.html.haml +43 -0
  141. data/views/cimi/errors/500.xml.haml +6 -0
  142. data/views/cimi/errors/502.html.haml +43 -0
  143. data/views/cimi/errors/502.xml.haml +7 -0
  144. data/views/cimi/errors/backend_capability_failure.html.haml +29 -0
  145. data/views/cimi/layout.html.haml +32 -0
  146. data/views/cimi/machine_configurations/show.html.haml +159 -0
  147. data/views/cimi/machine_configurations/show.xml.haml +27 -0
  148. data/views/cimi/machine_images/show.html.haml +79 -0
  149. data/views/cimi/machine_images/show.xml.haml +17 -0
  150. data/views/cimi/machines/show.html.haml +177 -0
  151. data/views/cimi/machines/show.xml.haml +28 -0
  152. data/views/cimi/volumes/show.html.haml +68 -0
  153. data/views/cimi/volumes/show.xml.haml +17 -0
  154. data/views/drivers/show.html.haml +10 -5
  155. data/views/drivers/show.xml.haml +9 -4
  156. data/views/error.html.haml +2 -2
  157. data/views/errors/500.xml.haml +7 -1
  158. data/views/instances/index.html.haml +1 -1
  159. data/views/instances/new.html.haml +19 -16
  160. data/views/instances/show.html.haml +7 -2
  161. data/views/instances/show.xml.haml +8 -7
  162. data/views/layout.html.haml +2 -2
  163. data/views/storage_volumes/show.html.haml +1 -1
  164. metadata +296 -204
  165. data/public/javascripts/jquery.mobile-1.0b1.min.js +0 -146
  166. data/public/stylesheets/jquery.mobile-1.0b1.min.css +0 -8
@@ -1,6 +1,6 @@
1
1
  ENV['API_DRIVER'] = "rackspace"
2
- ENV['API_USER'] = 'michalfojtik'
3
- ENV['API_PASSWORD'] = '47de1170d57eb8f11dba2f6e7fd26838'
2
+ ENV['API_USER'] = 'mandreou'
3
+ ENV['API_PASSWORD'] = 'a4d531ef02a37dd32cac1e8e516df9eb'
4
4
 
5
5
  require 'vcr'
6
6
 
@@ -9,6 +9,6 @@ DeltacloudTestCommon::record!
9
9
  VCR.config do |c|
10
10
  c.cassette_library_dir = "#{File.dirname(__FILE__)}/../../../tests/drivers/rackspace/fixtures/"
11
11
  c.stub_with :webmock
12
- c.default_cassette_options = { :record => :none }
12
+ c.default_cassette_options = { :record => :new_episodes }
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ module RHEVMTest
21
21
  features = (last_xml_response/'/api/link[@rel="instances"]/feature').collect { |f| f[:name] }
22
22
  features.include?('user_name').should == true
23
23
  features.include?('hardware_profiles').should == true
24
- features.length.should == 2
24
+ features.length.should == 3
25
25
  end
26
26
 
27
27
  def test_03_it_has_rhevm_collections
@@ -32,9 +32,9 @@ module RHEVMTest
32
32
  end
33
33
 
34
34
  def test_03_it_returns_single_image
35
- get_auth_url '/api;driver=rhevm/images/bb2e79bd-fd73-46a1-b391-a390b1998f03'
35
+ get_auth_url '/api;driver=rhevm/images/3e82e2d5-913f-4095-ae72-ebcfa9d0571d'
36
36
  (last_xml_response/'image').length.should == 1
37
- (last_xml_response/'image/name').text.should == 'F14-Minimal-Srv'
37
+ (last_xml_response/'image/name').text.should == 'f15-minimal-2'
38
38
  (last_xml_response/'image/state').text.should == 'OK'
39
39
  end
40
40
 
@@ -12,8 +12,8 @@ module RHEVMTest
12
12
 
13
13
  def test_01_01_it_can_create_instance_without_hardware_profile
14
14
  params = {
15
- :image_id => 'bb2e79bd-fd73-46a1-b391-a390b1998f03',
16
- :name => 'mock-test1',
15
+ :image_id => '3e82e2d5-913f-4095-ae72-ebcfa9d0571d',
16
+ :name => 'dc-webmock-1',
17
17
  :'api[driver]' => 'rhevm',
18
18
  }
19
19
  post_url '/api/instances', params
@@ -21,7 +21,7 @@ module RHEVMTest
21
21
  @@instance = last_xml_response
22
22
  (@@instance/'instance').length.should > 0
23
23
  (@@instance/'instance/name').first.text.should_not == nil
24
- (@@instance/'instance/name').first.text.should == 'mock-test1'
24
+ (@@instance/'instance/name').first.text.should == 'dc-webmock-1'
25
25
  (@@instance/'instance/owner_id').first.text.should_not == ''
26
26
  (@@instance/'instance/owner_id').first.text.should == ENV['API_USER']
27
27
  (@@instance/'instance/state').first.text.should == 'PENDING'
@@ -29,8 +29,8 @@ module RHEVMTest
29
29
 
30
30
  def test_01_02_it_can_create_instance_with_hardware_profile
31
31
  params = {
32
- :image_id => 'bb2e79bd-fd73-46a1-b391-a390b1998f03',
33
- :name => 'mock-test2',
32
+ :image_id => '3e82e2d5-913f-4095-ae72-ebcfa9d0571d',
33
+ :name => 'dc-webmock-2',
34
34
  :hwp_id => 'SERVER',
35
35
  :'api[driver]' => 'rhevm',
36
36
  }
@@ -39,7 +39,7 @@ module RHEVMTest
39
39
  @@instance2 = last_xml_response
40
40
  (@@instance2/'instance').length.should > 0
41
41
  (@@instance2/'instance/name').first.text.should_not == nil
42
- (@@instance2/'instance/name').first.text.should == 'mock-test2'
42
+ (@@instance2/'instance/name').first.text.should == 'dc-webmock-2'
43
43
  (@@instance2/'instance/owner_id').first.text.should_not == ''
44
44
  (@@instance2/'instance/owner_id').first.text.should == ENV['API_USER']
45
45
  (@@instance2/'instance/state').first.text.should == 'PENDING'
@@ -154,11 +154,10 @@ module RHEVMTest
154
154
  last_response.status.should == 204
155
155
  20.times do |tick|
156
156
  get_auth_url "/api;driver=rhevm/instances/#{(@@instance/'instance').first[:id]}", { :tick => tick}
157
- #last_response.status.should_not == 500
158
- break if last_response.status == 500
157
+ break if last_response.status == 404
159
158
  sleep(5)
160
159
  end
161
- last_response.status.should == 500
160
+ last_response.status.should == 404
162
161
  end
163
162
 
164
163
  def test_06_02_created_instance_can_be_destroyed
@@ -169,11 +168,10 @@ module RHEVMTest
169
168
  last_response.status.should == 204
170
169
  20.times do |tick|
171
170
  get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}
172
- #last_response.status.should_not == 500
173
- break if last_response.status == 500
171
+ break if last_response.status == 404
174
172
  sleep(5)
175
173
  end
176
- last_response.status.should == 500
174
+ last_response.status.should == 404
177
175
  end
178
176
  end
179
177
  end
@@ -20,14 +20,14 @@ module RHEVMTest
20
20
  (last_xml_response/'realms/realm').each do |profile|
21
21
  (profile/'name').text.should_not == nil
22
22
  (profile/'name').text.should_not == ''
23
- (profile/'name').text.should == 'Default'
23
+ (profile/'name').text.should_not == 'Default'
24
24
  end
25
25
  end
26
26
 
27
27
  def test_03_it_returns_single_realm
28
- get_auth_url '/api;driver=rhevm/realms/us'
29
- (last_xml_response/'realm').first[:id].should == '0'
30
- (last_xml_response/'realm/name').first.text.should == 'Default'
28
+ get_auth_url '/api;driver=rhevm/realms/3c8af388-cff6-11e0-9267-52540013f702'
29
+ (last_xml_response/'realm').first[:id].should == '3c8af388-cff6-11e0-9267-52540013f702'
30
+ (last_xml_response/'realm/name').first.text.should == 'engops-nfs'
31
31
  (last_xml_response/'realm/state').first.text.should == 'AVAILABLE'
32
32
  end
33
33
 
@@ -1,6 +1,6 @@
1
- ENV['API_USER'] = 'rhev-m@deltacloud.local'
2
- ENV['API_PASSWORD'] = 'RedHat001'
3
- ENV['API_PROVIDER'] = 'https://rhev-dc.lab.eng.brq.redhat.com:8443/rhevm-api-powershell'
1
+ ENV['API_USER'] = 'vdcadmin@rhev.lab.eng.brq.redhat.com'
2
+ ENV['API_PASSWORD'] = '123456'
3
+ ENV['API_PROVIDER'] = 'https://rhev30-dc.lab.eng.brq.redhat.com:8443/rhevm-api;645e425e-66fe-4ac9-8874-537bd10ef08d'
4
4
 
5
5
  require 'vcr'
6
6
 
@@ -44,7 +44,7 @@ module DeltacloudUnitTest
44
44
  features.should =~ [:hardware_profiles, :user_name, :authentication_key, :user_data]
45
45
 
46
46
  op = @app.collections[:instances].operations[:create]
47
- op.effective_params(@driver).keys.should =~ [:image_id, :hwp_memory, :hwp_id, :keyname, :name, :hwp_storage, :realm_id, :user_data]
47
+ op.effective_params(@driver).keys.should =~ [:image_id, :hwp_memory, :hwp_id, :keyname, :name, :hwp_storage, :realm_id, :user_data, :hwp_architecture, :hwp_cpu]
48
48
 
49
49
  op.params.keys =~ [:realm_id, :image_id, :hwp_id]
50
50
  end
@@ -5,3 +5,16 @@
5
5
  %ul{ :'data-role' => :listview, :'data-inset' => 'true'}
6
6
  - @collections.sort_by { |k| k.to_s }.each do |key|
7
7
  %li= link_to key.to_s.gsub('_', ' ').titlecase, api_url_for(key), :'data-icon' => "arrow-r", :'data-ajax' => false
8
+
9
+ - if @providers.size > 1
10
+ %div{ :'data-role' => :footer, :'data-theme' => 'a'}
11
+ %form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
12
+ - if @driver_name
13
+ %input{ :name => :driver, :type => :hidden, :value => @driver_name }/
14
+ %div{ :'data-role' => :footer, :'data-theme' => 'a' , :class => 'middle-dialog'}
15
+ %label{ :for => :provider, :class => 'ui-input-text'}
16
+ %select{:name => 'provider', :'data-native-menu' => "true" }
17
+ %option{ :value => 'default'} default
18
+ - @providers.each do |provider|
19
+ %option{ :value => provider } #{provider}
20
+ %button{ :type => :submit} Change Provider
@@ -0,0 +1,5 @@
1
+
2
+ - @collections.each do |p|
3
+ - name, path = p
4
+ = link_to name.to_s.capitalize, path
5
+ %br/
@@ -0,0 +1,9 @@
1
+ !!!XML
2
+ %CloudEntryPoint{ :xmlns => CMWG_NAMESPACE }
3
+ %uri= api_url_for("/cloudEntryPoint")
4
+ %name cloud entry point
5
+ %description cloud entry point
6
+ %created= Time.new.getutc.to_s
7
+ - @collections.each do |api|
8
+ - res_name = api[0].to_s.camelize(:lower_case_first_letter)
9
+ = "<#{res_name} href=\"#{api[1]}\"/>"
@@ -0,0 +1,45 @@
1
+ - new_name = @dmtfitem["uri"] + " Collection"
2
+ - new_name = new_name.gsub(/[A-Z]/, ' \0')
3
+ %h1 #{new_name.capitalize}
4
+
5
+ %form{ :action => api_url_for("/collection/" + @dmtfitem["uri"]) }
6
+ %input{ :name => :id, :type => :hidden, :value => @dmtfitem["uri"] }/
7
+ %input{ :name => :xmlRootNode, :type => :hidden, :value => @xml_root_node }/
8
+ %p
9
+ %label
10
+ Name:
11
+ %p
12
+ %input{ :name => :name, :size => 50, :value => @dmtfitem["name"], :style => "width:50%;" }
13
+ %input{ :name => :created, :type => :hidden, :size => 50, :value => @dmtfitem["created"] }
14
+ %p
15
+ %br
16
+ %label
17
+ Description:
18
+ %p
19
+ %textarea{ :name => :description, :cols => 50, :rows => 4, :style => "width:50%;" } #{@dmtfitem['description']}
20
+ %p
21
+ - if @dmtfitem["operation"]
22
+ - if @dmtfitem["operation"].kind_of? (Array)
23
+ - property_object = @dmtfitem["operation"]
24
+ - else
25
+ - property_object = [@dmtfitem["operation"]]
26
+ - iter = -1
27
+ - property_object.map do | operation|
28
+ - iter += 1
29
+ %br
30
+ %label
31
+ = operation["rel"].capitalize + ":&nbsp;" + api_url_for(operation["href"])
32
+ %input{ :name => "operation_"+iter.to_s, :oper_type => operation["rel"], :type => :hidden, :value => operation["href"] }
33
+ %br
34
+ %p
35
+ %br
36
+ - new_name = @dmtfitem["uri"]
37
+ - new_name = new_name.gsub(/[A-Z]/, ' \0')
38
+ - if @dmtf_col_items
39
+ %label
40
+ = new_name.capitalize.pluralize + ":"
41
+ %table{ :style => "width:52%;"}
42
+ - @dmtf_col_items.map do |template|
43
+ %tr
44
+ %td
45
+ %a{ :href => template["href"] }= template["name"]
@@ -0,0 +1,3 @@
1
+ !!!XML
2
+ %ReturnCode{ :xmlns => CMWG_NAMESPACE }
3
+ %Status= "Success"
@@ -0,0 +1,31 @@
1
+ !!!
2
+ !!! XML
3
+
4
+ %html
5
+ %head
6
+ = stylesheet_link_tag '/stylesheets/compiled/screen.css', :media => 'screen, projection'
7
+ = stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
8
+ /[if lt IE 8]
9
+ = stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen, projection'
10
+ = stylesheet_link_tag '/stylesheets/compiled/application.css', :media => 'screen, projection'
11
+ %script{:type => "text/javascript", :src => "/javascripts/jquery-1.4.2.min.js" }
12
+ %script{:type => "text/javascript", :src => "/javascripts/application.js" }
13
+ %body
14
+ #wrapper
15
+ #header
16
+ = link_to image_tag( "/images/logo-wide.png" ), settings.root_url
17
+ = bread_crumb
18
+ #content{:class => :error}
19
+ = yield
20
+ #footer
21
+ #formats
22
+ Format:
23
+ =link_to_format(:xml)
24
+ |
25
+ =link_to_format(:json)
26
+ #driver_info
27
+ Driver: #{driver_symbol} | API version: #{settings.version}
28
+ #copyright
29
+ Copyright 2009-2011
30
+ %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
31
+ and individual contributors.
@@ -0,0 +1,41 @@
1
+ %div{ :'data-role' => :content, :'data-theme' => 'b'}
2
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
+ %li{ :'data-role' => 'list-divider'} Server message
4
+ %li
5
+ %h3=[@error.class.name, @error.message].join(' - ')
6
+ %li{ :'data-role' => 'list-divider'} Original request URI
7
+ %li
8
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
+ %span=request.env['REQUEST_URI']
10
+ %span{ :class => 'ui-li-count'} Retry
11
+ %li{ :'data-role' => 'list-divider'} Error details
12
+ %li
13
+ - if @error.class.method_defined? :details
14
+ %p= @error.details
15
+ - else
16
+ %em No details
17
+
18
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
19
+ %h3 Backtrace
20
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
21
+ %li
22
+ %pre=@error.backtrace.join("\n")
23
+
24
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
25
+ %h3 Parameters
26
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
27
+ - if params.keys.empty?
28
+ %li{ :'data-role' => 'list-divider'} No parameters
29
+ - params.each do |key, value|
30
+ %li{ :'data-role' => 'list-divider'}=key
31
+ %li
32
+ %span{:style => 'font-weight:normal;'}=value.inspect
33
+
34
+
35
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
36
+ %h3 Request details
37
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
38
+ - request.env.each do |key, value|
39
+ %li{ :'data-role' => 'list-divider'}=key
40
+ %li
41
+ %span{:style => 'font-weight:normal;'}=value.inspect
@@ -0,0 +1,3 @@
1
+ %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
+ %parameter #{@error.name}
3
+ %message< #{cdata @error.message}
@@ -0,0 +1,41 @@
1
+ %div{ :'data-role' => :content, :'data-theme' => 'b'}
2
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
+ %li{ :'data-role' => 'list-divider'} Server message
4
+ %li
5
+ %h3=[@error.class.name, @error.message].join(' - ')
6
+ %li{ :'data-role' => 'list-divider'} Original request URI
7
+ %li
8
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
+ %span=request.env['REQUEST_URI']
10
+ %span{ :class => 'ui-li-count'} Retry
11
+ %li{ :'data-role' => 'list-divider'} Error details
12
+ %li
13
+ - if @error.class.method_defined? :details
14
+ %p= @error.details
15
+ - else
16
+ %em No details
17
+
18
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
19
+ %h3 Backtrace
20
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
21
+ %li
22
+ %pre=@error.backtrace.join("\n")
23
+
24
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
25
+ %h3 Parameters
26
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
27
+ - if params.keys.empty?
28
+ %li{ :'data-role' => 'list-divider'} No parameters
29
+ - params.each do |key, value|
30
+ %li{ :'data-role' => 'list-divider'}=key
31
+ %li
32
+ %span{:style => 'font-weight:normal;'}=value.inspect
33
+
34
+
35
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
36
+ %h3 Request details
37
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
38
+ - request.env.each do |key, value|
39
+ %li{ :'data-role' => 'list-divider'}=key
40
+ %li
41
+ %span{:style => 'font-weight:normal;'}=value.inspect
@@ -0,0 +1,2 @@
1
+ %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
+ %message< #{cdata @error.message}
@@ -0,0 +1,42 @@
1
+ %div{ :'data-role' => :content, :'data-theme' => 'b'}
2
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
+ %li{ :'data-role' => 'list-divider'} Server message
4
+ %li
5
+ %h3=[@error.class.name, @error.message].join(' - ')
6
+ %li{ :'data-role' => 'list-divider'} Original request URI
7
+ %li
8
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
+ %span=request.env['REQUEST_URI']
10
+ %span{ :class => 'ui-li-count'} Retry
11
+ %li{ :'data-role' => 'list-divider'} Error details
12
+ %li
13
+ - if @error.class.method_defined? :details
14
+ %p= @error.details
15
+ - else
16
+ %em No details
17
+
18
+ - if @error.backtrace
19
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
20
+ %h3 Backtrace
21
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
22
+ %li
23
+ %pre=@error.backtrace.join("\n")
24
+
25
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
26
+ %h3 Parameters
27
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
28
+ - if params.keys.empty?
29
+ %li{ :'data-role' => 'list-divider'} No parameters
30
+ - params.each do |key, value|
31
+ %li{ :'data-role' => 'list-divider'}=key
32
+ %li
33
+ %span{:style => 'font-weight:normal;'}=value.inspect
34
+
35
+
36
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
37
+ %h3 Request details
38
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
39
+ - request.env.each do |key, value|
40
+ %li{ :'data-role' => 'list-divider'}=key
41
+ %li
42
+ %span{:style => 'font-weight:normal;'}=value.inspect
@@ -0,0 +1,2 @@
1
+ %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
+ %message Method not allowed for this resource
@@ -0,0 +1,29 @@
1
+ %div{ :'data-role' => :content, :'data-theme' => 'b'}
2
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
+ %li{ :'data-role' => 'list-divider'} Server message
4
+ %li
5
+ %h3 Not Found
6
+ %li{ :'data-role' => 'list-divider'} Original request URI
7
+ %li
8
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
+ %span=request.env['REQUEST_URI']
10
+ %span{ :class => 'ui-li-count'} Retry
11
+
12
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
13
+ %h3 Parameters
14
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
15
+ - if params.keys.empty?
16
+ %li{ :'data-role' => 'list-divider'} No parameters
17
+ - params.each do |key, value|
18
+ %li{ :'data-role' => 'list-divider'}=key
19
+ %li
20
+ %span{:style => 'font-weight:normal;'}=value.inspect
21
+
22
+
23
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
24
+ %h3 Request details
25
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
26
+ - request.env.each do |key, value|
27
+ %li{ :'data-role' => 'list-divider'}=key
28
+ %li
29
+ %span{:style => 'font-weight:normal;'}=value.inspect
@@ -0,0 +1,2 @@
1
+ %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
+ %message Resource not found
@@ -0,0 +1,29 @@
1
+ %div{ :'data-role' => :content, :'data-theme' => 'b'}
2
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
+ %li{ :'data-role' => 'list-divider'} Server message
4
+ %li
5
+ %h3 Method not allowed on given resource
6
+ %li{ :'data-role' => 'list-divider'} Original request URI
7
+ %li
8
+ %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
+ %span=request.env['REQUEST_URI']
10
+ %span{ :class => 'ui-li-count'} Retry
11
+
12
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
13
+ %h3 Parameters
14
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
15
+ - if params.keys.empty?
16
+ %li{ :'data-role' => 'list-divider'} No parameters
17
+ - params.each do |key, value|
18
+ %li{ :'data-role' => 'list-divider'}=key
19
+ %li
20
+ %span{:style => 'font-weight:normal;'}=value.inspect
21
+
22
+
23
+ %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
24
+ %h3 Request details
25
+ %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
26
+ - request.env.each do |key, value|
27
+ %li{ :'data-role' => 'list-divider'}=key
28
+ %li
29
+ %span{:style => 'font-weight:normal;'}=value.inspect