deltacloud-core 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/NOTICE +1 -1
- data/Rakefile +63 -21
- data/bin/deltacloudd +10 -6
- data/config.ru +62 -6
- data/config/drivers/ec2.yaml +8 -0
- data/config/drivers/fgcp.yaml +13 -0
- data/deltacloud-core.gemspec +10 -2
- data/lib/cimi/collections.rb +58 -0
- data/lib/cimi/collections/address_templates.rb +49 -0
- data/lib/cimi/collections/addresses.rb +74 -0
- data/lib/cimi/collections/cloud_entry_point.rb +37 -0
- data/lib/{deltacloud/helpers/conversion_helper.rb → cimi/collections/entity_metadata.rb} +24 -16
- data/lib/cimi/collections/machine_admins.rb +74 -0
- data/lib/cimi/collections/machine_configurations.rb +49 -0
- data/lib/cimi/collections/machine_images.rb +50 -0
- data/lib/cimi/collections/machines.rb +157 -0
- data/lib/cimi/collections/network_configurations.rb +47 -0
- data/lib/cimi/collections/network_templates.rb +48 -0
- data/lib/cimi/collections/networks.rb +125 -0
- data/lib/cimi/collections/routing_group_templates.rb +47 -0
- data/lib/cimi/collections/routing_groups.rb +48 -0
- data/lib/cimi/collections/volume_configurations.rb +48 -0
- data/lib/cimi/collections/volume_images.rb +50 -0
- data/lib/cimi/collections/volumes.rb +80 -0
- data/lib/cimi/collections/vsp_configurations.rb +48 -0
- data/lib/cimi/collections/vsp_templates.rb +50 -0
- data/lib/cimi/collections/vsps.rb +108 -0
- data/lib/cimi/dependencies.rb +1 -0
- data/lib/cimi/helpers.rb +116 -0
- data/lib/cimi/helpers/cimi_helper.rb +6 -2
- data/lib/cimi/models.rb +72 -0
- data/lib/cimi/{model → models}/action.rb +1 -1
- data/lib/cimi/models/address.rb +72 -0
- data/lib/cimi/models/address_collection.rb +34 -0
- data/lib/cimi/models/address_template.rb +54 -0
- data/lib/cimi/models/address_template_collection.rb +34 -0
- data/lib/cimi/{model → models}/base.rb +2 -2
- data/lib/cimi/{model → models}/cloud_entry_point.rb +3 -5
- data/lib/cimi/{model → models}/entity_metadata.rb +7 -6
- data/lib/cimi/{model → models}/entity_metadata_collection.rb +2 -2
- data/lib/cimi/{model → models}/errors.rb +8 -0
- data/lib/cimi/{model → models}/machine.rb +10 -10
- data/lib/cimi/{model → models}/machine_admin.rb +1 -1
- data/lib/cimi/{model → models}/machine_admin_collection.rb +2 -2
- data/lib/cimi/{model → models}/machine_collection.rb +2 -2
- data/lib/cimi/{model → models}/machine_configuration.rb +9 -6
- data/lib/cimi/{model → models}/machine_configuration_collection.rb +2 -2
- data/lib/cimi/{model → models}/machine_image.rb +1 -1
- data/lib/cimi/{model → models}/machine_image_collection.rb +2 -2
- data/lib/cimi/{model → models}/machine_template.rb +0 -0
- data/lib/cimi/{model → models}/machine_template_collection.rb +2 -2
- data/lib/cimi/models/network.rb +109 -0
- data/lib/cimi/{model → models}/network_collection.rb +2 -2
- data/lib/cimi/{model → models}/network_configuration.rb +3 -4
- data/lib/cimi/{model → models}/network_configuration_collection.rb +2 -2
- data/lib/cimi/models/network_template.rb +36 -0
- data/lib/cimi/models/network_template_collection.rb +35 -0
- data/lib/cimi/models/routing_group.rb +34 -0
- data/lib/cimi/models/routing_group_collection.rb +34 -0
- data/lib/cimi/models/routing_group_template.rb +34 -0
- data/lib/cimi/models/routing_group_template_collection.rb +35 -0
- data/lib/cimi/{model → models}/schema.rb +0 -0
- data/lib/cimi/{model → models}/volume.rb +4 -4
- data/lib/cimi/{model → models}/volume_collection.rb +2 -2
- data/lib/cimi/{model → models}/volume_configuration.rb +1 -1
- data/lib/cimi/{model → models}/volume_configuration_collection.rb +2 -2
- data/lib/cimi/{model → models}/volume_image.rb +1 -1
- data/lib/cimi/{model → models}/volume_image_collection.rb +2 -2
- data/lib/cimi/{model → models}/volume_template.rb +0 -0
- data/lib/cimi/{model → models}/volume_template_collection.rb +2 -2
- data/lib/cimi/models/vsp.rb +102 -0
- data/lib/cimi/models/vsp_collection.rb +34 -0
- data/lib/cimi/models/vsp_configuration.rb +40 -0
- data/lib/cimi/models/vsp_configuration_collection.rb +34 -0
- data/lib/cimi/models/vsp_template.rb +34 -0
- data/lib/cimi/models/vsp_template_collection.rb +34 -0
- data/lib/cimi/server.rb +27 -549
- data/lib/deltacloud/api.rb +79 -0
- data/lib/deltacloud/collections.rb +54 -0
- data/lib/deltacloud/collections/addresses.rb +91 -0
- data/lib/deltacloud/collections/buckets.rb +273 -0
- data/lib/deltacloud/collections/drivers.rb +51 -0
- data/lib/deltacloud/collections/firewalls.rb +116 -0
- data/lib/deltacloud/collections/hardware_profiles.rb +29 -0
- data/lib/deltacloud/collections/images.rb +73 -0
- data/lib/deltacloud/collections/instance_states.rb +59 -0
- data/lib/deltacloud/collections/instances.rb +113 -0
- data/lib/deltacloud/collections/keys.rb +61 -0
- data/lib/deltacloud/collections/load_balancers.rb +102 -0
- data/lib/deltacloud/collections/metrics.rb +28 -0
- data/lib/deltacloud/collections/realms.rb +28 -0
- data/lib/deltacloud/collections/storage_snapshots.rb +51 -0
- data/lib/deltacloud/collections/storage_volumes.rb +99 -0
- data/lib/deltacloud/core_ext.rb +14 -6
- data/lib/deltacloud/core_ext/string.rb +17 -5
- data/lib/deltacloud/drivers.rb +6 -42
- data/lib/deltacloud/drivers/azure/azure_driver.rb +0 -4
- data/lib/deltacloud/{base_driver → drivers}/base_driver.rb +56 -18
- data/lib/deltacloud/drivers/condor/condor_driver.rb +1 -8
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +142 -33
- data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +2 -6
- data/lib/deltacloud/{base_driver → drivers}/exceptions.rb +25 -2
- data/lib/deltacloud/drivers/features.rb +154 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +387 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +1435 -0
- data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +8 -11
- data/lib/deltacloud/drivers/google/google_driver.rb +2 -5
- data/lib/deltacloud/drivers/mock/data/keys/test-key.yml +28 -0
- data/lib/deltacloud/drivers/mock/mock_client.rb +2 -2
- data/lib/deltacloud/drivers/mock/mock_driver.rb +58 -40
- data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +145 -0
- data/lib/deltacloud/drivers/opennebula/cloud_client.rb +107 -73
- data/lib/deltacloud/drivers/opennebula/occi_client.rb +285 -145
- data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +189 -126
- data/lib/deltacloud/drivers/openstack/openstack_driver.rb +427 -8
- data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +7 -9
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +48 -66
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb +44 -51
- data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +7 -8
- data/lib/deltacloud/drivers/sbc/sbc_client.rb +1 -1
- data/lib/deltacloud/drivers/sbc/sbc_driver.rb +3 -3
- data/lib/deltacloud/drivers/terremark/terremark_driver.rb +8 -8
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +39 -13
- data/lib/deltacloud/drivers/vsphere/vsphere_filemanager.rb +1 -0
- data/lib/deltacloud/helpers.rb +79 -7
- data/lib/{sinatra/lazy_auth.rb → deltacloud/helpers/auth_helper.rb} +5 -9
- data/lib/deltacloud/helpers/{blob_stream.rb → blob_stream_helper.rb} +7 -7
- data/lib/deltacloud/helpers/deltacloud_helper.rb +286 -0
- data/lib/deltacloud/helpers/driver_helper.rb +58 -0
- data/lib/deltacloud/helpers/rabbit_helper.rb +34 -0
- data/lib/{sinatra/url_for.rb → deltacloud/helpers/url_helper.rb} +31 -9
- data/lib/deltacloud/models.rb +19 -17
- data/lib/deltacloud/models/bucket.rb +4 -0
- data/lib/deltacloud/{hardware_profile.rb → models/hardware_profile.rb} +4 -2
- data/lib/deltacloud/models/image.rb +1 -0
- data/lib/deltacloud/models/instance.rb +4 -2
- data/lib/deltacloud/models/instance_address.rb +4 -0
- data/lib/deltacloud/models/key.rb +4 -0
- data/lib/deltacloud/models/metric.rb +40 -0
- data/lib/deltacloud/{state_machine.rb → models/state_machine.rb} +18 -1
- data/lib/deltacloud/server.rb +41 -1222
- data/lib/deltacloud_rack.rb +79 -0
- data/lib/{cimi/model/network_template.rb → ec2/helpers.rb} +7 -10
- data/lib/{deltacloud/backend_capability.rb → ec2/helpers/errors.rb} +24 -29
- data/lib/ec2/helpers/result.rb +31 -0
- data/lib/ec2/query_parser.rb +152 -0
- data/lib/ec2/server.rb +70 -0
- data/lib/{deltacloud.rb → sinatra.rb} +7 -12
- data/lib/sinatra/rack_accept.rb +13 -7
- data/lib/sinatra/rack_driver_select.rb +1 -1
- data/lib/sinatra/rack_matrix_params.rb +1 -3
- data/public/images/metric.png +0 -0
- data/public/javascripts/jquery.mobile-1.0.1.min.js +177 -0
- data/public/stylesheets/jquery.mobile-1.0.1.min.css +2 -0
- data/public/stylesheets/new.css +10 -0
- data/support/fedora/deltacloud-core.spec +1 -1
- data/tests/api/common.rb +1 -0
- data/tests/api/driver_test.rb +79 -0
- data/tests/api/library_test.rb +48 -0
- data/tests/cimi/features/step_definitions/common_steps.rb +2 -2
- data/tests/cimi/features/step_definitions/machines_steps.rb +5 -4
- data/tests/cimi/features/step_definitions/volumes_steps.rb +8 -8
- data/tests/cimi/features/support/env.rb +33 -11
- data/tests/common.rb +7 -8
- data/tests/drivers/ec2/api_test.rb +19 -0
- data/tests/drivers/ec2/common.rb +23 -0
- data/tests/drivers/ec2/drivers_test.rb +120 -0
- data/tests/drivers/ec2/hardware_profiles_test.rb +224 -0
- data/tests/drivers/ec2/images_test.rb +230 -0
- data/tests/drivers/ec2/instances_test.rb +356 -0
- data/tests/drivers/ec2/keys_test.rb +181 -0
- data/tests/drivers/ec2/realms_test.rb +146 -0
- data/tests/drivers/fgcp/api_test.rb +47 -0
- data/tests/drivers/fgcp/hardware_profiles_test.rb +54 -0
- data/tests/drivers/fgcp/realms_test.rb +42 -0
- data/tests/drivers/{rackspace → fgcp}/setup.rb +5 -6
- data/tests/drivers/google/api_test.rb +10 -26
- data/tests/drivers/google/buckets_test.rb +79 -95
- data/tests/drivers/google/common.rb +54 -0
- data/tests/drivers/mock/api_test.rb +4 -127
- data/tests/drivers/mock/buckets_test.rb +195 -0
- data/tests/drivers/mock/common.rb +7 -0
- data/tests/drivers/mock/drivers_test.rb +123 -0
- data/tests/drivers/mock/hardware_profiles_test.rb +190 -100
- data/tests/drivers/mock/images_test.rb +162 -103
- data/tests/drivers/mock/instances_test.rb +310 -220
- data/tests/drivers/mock/keys_test.rb +161 -0
- data/tests/drivers/mock/realms_test.rb +109 -70
- data/tests/drivers/mock/storage_snapshots_test.rb +114 -0
- data/tests/drivers/mock/storage_volumes_test.rb +122 -0
- data/tests/drivers/openstack/api_test.rb +8 -3
- data/tests/drivers/openstack/common.rb +21 -0
- data/tests/drivers/openstack/hardware_profiles_test.rb +20 -9
- data/tests/drivers/openstack/images_test.rb +11 -5
- data/tests/drivers/openstack/instances_test.rb +61 -16
- data/tests/drivers/openstack/realms_test.rb +11 -7
- data/tests/drivers/rackspace/api_test.rb +7 -2
- data/tests/drivers/rackspace/buckets_test.rb +7 -2
- data/tests/drivers/rackspace/common.rb +16 -0
- data/tests/drivers/rackspace/hardware_profiles_test.rb +7 -2
- data/tests/drivers/rackspace/images_test.rb +7 -2
- data/tests/drivers/rackspace/instances_test.rb +10 -5
- data/tests/drivers/rackspace/realms_test.rb +7 -2
- data/tests/drivers/rhevm/api_test.rb +12 -6
- data/tests/drivers/rhevm/{setup.rb → common.rb} +8 -1
- data/tests/drivers/rhevm/hardware_profiles_test.rb +7 -2
- data/tests/drivers/rhevm/images_test.rb +8 -2
- data/tests/drivers/rhevm/instances_test.rb +7 -2
- data/tests/drivers/rhevm/realms_test.rb +7 -2
- data/tests/minitest_common.rb +58 -0
- data/tests/minitest_common_api_test.rb +115 -0
- data/views/addresses/associate.html.haml +1 -1
- data/views/addresses/index.html.haml +1 -1
- data/views/addresses/show.html.haml +2 -3
- data/views/api/show.html.haml +22 -9
- data/views/api/show.xml.haml +8 -7
- data/views/blobs/show.xml.haml +7 -4
- data/views/buckets/new.html.haml +2 -2
- data/views/cimi/errors/401.xml.haml +1 -1
- data/views/error.html.haml +3 -3
- data/views/errors/400.html.haml +1 -1
- data/views/errors/400.xml.haml +1 -2
- data/views/errors/401.html.haml +8 -7
- data/views/errors/401.xml.haml +1 -1
- data/views/errors/404.xml.haml +1 -0
- data/views/errors/500.xml.haml +4 -2
- data/views/{cimi/errors/403.html.haml → errors/501.html.haml} +4 -2
- data/views/errors/501.xml.haml +1 -0
- data/views/errors/502.xml.haml +1 -7
- data/views/{cimi/errors/500.html.haml → errors/504.html.haml} +0 -0
- data/views/errors/504.xml.haml +1 -0
- data/views/firewalls/new.html.haml +2 -2
- data/views/firewalls/new_rule.html.haml +1 -1
- data/views/firewalls/show.html.haml +1 -1
- data/views/hardware_profiles/index.html.haml +3 -1
- data/views/hardware_profiles/index.xml.haml +2 -2
- data/views/hardware_profiles/show.html.haml +3 -3
- data/views/hardware_profiles/show.xml.haml +3 -3
- data/views/images/show.html.haml +5 -0
- data/views/images/show.xml.haml +6 -1
- data/views/instance_states/show.html.haml +1 -1
- data/views/instances/index.html.haml +1 -1
- data/views/instances/new.html.haml +54 -39
- data/views/instances/run_command.html.haml +24 -15
- data/views/instances/show.html.haml +7 -3
- data/views/instances/show.xml.haml +2 -2
- data/views/keys/show.xml.haml +1 -0
- data/views/layout.html.haml +5 -9
- data/views/load_balancers/show.html.haml +12 -6
- data/views/metrics/index.html.haml +13 -0
- data/views/metrics/index.xml.haml +5 -0
- data/views/metrics/show.html.haml +23 -0
- data/views/metrics/show.xml.haml +9 -0
- data/views/realms/show.xml.haml +2 -1
- data/views/root/index.html.haml +1 -1
- data/views/storage_snapshots/show.html.haml +1 -1
- data/views/storage_snapshots/show.xml.haml +1 -0
- data/views/storage_volumes/attach.html.haml +1 -2
- data/views/storage_volumes/index.html.haml +1 -1
- data/views/storage_volumes/new.html.haml +22 -16
- data/views/storage_volumes/show.html.haml +10 -4
- data/views/storage_volumes/show.xml.haml +3 -4
- metadata +547 -519
- data/DISCLAIMER +0 -8
- data/lib/cimi/model.rb +0 -52
- data/lib/cimi/model/network.rb +0 -69
- data/lib/deltacloud/base_driver.rb +0 -18
- data/lib/deltacloud/base_driver/features.rb +0 -262
- data/lib/deltacloud/base_driver/mock_driver.rb +0 -78
- data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +0 -186
- data/lib/deltacloud/drivers/rhevm/rhevm_client.rb +0 -521
- data/lib/deltacloud/helpers/application_helper.rb +0 -267
- data/lib/deltacloud/helpers/hardware_profiles_helper.rb +0 -50
- data/lib/deltacloud/helpers/json_helper.rb +0 -31
- data/lib/deltacloud/method_serializer.rb +0 -83
- data/lib/deltacloud/validation.rb +0 -107
- data/lib/sinatra/rabbit.rb +0 -441
- data/lib/sinatra/rack_runtime.rb +0 -47
- data/lib/sinatra/rack_syslog.rb +0 -86
- data/lib/sinatra/sinatra_verbose.rb +0 -73
- data/lib/sinatra/static_assets.rb +0 -99
- data/public/javascripts/jquery.mobile-1.0rc1.min.js +0 -170
- data/public/stylesheets/jquery.mobile-1.0rc1.min.css +0 -12
- data/tests/drivers/google/setup.rb +0 -38
- data/tests/drivers/mock/instance_states_test.rb +0 -71
- data/tests/drivers/mock/setup.rb +0 -3
- data/tests/drivers/mock/url_for_test.rb +0 -67
- data/tests/drivers/openstack/setup.rb +0 -20
- data/views/cimi/errors/400.html.haml +0 -41
- data/views/cimi/errors/401.html.haml +0 -41
- data/views/cimi/errors/404.html.haml +0 -29
- data/views/cimi/errors/405.html.haml +0 -29
- data/views/cimi/errors/502.html.haml +0 -43
- data/views/cimi/errors/backend_capability_failure.html.haml +0 -29
@@ -2,7 +2,7 @@
|
|
2
2
|
=subheader @address.id
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
5
|
-
%form{ :action =>
|
5
|
+
%form{ :action => "#{address_url(@address.id)}/associate", :method => :post}
|
6
6
|
%div{ 'data-role' => :fieldcontain }
|
7
7
|
%label{ :for => :name} Instance:
|
8
8
|
%select{:name => 'instance_id'}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=header "Addresses" do
|
2
|
-
%a{ :href => "#", :onclick => "create_address('#{
|
2
|
+
%a{ :href => "#", :onclick => "create_address('#{addresses_url}')", :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => "false", :method => :post} Create new address
|
3
3
|
=subheader "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}"
|
4
4
|
|
5
5
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
@@ -13,9 +13,8 @@
|
|
13
13
|
%li
|
14
14
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
15
15
|
- if @address.associated?
|
16
|
-
=
|
17
|
-
=link_to_action 'Disassociate', disassociate_address_url(@address.id), :post
|
16
|
+
=link_to_action 'Disassociate', "#{address_url(@address.id)}/disassociate", :post
|
18
17
|
- else
|
19
18
|
- if driver.respond_to?(:associate_address)
|
20
|
-
=link_to_action 'Associate',
|
19
|
+
=link_to_action 'Associate',"#{address_url(@address.id)}/associate", :get
|
21
20
|
=link_to_action "Destroy", destroy_address_url(@address.id), :delete
|
data/views/api/show.html.haml
CHANGED
@@ -3,18 +3,31 @@
|
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview, :'data-inset' => 'true'}
|
6
|
-
-
|
7
|
-
|
6
|
+
- Deltacloud.collections.each do |c|
|
7
|
+
- next unless c.operation(:index).has_capability?
|
8
|
+
%li
|
9
|
+
%a{ :href => api_url_for(c.collection_name), :'data-icon' => "arrow-r"}=c.collection_name.to_s.gsub('_', ' ').titlecase
|
8
10
|
|
9
|
-
|
11
|
+
|
12
|
+
- unless Deltacloud::Drivers.driver_config.nil?
|
13
|
+
%div{ :'data-role' => :footer, :'data-theme' => 'a'}
|
14
|
+
%form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
|
15
|
+
%fieldset{ :'data-type' => "horizontal", :'data-role' => "controlgroup", :id => "providers" }
|
16
|
+
%select{:name => 'driver', :'data-inline' => 'true', :'data-native-menu' => 'false'}
|
17
|
+
%option{ :value => "#{driver_symbol.to_s}"} #{driver_symbol.to_s}
|
18
|
+
- Deltacloud::Drivers.driver_config.keys.each do |driver|
|
19
|
+
%option{ :value => driver } #{driver}
|
20
|
+
%button{ :type => :submit, :'data-inline' => "true"} Change Driver
|
21
|
+
|
22
|
+
|
23
|
+
- unless driver.configured_providers.empty?
|
10
24
|
%div{ :'data-role' => :footer, :'data-theme' => 'a'}
|
11
25
|
%form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
|
12
26
|
- if @driver_name
|
13
|
-
%input{ :name => :driver, :type => :hidden, :value =>
|
14
|
-
%
|
15
|
-
%
|
16
|
-
%select{:name => 'provider', :'data-native-menu' => "true" }
|
27
|
+
%input{ :name => :driver, :type => :hidden, :value => driver.name }/
|
28
|
+
%fieldset{ :'data-type' => "horizontal", :'data-role' => "controlgroup", :id => "providers" }
|
29
|
+
%select{:name => 'provider', :'data-inline' => 'true', :'data-native-menu' => 'false'}
|
17
30
|
%option{ :value => 'default'} default
|
18
|
-
-
|
31
|
+
- driver.configured_providers.each do |provider|
|
19
32
|
%option{ :value => provider } #{provider}
|
20
|
-
%button{ :type => :submit} Change Provider
|
33
|
+
%button{ :type => :submit, :'data-inline' => "true"} Change Provider
|
data/views/api/show.xml.haml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
%api{ :version => settings.version, :driver => driver_symbol }
|
2
|
-
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
%api{ :version => settings.version, :driver => driver_symbol, :provider => Thread.current[:provider] || ENV['API_PROVIDER'] }
|
2
|
+
- Deltacloud.collections.each do |c|
|
3
|
+
- next unless c.operation(:index).has_capability?
|
4
|
+
%link{ :rel => c.collection_name, :href => self.send(:"#{c.collection_name}_url")}
|
5
|
+
- c.features.select { |f| driver.class.has_feature?(c.collection_name, f.name) }.each do |f|
|
6
|
+
%feature{ :name => f.name }
|
7
|
+
- driver.class.constraints(:collection => c.collection_name, :feature => f.name).each do |name, value|
|
8
|
+
%constraint{ :name => name }=value
|
data/views/blobs/show.xml.haml
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
!!! XML
|
2
2
|
%blob{:href => bucket_url(@blob.bucket) + '/' + @blob.id, :id => @blob.id}
|
3
|
+
%bucket=@blob.bucket
|
3
4
|
- @blob.attributes.select{ |attr| (attr!=:id && attr!=:user_metadata) }.each do |attribute|
|
5
|
+
- next if attribute == :bucket
|
4
6
|
- unless attribute == :content
|
5
7
|
- haml_tag(attribute, :<) do
|
6
8
|
- haml_concat @blob.send(attribute)
|
7
9
|
%user_metadata
|
8
|
-
- @blob.user_metadata.each
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
- if @blob.user_metadata.respond_to? :each
|
11
|
+
- @blob.user_metadata.each do |k, v|
|
12
|
+
%entry{:key => k}
|
13
|
+
#{cdata v}
|
14
|
+
%content{:href => bucket_url(@blob.bucket) + '/' + @blob.id + '/content', :rel => 'blob_content'}
|
data/views/buckets/new.html.haml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
=header "New bucket"
|
2
2
|
|
3
3
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
4
|
-
%form{ :action => buckets_url, :method => :post }
|
4
|
+
%form{ :action => buckets_url, :method => :post, :'data-ajax' => 'false' }
|
5
5
|
%label
|
6
6
|
Bucket Name:
|
7
7
|
%input{ :name => 'name', :size => 250}/
|
8
8
|
%br
|
9
|
-
-if
|
9
|
+
-if driver.class.has_feature?(:buckets, :bucket_location)
|
10
10
|
%p
|
11
11
|
%label
|
12
12
|
Location: (optional)
|
@@ -1,2 +1,2 @@
|
|
1
1
|
%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
|
2
|
-
%message
|
2
|
+
%message Authentication required
|
data/views/error.html.haml
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
%html
|
3
3
|
%head
|
4
4
|
%title Deltacloud API #{settings.version}
|
5
|
-
|
6
|
-
|
5
|
+
%link{ :charset => "utf-8", :href => "/stylesheets/jquery.mobile-1.0.1.min.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}
|
6
|
+
%link{ :charset => "utf-8", :href => "/stylesheets/new.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}
|
7
7
|
%script{:type => "text/javascript", :src => "/javascripts/jquery.min.js" }
|
8
8
|
%script{:type => "text/javascript", :src => "/javascripts/application.js" }
|
9
|
-
%script{:type => "text/javascript", :src => "/javascripts/jquery.mobile-1.
|
9
|
+
%script{:type => "text/javascript", :src => "/javascripts/jquery.mobile-1.0.1.min.js" }
|
10
10
|
:javascript
|
11
11
|
$(document).ready(function() {
|
12
12
|
$(document).bind("mobileinit", function(){
|
data/views/errors/400.html.haml
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
%h3 Backtrace
|
20
20
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
|
21
21
|
%li
|
22
|
-
%pre
|
22
|
+
%pre=(@error.backtrace.nil?) ? "n/a" : @error.backtrace.join("\n")
|
23
23
|
|
24
24
|
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
25
25
|
%h3 Parameters
|
data/views/errors/400.xml.haml
CHANGED
data/views/errors/401.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
|
5
|
+
%h3 Authentication Failure
|
6
6
|
%li{ :'data-role' => 'list-divider'} Original request URI
|
7
7
|
%li
|
8
8
|
%a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
|
@@ -15,11 +15,12 @@
|
|
15
15
|
- else
|
16
16
|
%em No details
|
17
17
|
|
18
|
-
|
19
|
-
%
|
20
|
-
|
21
|
-
%
|
22
|
-
%
|
18
|
+
- if @error.class.method_defined? :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")
|
23
24
|
|
24
25
|
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
25
26
|
%h3 Parameters
|
@@ -38,4 +39,4 @@
|
|
38
39
|
- request.env.each do |key, value|
|
39
40
|
%li{ :'data-role' => 'list-divider'}=key
|
40
41
|
%li
|
41
|
-
%span{:style => 'font-weight:normal;'}=value.
|
42
|
+
%span{:style => 'font-weight:normal;'}=value.to_s
|
data/views/errors/401.xml.haml
CHANGED
data/views/errors/404.xml.haml
CHANGED
data/views/errors/500.xml.haml
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
- unless defined?(partial)
|
2
|
+
!!! XML
|
1
3
|
%error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
|
2
4
|
%kind backend_error
|
3
5
|
%backend{ :driver => driver_symbol, :provider => "#{Thread::current[:provider] || ENV['API_PROVIDER'] || 'default'}" }
|
4
6
|
%code=response.status
|
5
7
|
%message< #{cdata @error.message}
|
6
|
-
- if @error.respond_to?
|
7
|
-
%backtrace=cdata
|
8
|
+
- if @error.respond_to?(:backtrace) and !@error.backtrace.nil?
|
9
|
+
%backtrace=cdata(@error.backtrace.join("\n"))
|
8
10
|
- if params
|
9
11
|
%request
|
10
12
|
- params.each do |k, v|
|
@@ -15,12 +15,12 @@
|
|
15
15
|
- else
|
16
16
|
%em No details
|
17
17
|
|
18
|
-
- if @error.backtrace
|
18
|
+
- if @error.class.method_defined? :backtrace
|
19
19
|
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
20
20
|
%h3 Backtrace
|
21
21
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
|
22
22
|
%li
|
23
|
-
%pre=@error.backtrace.join("\n")
|
23
|
+
%pre=@error.backtrace.join("\n") unless @error.backtrace.nil?
|
24
24
|
|
25
25
|
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
26
26
|
%h3 Parameters
|
@@ -28,6 +28,7 @@
|
|
28
28
|
- if params.keys.empty?
|
29
29
|
%li{ :'data-role' => 'list-divider'} No parameters
|
30
30
|
- params.each do |key, value|
|
31
|
+
- next if value.inspect.to_s == '#'
|
31
32
|
%li{ :'data-role' => 'list-divider'}=key
|
32
33
|
%li
|
33
34
|
%span{:style => 'font-weight:normal;'}=value.inspect
|
@@ -37,6 +38,7 @@
|
|
37
38
|
%h3 Request details
|
38
39
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
|
39
40
|
- request.env.each do |key, value|
|
41
|
+
- next if value.inspect.to_s == '#'
|
40
42
|
%li{ :'data-role' => 'list-divider'}=key
|
41
43
|
%li
|
42
44
|
%span{:style => 'font-weight:normal;'}=value.inspect
|
@@ -0,0 +1 @@
|
|
1
|
+
= haml :'errors/500', :locals => { :@error => @error, :partial => true }
|
data/views/errors/502.xml.haml
CHANGED
@@ -1,7 +1 @@
|
|
1
|
-
|
2
|
-
%kind backend_error
|
3
|
-
%backend{ :driver => driver_symbol }
|
4
|
-
%code= @error.code
|
5
|
-
- if @error.respond_to?(:details) && @error.details
|
6
|
-
%details< #{cdata @error.details.join("\n")}
|
7
|
-
%message< #{cdata @error.message}
|
1
|
+
= haml :'errors/500', :locals => { :@error => @error, :partial => true }
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
= haml :'errors/500', :locals => { :@error => @error, :partial => true }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
%h1 New Firewall
|
2
2
|
|
3
|
-
%form{:action => firewalls_url, :method => :post}
|
3
|
+
%form{:action => firewalls_url, :method => :post, :'data-ajax' => 'false'}
|
4
4
|
%label
|
5
5
|
Firewall Name
|
6
6
|
%input{:name => 'name', :size => 25}/
|
@@ -8,4 +8,4 @@
|
|
8
8
|
%label
|
9
9
|
Firewall Description
|
10
10
|
%input{:name => 'description', :size => 100}/
|
11
|
-
%input{:type => :submit, :name => "commit", :value=>"create"}
|
11
|
+
%input{:type => :submit, :name => "commit", :value=>"create"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=header "New firewall rule"
|
2
2
|
|
3
3
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog', :id => "new_rule_form"}
|
4
|
-
%form{ :action => "#{firewall_url(@firewall_name)}/rules", :method => :post}
|
4
|
+
%form{ :action => "#{firewall_url(@firewall_name)}/rules", :method => :post, :'data-ajax' => 'false'}
|
5
5
|
%div{ 'data-role' => :fieldcontain }
|
6
6
|
%label{ :for => :name} Protocol:
|
7
7
|
%input{ :type => :text, :id => :protocol, :name => :protocol, :value => '', :size => 10 }
|
@@ -39,4 +39,4 @@
|
|
39
39
|
%li{ :'data-role' => 'list-divider'} Actions
|
40
40
|
%li
|
41
41
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
42
|
-
=link_to_action "Delete", "#{firewall_url(@firewall.
|
42
|
+
=link_to_action "Delete", "#{firewall_url(@firewall.id)}/#{rule.id}", :delete
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview, :'data-inset' => :true }
|
6
|
-
- for profile in @
|
6
|
+
- for profile in order_hardware_profiles(@hardware_profiles)
|
7
7
|
%li{ :'data-theme' => 'c'}
|
8
8
|
%a{ :href => hardware_profile_url(profile.name)}
|
9
9
|
%img{ :class => 'ui-link-thumb', :src => '/images/profile.png'}
|
@@ -15,3 +15,5 @@
|
|
15
15
|
= format_hardware_property profile.memory
|
16
16
|
%strong Storage:
|
17
17
|
= format_hardware_property profile.storage
|
18
|
+
%strong CPU:
|
19
|
+
= format_hardware_property profile.cpu
|
@@ -1,4 +1,4 @@
|
|
1
1
|
!!! XML
|
2
2
|
%hardware_profiles
|
3
|
-
- @
|
4
|
-
= haml :'hardware_profiles/show', :locals => { :@
|
3
|
+
- order_hardware_profiles(@hardware_profiles).each do |prof|
|
4
|
+
= haml :'hardware_profiles/show', :locals => { :@hardware_profile => prof, :partial => true }
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=header "Hardware profiles"
|
2
|
-
=subheader @
|
2
|
+
=subheader @hardware_profile.name
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
|
6
6
|
%li{ :'data-role' => 'list-divider'} Name
|
7
7
|
%li
|
8
|
-
%p{ :'data-role' => 'fieldcontain'}=@
|
9
|
-
- @
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=@hardware_profile.name
|
9
|
+
- @hardware_profile.each_property do |p|
|
10
10
|
%li{ :'data-role' => 'list-divider'} #{p.name.to_s.titlecase}
|
11
11
|
%li
|
12
12
|
%p{ :'data-role' => 'fieldcontain'}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
|
-
%hardware_profile{ :href => hardware_profile_url(@
|
3
|
+
%hardware_profile{ :href => hardware_profile_url(@hardware_profile.name), :id => @hardware_profile.name }
|
4
4
|
%name<
|
5
|
-
|
6
|
-
- @
|
5
|
+
= @hardware_profile.name
|
6
|
+
- @hardware_profile.each_property do |prop|
|
7
7
|
- attr = { :name => prop.name, :kind => prop.kind, :unit => prop.unit }
|
8
8
|
- if prop.kind == :fixed
|
9
9
|
%property{ attr, :value => prop.value }/
|
data/views/images/show.html.haml
CHANGED
@@ -20,6 +20,11 @@
|
|
20
20
|
%li{ :'data-role' => 'list-divider'} Architecture
|
21
21
|
%li
|
22
22
|
%p{ :'data-role' => 'fieldcontain'}=@image.architecture
|
23
|
+
%li{ :'data-role' => 'list-divider'} Hardware Profiles
|
24
|
+
%li
|
25
|
+
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
26
|
+
- @image.hardware_profiles.each do |hwp|
|
27
|
+
%a{ :href => api_url_for("hardware_profiles/#{hwp.name}"), :'data-role' => "button", :'data-ajax' => 'false'} #{hwp.name}
|
23
28
|
%li{ :'data-role' => 'list-divider'} Actions
|
24
29
|
%li
|
25
30
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
data/views/images/show.xml.haml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
3
|
%image{:href => image_url(@image.id), :id => @image.id}
|
4
|
-
- @image.attributes.select{ |attr|
|
4
|
+
- @image.attributes.select{ |attr| ![:id, :hardware_profiles].include?(attr) }.each do |attribute|
|
5
5
|
- haml_tag(attribute, :<) do
|
6
6
|
- haml_concat @image.send(attribute)
|
7
|
+
- if @image.hardware_profiles
|
8
|
+
%hardware_profiles
|
9
|
+
- @image.hardware_profiles.each do |profile|
|
10
|
+
%hardware_profile{ :href => hardware_profile_url(profile.name), :id => profile.name, :rel => :hardware_profile }
|
7
11
|
%actions
|
8
12
|
%link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{@image.id}"}
|
13
|
+
%link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(@image.id)}" }
|
@@ -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
|
-
|
5
|
+
%img{ :src => api_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|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
%li
|
9
9
|
%a{ :href => instance_url(instance.id), :'data-ajax' => 'false'}
|
10
10
|
%img{ :class => 'ui-link-thumb', :src => '/images/machine.png'}
|
11
|
-
%h3=
|
11
|
+
%h3=instance.id.to_s.truncate
|
12
12
|
%p
|
13
13
|
%strong=instance.name
|
14
14
|
%p=[instance.owner_id, instance.image_id, instance.hardware_profile].join(', ')
|
@@ -18,56 +18,71 @@
|
|
18
18
|
%input{ :name => prop.param, :size => 10, :value => "#{prop.default}" }= prop.unit
|
19
19
|
|
20
20
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
21
|
-
%form{ :action => instances_url, :method => :post, :class => :new_instance, :'data-ajax' => 'false'}
|
21
|
+
%form{ :action => instances_url, :method => :post, :class => :new_instance, :enctype => 'multipart/form-data', :'data-ajax' => 'false'}
|
22
22
|
%input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
|
23
23
|
|
24
|
-
- if
|
24
|
+
- if driver.class.has_feature?(:instances, :user_name)
|
25
25
|
%div{ 'data-role' => :fieldcontain }
|
26
26
|
%label{ :for => :name} Instance name:
|
27
27
|
%input{ :type => :text, :id => :name, :name => :name, :value => '' }
|
28
28
|
|
29
|
-
|
30
|
-
%
|
29
|
+
- if additional_features_for?(:instances, [:user_name])
|
30
|
+
%div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
|
31
|
+
%h3 Additional parameters
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
- if driver.class.has_feature?(:instances, :user_data)
|
34
|
+
%div{ 'data-role' => :fieldcontain }
|
35
|
+
%label{ :for => :user_data} Base64 encoded user-data:
|
36
|
+
%textarea{ :id => :user_data, :name => :user_data, :value => '' }
|
37
|
+
%br/
|
38
|
+
%a{ :href => "", :onclick => 'encodeb64();', :'data-ajax' => 'false'} Encode data
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
- if driver.class.has_feature?(:instances, :instance_count)
|
41
|
+
%div{ 'data-role' => :fieldcontain }
|
42
|
+
%label{ :for => :instance_count} # of instances to be launched:
|
43
|
+
%input{ :type => :text, :id => :instance_count, :name => :instance_count, :value => '1' }
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
%option{ :value => ''} None
|
49
|
-
- @keys.each do |key|
|
50
|
-
%option{ :value => key.id } #{key.id}
|
45
|
+
- if driver.class.has_feature?(:instances, :metrics)
|
46
|
+
%div{ 'data-role' => :fieldcontain }
|
47
|
+
%label{ :for => :metrics} Enable metrics for this instance
|
48
|
+
%input{ :type => :checkbox, :id => :metrics, :name => :metrics, :checked => 'false' }
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
- if driver.class.has_feature?(:instances, :authentication_key)
|
51
|
+
%div{ 'data-role' => :fieldcontain }
|
52
|
+
%label{ :for => :keyname, :class => 'ui-input-text'} Instance SSH key:
|
53
|
+
%select{:name => 'keyname', :'data-native-menu' => "true" }
|
54
|
+
%option{ :value => ''} None
|
55
|
+
- @keys.each do |key|
|
56
|
+
%option{ :value => key.id } #{key.id}
|
59
57
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
%
|
64
|
-
|
65
|
-
-
|
66
|
-
%
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
58
|
+
- if driver.class.has_feature?(:instances, :register_to_load_balancer)
|
59
|
+
%div{ 'data-role' => :fieldcontain }
|
60
|
+
%label{ :for => :load_balancer_id, :class => 'ui-input-text'} Register to loadbalancer:
|
61
|
+
%select{:name => 'load_balancer_id', :'data-native-menu' => "true" }
|
62
|
+
%option{ :value => ''} None
|
63
|
+
- @load_balancers.each do |load_balancer|
|
64
|
+
%option{:value => load_balancer.id} #{load_balancer.id}
|
65
|
+
|
66
|
+
- if driver.class.has_feature?(:instances, :firewalls)
|
67
|
+
%div{ 'data-role' => :fieldcontain }
|
68
|
+
%fieldset{ :'data-role' => 'controlgroup'}
|
69
|
+
%legend Register to firewall:
|
70
|
+
- @firewalls.each_index do |i|
|
71
|
+
- if @firewalls[i].name == 'default'
|
72
|
+
%input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :checked => :true, :id => "firewalls#{i}"}/
|
73
|
+
%label{:for => "firewalls#{i}"} Default
|
74
|
+
- else
|
75
|
+
%input{:type => :checkbox, :value => @firewalls[i].name, :name => "firewalls#{i}", :id => "firewalls#{i}"}/
|
76
|
+
%label{:for => "firewalls#{i}"}=@firewalls[i].name
|
77
|
+
|
78
|
+
- if driver.class.has_feature?(:instances, :user_files)
|
79
|
+
%div{ 'data-role' => :fieldcontain }
|
80
|
+
%h3 Make user data file(s) available in launched Instance
|
81
|
+
%h4 The path specified for each file below is where the data will be made available on the launched Instance.
|
82
|
+
- for i in 1..5
|
83
|
+
%h4 User file #{i}
|
84
|
+
%input{ :type => :text, :id => "path#{i}", :name => "path#{i}", :value => ""} Path #{i}
|
85
|
+
%input{ :type => "file", :name => "content#{i}", :size => 50 }
|
71
86
|
|
72
87
|
- if !@hardware_profiles.empty?
|
73
88
|
%div{ 'data-role' => :fieldcontain }
|