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.
- data/LICENSE +23 -0
- data/NOTICE +3 -0
- data/Rakefile +32 -20
- data/bin/deltacloudd +1 -1
- data/config.ru +25 -32
- data/deltacloud-core.gemspec +1 -1
- data/lib/cimi/collections.rb +4 -1
- data/lib/cimi/collections/address_templates.rb +2 -2
- data/lib/cimi/collections/addresses.rb +1 -1
- data/lib/cimi/collections/base.rb +64 -0
- data/lib/cimi/collections/{machine_admins.rb → credentials.rb} +12 -12
- data/lib/cimi/collections/{vsp_templates.rb → forwarding_group_templates.rb} +12 -16
- data/lib/cimi/collections/{vsp_configurations.rb → forwarding_groups.rb} +12 -13
- data/lib/cimi/collections/machine_configurations.rb +2 -2
- data/lib/cimi/collections/machine_images.rb +1 -1
- data/lib/cimi/collections/machines.rb +8 -2
- data/lib/cimi/collections/network_configurations.rb +2 -2
- data/lib/cimi/collections/{routing_groups.rb → network_port_configurations.rb} +12 -12
- data/lib/cimi/collections/{routing_group_templates.rb → network_port_templates.rb} +15 -12
- data/lib/cimi/collections/{vsps.rb → network_ports.rb} +33 -32
- data/lib/cimi/collections/network_templates.rb +2 -2
- data/lib/cimi/collections/networks.rb +17 -2
- data/lib/cimi/collections/{entity_metadata.rb → resource_metadata.rb} +10 -10
- data/lib/cimi/collections/volume_configurations.rb +1 -1
- data/lib/cimi/collections/volume_images.rb +1 -1
- data/lib/cimi/collections/volumes.rb +1 -2
- data/lib/cimi/dependencies.rb +1 -1
- data/lib/cimi/helpers.rb +3 -84
- data/lib/cimi/helpers/cimi_helper.rb +15 -14
- data/lib/cimi/models.rb +20 -36
- data/lib/cimi/models/address.rb +32 -4
- data/lib/cimi/models/address_template.rb +2 -2
- data/lib/cimi/models/base.rb +24 -5
- data/lib/cimi/models/cloud_entry_point.rb +4 -9
- data/lib/cimi/models/collection.rb +101 -0
- data/lib/cimi/models/{machine_admin.rb → credential.rb} +6 -4
- data/lib/cimi/models/disk_collection.rb +1 -2
- data/lib/cimi/models/{routing_group_template.rb → forwarding_group.rb} +5 -3
- data/lib/cimi/models/{routing_group.rb → forwarding_group_template.rb} +5 -3
- data/lib/cimi/models/machine.rb +9 -7
- data/lib/cimi/models/machine_configuration.rb +2 -0
- data/lib/cimi/models/machine_image.rb +2 -0
- data/lib/cimi/models/machine_template.rb +3 -1
- data/lib/cimi/models/machine_volume_collection.rb +1 -1
- data/lib/cimi/models/network.rb +2 -0
- data/lib/cimi/models/network_configuration.rb +4 -8
- data/lib/cimi/models/{vsp.rb → network_port.rb} +7 -11
- data/lib/cimi/models/{network_configuration_collection.rb → network_port_collection.rb} +25 -8
- data/lib/cimi/models/{vsp_configuration.rb → network_port_configuration.rb} +6 -10
- data/lib/cimi/models/{network_collection.rb → network_port_configuration_collection.rb} +9 -9
- data/lib/cimi/models/{vsp_template.rb → network_port_template.rb} +6 -4
- data/lib/cimi/models/{network_template_collection.rb → network_port_template_collection.rb} +10 -8
- data/lib/cimi/models/network_template.rb +3 -1
- data/lib/cimi/models/{entity_metadata.rb → resource_metadata.rb} +16 -15
- data/lib/cimi/models/schema.rb +23 -12
- data/lib/cimi/models/volume.rb +2 -0
- data/lib/cimi/models/volume_configuration.rb +2 -0
- data/lib/cimi/models/volume_image.rb +2 -0
- data/lib/cimi/models/volume_template.rb +2 -0
- data/lib/cimi/server.rb +10 -6
- data/lib/deltacloud/collections.rb +7 -2
- data/lib/deltacloud/collections/addresses.rb +3 -1
- data/lib/deltacloud/collections/base.rb +64 -0
- data/lib/deltacloud/collections/buckets.rb +14 -4
- data/lib/deltacloud/collections/drivers.rb +1 -1
- data/lib/deltacloud/collections/firewalls.rb +1 -1
- data/lib/deltacloud/collections/instances.rb +5 -1
- data/lib/deltacloud/collections/keys.rb +1 -1
- data/lib/deltacloud/collections/load_balancers.rb +2 -0
- data/lib/deltacloud/collections/storage_volumes.rb +3 -5
- data/lib/deltacloud/core_ext.rb +1 -0
- data/lib/deltacloud/core_ext/hash.rb +8 -0
- data/lib/deltacloud/core_ext/ordered_hash.rb +222 -0
- data/lib/deltacloud/core_ext/string.rb +9 -0
- data/lib/deltacloud/drivers/aruba/aruba_driver.rb +0 -9
- data/lib/deltacloud/drivers/base_driver.rb +22 -4
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +0 -4
- data/lib/deltacloud/drivers/exceptions.rb +30 -13
- data/lib/deltacloud/drivers/features.rb +7 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +1 -9
- data/lib/deltacloud/drivers/google/google_driver.rb +13 -0
- data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.1.yml +3 -0
- data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.2.yml +3 -0
- data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.3.yml +3 -0
- data/lib/deltacloud/drivers/mock/data/addresses/192.168.0.4.yml +3 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +65 -1
- data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +55 -32
- data/lib/deltacloud/drivers/openstack/openstack_driver.rb +18 -6
- data/lib/deltacloud/helpers.rb +0 -75
- data/lib/deltacloud/helpers/deltacloud_helper.rb +66 -28
- data/lib/deltacloud/helpers/driver_helper.rb +7 -0
- data/lib/deltacloud/helpers/rabbit_helper.rb +51 -0
- data/lib/deltacloud/server.rb +12 -14
- data/lib/deltacloud/version.rb +1 -1
- data/lib/deltacloud_rack.rb +26 -2
- data/lib/ec2/query_parser.rb +18 -3
- data/lib/sinatra/rack_accept.rb +7 -2
- data/lib/sinatra/rack_matrix_params.rb +14 -14
- data/public/javascripts/cmwgapp.js +2 -2
- data/tests/cimi/collections/cloud_entry_point_test.rb +3 -3
- data/tests/cimi/collections/machine_images_test.rb +2 -2
- data/tests/cimi/collections/machines_test.rb +1 -1
- data/tests/cimi/collections/url_helper_test.rb +31 -0
- data/tests/cimi/spec/cimi/model/{machine_admin_spec.rb → credential_spec.rb} +4 -4
- data/tests/deltacloud/base_collection_test.rb +0 -5
- data/tests/deltacloud/collections/buckets_collection_test.rb +1 -1
- data/tests/deltacloud/collections/drivers_collection_test.rb +1 -1
- data/tests/deltacloud/collections/hardware_profiles_collection_test.rb +1 -1
- data/tests/deltacloud/collections/images_collection_test.rb +1 -1
- data/tests/deltacloud/collections/instance_states_collection_test.rb +1 -1
- data/tests/deltacloud/collections/instances_collection_test.rb +1 -1
- data/tests/deltacloud/collections/keys_collection_test.rb +1 -4
- data/tests/deltacloud/deltacloud_helper_test.rb +0 -9
- data/tests/deltacloud/server_test.rb +1 -1
- data/tests/drivers/base/base_driver_test.rb +30 -0
- data/tests/drivers/base/common.rb +14 -0
- data/tests/drivers/base/exceptions_test.rb +64 -0
- data/tests/drivers/ec2/buckets_test.rb +45 -0
- data/tests/drivers/ec2/keys_test.rb +1 -1
- data/tests/drivers/google/buckets_test.rb +2 -2
- data/tests/drivers/google/common.rb +3 -3
- data/tests/test_helper.rb +28 -0
- data/views/api/show.html.haml +2 -2
- data/views/api/show.xml.haml +1 -1
- data/views/buckets/index.html.haml +1 -1
- data/views/cimi/cloudEntryPoint/index.xml.haml +1 -1
- data/views/cimi/collection/index.html.haml +3 -3
- data/views/cimi/collection/response.xml.haml +1 -1
- data/views/cimi/error.html.haml +1 -1
- data/views/cimi/errors/500.xml.haml +1 -1
- data/views/cimi/layout.html.haml +1 -1
- data/views/cimi/machine_configurations/show.html.haml +2 -2
- data/views/cimi/machine_configurations/show.xml.haml +1 -1
- data/views/cimi/machine_images/show.html.haml +2 -2
- data/views/cimi/machine_images/show.xml.haml +1 -1
- data/views/cimi/machines/show.html.haml +2 -2
- data/views/cimi/machines/show.xml.haml +1 -1
- data/views/cimi/volumes/show.html.haml +2 -2
- data/views/cimi/volumes/show.xml.haml +1 -1
- data/views/docs/collection.html.haml +1 -1
- data/views/docs/collection.xml.haml +2 -2
- data/views/docs/index.html.haml +1 -1
- data/views/docs/index.xml.haml +1 -1
- data/views/docs/operation.xml.haml +1 -1
- data/views/error.html.haml +1 -1
- data/views/errors/500.html.haml +7 -4
- data/views/firewalls/index.html.haml +1 -1
- data/views/firewalls/show.html.haml +1 -1
- data/views/images/show.html.haml +2 -2
- data/views/index.html.haml +9 -0
- data/views/instance_states/show.html.haml +1 -1
- data/views/instances/run_command.html.haml +1 -1
- data/views/instances/show.html.haml +2 -2
- data/views/keys/index.html.haml +1 -1
- data/views/layout.html.haml +1 -1
- data/views/load_balancers/index.html.haml +1 -1
- data/views/load_balancers/show.html.haml +3 -3
- data/views/storage_snapshots/show.html.haml +1 -1
- data/views/storage_volumes/attach.html.haml +1 -1
- data/views/storage_volumes/index.html.haml +1 -1
- data/views/storage_volumes/show.html.haml +4 -4
- metadata +40 -43
- data/lib/cimi/models/address_collection.rb +0 -34
- data/lib/cimi/models/address_template_collection.rb +0 -34
- data/lib/cimi/models/entity_metadata_collection.rb +0 -31
- data/lib/cimi/models/machine_admin_collection.rb +0 -34
- data/lib/cimi/models/machine_collection.rb +0 -37
- data/lib/cimi/models/machine_configuration_collection.rb +0 -36
- data/lib/cimi/models/machine_image_collection.rb +0 -36
- data/lib/cimi/models/machine_template_collection.rb +0 -36
- data/lib/cimi/models/routing_group_collection.rb +0 -34
- data/lib/cimi/models/routing_group_template_collection.rb +0 -35
- data/lib/cimi/models/volume_collection.rb +0 -36
- data/lib/cimi/models/volume_configuration_collection.rb +0 -36
- data/lib/cimi/models/volume_image_collection.rb +0 -36
- data/lib/cimi/models/volume_template_collection.rb +0 -36
- data/lib/cimi/models/vsp_collection.rb +0 -34
- data/lib/cimi/models/vsp_configuration_collection.rb +0 -34
- data/lib/cimi/models/vsp_template_collection.rb +0 -34
- data/lib/deltacloud/helpers/url_helper.rb +0 -115
@@ -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 '
|
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
|
-
{"
|
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 => '
|
8
|
-
:password => '
|
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 => :
|
19
|
+
c.default_cassette_options = { :record => :new_episodes }
|
20
20
|
end
|
data/tests/test_helper.rb
CHANGED
@@ -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
|
data/views/api/show.html.haml
CHANGED
@@ -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
|
-
-
|
6
|
+
- @collections.each do |c|
|
7
7
|
%li
|
8
|
-
%a{ :href =>
|
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?
|
data/views/api/show.xml.haml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
%api{ :version => settings.version, :driver => driver_symbol, :provider => Thread.current[:provider] || ENV['API_PROVIDER'] }
|
2
|
-
-
|
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 =>
|
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'}
|
@@ -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 =>
|
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 + ": " +
|
31
|
+
= operation["rel"].capitalize + ": " + 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"]
|
data/views/cimi/error.html.haml
CHANGED
data/views/cimi/layout.html.haml
CHANGED
@@ -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://
|
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://
|
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://
|
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://
|
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 =>
|
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 =>
|
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 =>
|
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}"}
|
data/views/docs/index.html.haml
CHANGED
@@ -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 =>
|
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
|
|
data/views/docs/index.xml.haml
CHANGED
@@ -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 =>
|
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 =>
|
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}"}
|
data/views/error.html.haml
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
%div{ 'data-role' => :navbar}
|
27
27
|
%ul
|
28
28
|
%li
|
29
|
-
%a{ :'data-icon' => 'home', :href =>
|
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' }
|
data/views/errors/500.html.haml
CHANGED
@@ -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
|
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 =>
|
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 =>
|
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|
|
data/views/images/show.html.haml
CHANGED
@@ -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 =>
|
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 =>
|
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
|
@@ -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 =>
|
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 =>
|
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',
|
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',
|
64
|
+
=link_to_action 'Create Image', url_for("images/new?instance_id=#{@instance.id}"), :get
|
data/views/keys/index.html.haml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=header "Keys" do
|
2
|
-
%a{ :href =>
|
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'}
|
data/views/layout.html.haml
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
%div{ 'data-role' => :navbar}
|
19
19
|
%ul
|
20
20
|
%li
|
21
|
-
%a{ :'data-icon' => 'home', :href => "#{
|
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' }
|