deltacloud-core 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/deltacloud-core.gemspec +4 -7
- data/lib/cimi/collections/address_templates.rb +4 -42
- data/lib/cimi/collections/addresses.rb +5 -43
- data/lib/cimi/collections/base.rb +11 -3
- data/lib/cimi/collections/cloud_entry_point.rb +1 -1
- data/lib/cimi/collections/credentials.rb +4 -43
- data/lib/cimi/collections/forwarding_group_templates.rb +2 -20
- data/lib/cimi/collections/forwarding_groups.rb +2 -21
- data/lib/cimi/collections/machine_configurations.rb +2 -20
- data/lib/cimi/collections/machine_images.rb +4 -42
- data/lib/cimi/collections/machine_templates.rb +4 -42
- data/lib/cimi/collections/machines.rb +14 -64
- data/lib/cimi/collections/network_configurations.rb +2 -20
- data/lib/cimi/collections/network_port_configurations.rb +2 -21
- data/lib/cimi/collections/network_port_templates.rb +2 -23
- data/lib/cimi/collections/network_ports.rb +6 -46
- data/lib/cimi/collections/network_templates.rb +2 -21
- data/lib/cimi/collections/networks.rb +4 -40
- data/lib/cimi/collections/resource_metadata.rb +2 -21
- data/lib/cimi/collections/system_templates.rb +4 -45
- data/lib/cimi/collections/systems.rb +65 -82
- data/lib/cimi/collections/volume_configurations.rb +4 -45
- data/lib/cimi/collections/volume_images.rb +4 -42
- data/lib/cimi/collections/volume_templates.rb +5 -44
- data/lib/cimi/collections/volumes.rb +4 -48
- data/lib/cimi/helpers.rb +1 -0
- data/lib/cimi/helpers/cimi_helper.rb +1 -1
- data/lib/cimi/helpers/cimi_rabbit_helper.rb +113 -0
- data/lib/cimi/helpers/database_helper.rb +1 -2
- data/lib/cimi/models.rb +12 -11
- data/lib/cimi/models/action.rb +0 -4
- data/lib/cimi/models/address.rb +0 -38
- data/lib/cimi/models/address_create.rb +0 -31
- data/lib/cimi/models/address_template.rb +0 -47
- data/lib/cimi/models/address_template_create.rb +0 -16
- data/lib/cimi/models/base.rb +2 -74
- data/lib/cimi/models/cloud_entry_point.rb +2 -30
- data/lib/cimi/models/collection.rb +8 -25
- data/lib/cimi/models/credential.rb +0 -34
- data/lib/cimi/models/credential_create.rb +0 -26
- data/lib/cimi/models/credential_template.rb +0 -2
- data/lib/cimi/models/disk.rb +0 -56
- data/lib/cimi/models/forwarding_group.rb +0 -8
- data/lib/cimi/models/forwarding_group_template.rb +0 -8
- data/lib/cimi/models/machine.rb +4 -129
- data/lib/cimi/models/machine_configuration.rb +0 -31
- data/lib/cimi/models/machine_create.rb +1 -29
- data/lib/cimi/models/machine_image.rb +0 -28
- data/lib/cimi/models/machine_image_create.rb +0 -19
- data/lib/cimi/models/machine_template.rb +5 -39
- data/lib/cimi/models/machine_template_create.rb +0 -12
- data/lib/cimi/models/machine_volume.rb +0 -65
- data/lib/cimi/models/network.rb +0 -32
- data/lib/cimi/models/network_configuration.rb +0 -15
- data/lib/cimi/models/network_create.rb +0 -23
- data/lib/cimi/models/network_port.rb +0 -73
- data/lib/cimi/models/network_port_configuration.rb +0 -8
- data/lib/cimi/models/network_port_template.rb +0 -8
- data/lib/cimi/models/network_template.rb +2 -12
- data/lib/cimi/models/resource.rb +0 -6
- data/lib/cimi/models/resource_metadata.rb +1 -95
- data/lib/cimi/models/schema.rb +28 -32
- data/lib/cimi/models/system.rb +15 -39
- data/lib/cimi/models/system_address.rb +26 -0
- data/lib/cimi/models/system_create.rb +20 -0
- data/lib/cimi/models/system_credential.rb +26 -0
- data/lib/cimi/models/system_forwarding_group.rb +26 -0
- data/lib/cimi/models/system_machine.rb +26 -0
- data/lib/cimi/models/system_network.rb +26 -0
- data/lib/cimi/models/system_network_port.rb +26 -0
- data/lib/cimi/models/system_system.rb +26 -0
- data/lib/cimi/models/system_template.rb +15 -31
- data/lib/cimi/models/system_volume.rb +26 -0
- data/lib/cimi/models/volume.rb +0 -59
- data/lib/cimi/models/volume_configuration.rb +1 -64
- data/lib/cimi/models/volume_configuration_create.rb +22 -0
- data/lib/cimi/models/volume_create.rb +0 -38
- data/lib/cimi/models/volume_image.rb +0 -30
- data/lib/cimi/models/volume_image_create.rb +0 -25
- data/lib/cimi/models/volume_template.rb +2 -43
- data/lib/cimi/models/volume_template_create.rb +0 -12
- data/lib/cimi/service.rb +82 -0
- data/lib/cimi/service/action.rb +21 -0
- data/lib/cimi/service/address.rb +56 -0
- data/lib/cimi/service/address_create.rb +45 -0
- data/lib/cimi/service/address_template.rb +71 -0
- data/lib/cimi/service/address_template_create.rb +34 -0
- data/lib/cimi/service/base.rb +266 -0
- data/lib/cimi/service/cloud_entry_point.rb +53 -0
- data/lib/cimi/service/credential.rb +52 -0
- data/lib/cimi/service/credential_create.rb +38 -0
- data/lib/cimi/service/credential_template.rb +20 -0
- data/lib/cimi/service/disk.rb +75 -0
- data/lib/cimi/service/forwarding_group.rb +26 -0
- data/lib/cimi/service/forwarding_group_template.rb +26 -0
- data/lib/cimi/service/machine.rb +154 -0
- data/lib/cimi/service/machine_configuration.rb +54 -0
- data/lib/cimi/service/machine_create.rb +49 -0
- data/lib/cimi/service/machine_image.rb +47 -0
- data/lib/cimi/service/machine_image_create.rb +35 -0
- data/lib/cimi/service/machine_template.rb +61 -0
- data/lib/cimi/service/machine_template_create.rb +29 -0
- data/lib/cimi/service/machine_volume.rb +74 -0
- data/lib/cimi/service/network.rb +51 -0
- data/lib/cimi/service/network_configuration.rb +36 -0
- data/lib/cimi/service/network_create.rb +39 -0
- data/lib/cimi/service/network_port.rb +97 -0
- data/lib/cimi/service/network_port_configuration.rb +26 -0
- data/lib/cimi/service/network_port_template.rb +26 -0
- data/lib/cimi/service/network_template.rb +28 -0
- data/lib/cimi/service/resource_metadata.rb +44 -0
- data/lib/cimi/service/system.rb +45 -0
- data/lib/cimi/service/system_address.rb +34 -0
- data/lib/cimi/service/system_create.rb +39 -0
- data/lib/cimi/service/system_credential.rb +34 -0
- data/lib/cimi/service/system_forwarding_group.rb +34 -0
- data/lib/cimi/service/system_machine.rb +34 -0
- data/lib/cimi/service/system_network.rb +34 -0
- data/lib/cimi/service/system_network_port.rb +34 -0
- data/lib/cimi/service/system_system.rb +34 -0
- data/lib/cimi/service/system_template.rb +32 -0
- data/lib/cimi/service/system_volume.rb +34 -0
- data/lib/cimi/service/volume.rb +81 -0
- data/lib/cimi/service/volume_configuration.rb +92 -0
- data/lib/cimi/service/volume_configuration_create.rb +29 -0
- data/lib/cimi/service/volume_create.rb +47 -0
- data/lib/cimi/service/volume_image.rb +44 -0
- data/lib/cimi/service/volume_image_create.rb +42 -0
- data/lib/cimi/service/volume_template.rb +61 -0
- data/lib/cimi/service/volume_template_create.rb +29 -0
- data/lib/db/entity.rb +16 -1
- data/lib/deltacloud/collections/addresses.rb +2 -2
- data/lib/deltacloud/collections/buckets.rb +16 -18
- data/lib/deltacloud/collections/drivers.rb +4 -4
- data/lib/deltacloud/collections/firewalls.rb +5 -5
- data/lib/deltacloud/collections/images.rb +3 -3
- data/lib/deltacloud/collections/instance_states.rb +4 -4
- data/lib/deltacloud/collections/instances.rb +22 -13
- data/lib/deltacloud/collections/keys.rb +2 -2
- data/lib/deltacloud/collections/load_balancers.rb +16 -13
- data/lib/deltacloud/collections/storage_snapshots.rb +3 -3
- data/lib/deltacloud/collections/storage_volumes.rb +5 -5
- data/lib/deltacloud/core_ext/ordered_hash.rb +0 -4
- data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +8 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +4 -3
- data/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb +266 -19
- data/lib/deltacloud/drivers/google/google_driver.rb +6 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +2 -2
- data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +166 -54
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +2 -0
- data/lib/deltacloud/helpers/blob_stream_helper.rb +0 -2
- data/lib/deltacloud/helpers/deltacloud_helper.rb +22 -22
- data/lib/deltacloud/helpers/driver_helper.rb +4 -7
- data/lib/deltacloud/helpers/rabbit_helper.rb +5 -0
- data/lib/deltacloud/server.rb +4 -4
- data/lib/deltacloud/version.rb +1 -1
- data/lib/deltacloud_rack.rb +6 -1
- data/lib/ec2/server.rb +6 -1
- data/tests/cimi/collections/common.rb +33 -0
- data/tests/cimi/collections/machines_test.rb +19 -0
- data/tests/cimi/collections/system_templates_test.rb +47 -0
- data/tests/cimi/collections/volumes_test.rb +42 -0
- data/tests/cimi/db/database_helper_test.rb +7 -4
- data/tests/deltacloud/drivers_test.rb +1 -1
- data/tests/drivers/ec2/common.rb +4 -1
- data/tests/drivers/fgcp/common.rb +1 -2
- data/tests/drivers/gogrid/common.rb +1 -2
- data/tests/drivers/google/common.rb +1 -1
- data/tests/drivers/models/address_test.rb +2 -2
- data/tests/drivers/models/base_test.rb +2 -2
- data/tests/drivers/models/blob_test.rb +2 -2
- data/tests/drivers/models/instance_address_test.rb +8 -8
- data/tests/drivers/models/instance_profile_test.rb +2 -2
- data/tests/drivers/models/keys_test.rb +4 -4
- data/tests/drivers/models/metrics_test.rb +3 -3
- data/tests/drivers/openstack/common.rb +1 -2
- data/views/addresses/_address.html.haml +3 -3
- data/views/addresses/associate.html.haml +3 -3
- data/views/addresses/index.html.haml +2 -2
- data/views/addresses/index.xml.haml +2 -2
- data/views/addresses/show.html.haml +7 -7
- data/views/addresses/show.xml.haml +9 -9
- data/views/api/show.html.haml +2 -2
- data/views/api/show.xml.haml +1 -1
- data/views/blobs/new.html.haml +1 -1
- data/views/blobs/show.html.haml +8 -8
- data/views/blobs/show.xml.haml +7 -7
- data/views/buckets/index.html.haml +1 -1
- data/views/buckets/index.xml.haml +2 -2
- data/views/buckets/show.html.haml +7 -7
- data/views/buckets/show.xml.haml +6 -6
- data/views/drivers/index.html.haml +1 -1
- data/views/drivers/index.xml.haml +1 -1
- data/views/drivers/show.html.haml +6 -6
- data/views/drivers/show.xml.haml +5 -5
- data/views/error.html.haml +2 -2
- data/views/errors/backend_capability_failure.xml.haml +3 -3
- data/views/errors/common.html.haml +7 -7
- data/views/errors/common.xml.haml +5 -5
- data/views/firewalls/index.html.haml +1 -1
- data/views/firewalls/index.xml.haml +1 -1
- data/views/firewalls/new_rule.html.haml +1 -1
- data/views/firewalls/show.html.haml +8 -8
- data/views/firewalls/show.xml.haml +9 -9
- data/views/hardware_profiles/index.html.haml +1 -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 +4 -4
- data/views/images/index.html.haml +1 -1
- data/views/images/index.xml.haml +2 -2
- data/views/images/new.html.haml +2 -2
- data/views/images/show.html.haml +14 -14
- data/views/images/show.xml.haml +14 -14
- data/views/instance_states/show.html.haml +1 -1
- data/views/instance_states/show.png.erb +2 -2
- data/views/instance_states/show.xml.haml +1 -1
- data/views/instances/index.html.haml +1 -1
- data/views/instances/index.xml.haml +2 -2
- data/views/instances/new.html.haml +22 -14
- data/views/instances/run.html.haml +2 -2
- data/views/instances/run.xml.haml +3 -3
- data/views/instances/run_command.html.haml +4 -4
- data/views/instances/show.html.haml +27 -27
- data/views/instances/show.xml.haml +37 -37
- data/views/keys/index.html.haml +1 -1
- data/views/keys/index.xml.haml +2 -2
- data/views/keys/show.html.haml +10 -10
- data/views/keys/show.xml.haml +12 -12
- data/views/load_balancers/index.html.haml +1 -1
- data/views/load_balancers/index.xml.haml +2 -2
- data/views/load_balancers/new.html.haml +1 -8
- data/views/load_balancers/show.html.haml +10 -10
- data/views/load_balancers/show.xml.haml +9 -9
- data/views/metrics/index.html.haml +1 -1
- data/views/metrics/index.xml.haml +2 -2
- data/views/metrics/show.html.haml +2 -2
- data/views/metrics/show.xml.haml +3 -3
- data/views/realms/index.html.haml +1 -1
- data/views/realms/index.xml.haml +2 -2
- data/views/realms/show.html.haml +6 -6
- data/views/realms/show.xml.haml +5 -5
- data/views/storage_snapshots/index.html.haml +1 -1
- data/views/storage_snapshots/index.xml.haml +2 -2
- data/views/storage_snapshots/show.html.haml +6 -6
- data/views/storage_snapshots/show.xml.haml +4 -4
- data/views/storage_volumes/attach.html.haml +2 -2
- data/views/storage_volumes/index.html.haml +1 -1
- data/views/storage_volumes/index.xml.haml +2 -2
- data/views/storage_volumes/show.html.haml +19 -19
- data/views/storage_volumes/show.xml.haml +21 -21
- metadata +77 -65
- data/views/cimi/cloudEntryPoint/index.html.haml +0 -5
- data/views/cimi/cloudEntryPoint/index.xml.haml +0 -9
- data/views/cimi/collection/index.html.haml +0 -45
- data/views/cimi/collection/response.xml.haml +0 -3
- data/views/cimi/error.html.haml +0 -31
- data/views/cimi/errors/400.xml.haml +0 -3
- data/views/cimi/errors/401.xml.haml +0 -2
- data/views/cimi/errors/403.xml.haml +0 -2
- data/views/cimi/errors/404.xml.haml +0 -2
- data/views/cimi/errors/405.xml.haml +0 -5
- data/views/cimi/errors/500.xml.haml +0 -6
- data/views/cimi/errors/502.xml.haml +0 -7
- data/views/cimi/layout.html.haml +0 -32
- data/views/cimi/machine_configurations/show.html.haml +0 -159
- data/views/cimi/machine_configurations/show.xml.haml +0 -27
- data/views/cimi/machine_images/show.html.haml +0 -79
- data/views/cimi/machine_images/show.xml.haml +0 -17
- data/views/cimi/machines/show.html.haml +0 -177
- data/views/cimi/machines/show.xml.haml +0 -28
- data/views/cimi/volumes/show.html.haml +0 -68
- data/views/cimi/volumes/show.xml.haml +0 -17
- data/views/docs/collection.html.haml +0 -26
- data/views/docs/collection.xml.haml +0 -14
- data/views/docs/index.html.haml +0 -11
- data/views/docs/index.xml.haml +0 -5
- data/views/docs/operation.html.haml +0 -33
- data/views/docs/operation.xml.haml +0 -10
- data/views/root/index.html.haml +0 -4
@@ -23,8 +23,7 @@ VCR.configure do |c|
|
|
23
23
|
c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures')
|
24
24
|
c.hook_into :webmock
|
25
25
|
c.default_cassette_options = {
|
26
|
-
:record =>
|
27
|
-
# :record => :none,
|
26
|
+
:record => vcr_record_mode,
|
28
27
|
:match_requests_on => [:method,
|
29
28
|
VCR.request_matchers.uri_without_param(:Signature, :AccessKeyId)]
|
30
29
|
}
|
@@ -18,7 +18,6 @@ VCR.configure do |c|
|
|
18
18
|
c.hook_into :webmock
|
19
19
|
matcher = VCR.request_matchers.uri_without_param("api_key", "sig")
|
20
20
|
c.register_request_matcher(:gogrid_matcher, &matcher)
|
21
|
-
|
22
|
-
c.default_cassette_options[:record] =:none
|
21
|
+
c.default_cassette_options[:record] = vcr_record_mode
|
23
22
|
c.default_cassette_options[:match_requests_on] = [:method, :gogrid_matcher]
|
24
23
|
end
|
@@ -3,10 +3,10 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common.rb'
|
5
5
|
|
6
|
-
describe Address do
|
6
|
+
describe Deltacloud::Address do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@address = Address.new(:id => 'adr1', :instance_id => 'inst1')
|
9
|
+
@address = Deltacloud::Address.new(:id => 'adr1', :instance_id => 'inst1')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'should tell if it is associated to instance' do
|
@@ -3,10 +3,10 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe BaseModel do
|
6
|
+
describe Deltacloud::BaseModel do
|
7
7
|
|
8
8
|
before do
|
9
|
-
class CustomModel < BaseModel
|
9
|
+
class CustomModel < Deltacloud::BaseModel
|
10
10
|
attr_accessor :name
|
11
11
|
attr_accessor :custom
|
12
12
|
end
|
@@ -3,10 +3,10 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe Address do
|
6
|
+
describe Deltacloud::Address do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@address = Address.new(:id => 'adr1', :instance_id => 'inst1')
|
9
|
+
@address = Deltacloud::Address.new(:id => 'adr1', :instance_id => 'inst1')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'should tell if it is associated to instance' do
|
@@ -3,22 +3,22 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe InstanceAddress do
|
6
|
+
describe Deltacloud::InstanceAddress do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@address = InstanceAddress.new('192.168.0.1')
|
9
|
+
@address = Deltacloud::InstanceAddress.new('192.168.0.1')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'should properly report address type' do
|
13
13
|
@address.address_type.must_equal :ipv4
|
14
14
|
@address.address.must_equal '192.168.0.1'
|
15
15
|
@address.is_ipv4?.must_equal true
|
16
|
-
InstanceAddress.new('01:23:45:67:89:ab', :type => :mac).address_type.must_equal :mac
|
17
|
-
InstanceAddress.new('01:23:45:67:89:ab', :type => :mac).is_mac?.must_equal true
|
18
|
-
InstanceAddress.new('test.local', :type => :hostname).is_hostname?.must_equal true
|
19
|
-
InstanceAddress.new('test.local', :port => '5000', :type => :vnc).is_vnc?.must_equal true
|
20
|
-
InstanceAddress.new('test.local', :port => '5000', :type => :vnc).port.must_equal '5000'
|
21
|
-
InstanceAddress.new('test.local', :port => '5000', :type => :vnc).to_s.must_equal 'VNC:test.local:5000'
|
16
|
+
Deltacloud::InstanceAddress.new('01:23:45:67:89:ab', :type => :mac).address_type.must_equal :mac
|
17
|
+
Deltacloud::InstanceAddress.new('01:23:45:67:89:ab', :type => :mac).is_mac?.must_equal true
|
18
|
+
Deltacloud::InstanceAddress.new('test.local', :type => :hostname).is_hostname?.must_equal true
|
19
|
+
Deltacloud::InstanceAddress.new('test.local', :port => '5000', :type => :vnc).is_vnc?.must_equal true
|
20
|
+
Deltacloud::InstanceAddress.new('test.local', :port => '5000', :type => :vnc).port.must_equal '5000'
|
21
|
+
Deltacloud::InstanceAddress.new('test.local', :port => '5000', :type => :vnc).to_s.must_equal 'VNC:test.local:5000'
|
22
22
|
end
|
23
23
|
|
24
24
|
end
|
@@ -3,10 +3,10 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe InstanceProfile do
|
6
|
+
describe Deltacloud::InstanceProfile do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@instance = InstanceProfile.new(
|
9
|
+
@instance = Deltacloud::InstanceProfile.new(
|
10
10
|
'm1-small',
|
11
11
|
:hwp_memory => '512',
|
12
12
|
:hwp_cpu => '1'
|
@@ -3,10 +3,10 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe Key do
|
6
|
+
describe Deltacloud::Key do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@key = Key.new(:credential_type => :key)
|
9
|
+
@key = Deltacloud::Key.new(:credential_type => :key)
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'advertise if it is password or key' do
|
@@ -15,11 +15,11 @@ describe Key do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'cat generate the mock fingerprint' do
|
18
|
-
Key.generate_mock_fingerprint.must_match
|
18
|
+
Deltacloud::Key.generate_mock_fingerprint.must_match(/(\w{2}:?)/)
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'can generate the mock PEM key' do
|
22
|
-
Key.generate_mock_pem.must_include 'PRIVATE KEY'
|
22
|
+
Deltacloud::Key.generate_mock_pem.must_include 'PRIVATE KEY'
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
@@ -3,17 +3,17 @@ require 'require_relative' if RUBY_VERSION < '1.9'
|
|
3
3
|
|
4
4
|
require_relative 'common'
|
5
5
|
|
6
|
-
describe Metric do
|
6
|
+
describe Deltacloud::Metric do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@metric = Metric.new(:id => 'metric1', :entity => 'inst1')
|
9
|
+
@metric = Deltacloud::Metric.new(:id => 'metric1', :entity => 'inst1')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'cat be extended by add_property' do
|
13
13
|
@metric.add_property :network, { :max => 100, :min => 10, :avg => 50 }
|
14
14
|
@metric.properties.wont_be_empty
|
15
15
|
@metric.properties.each do |p|
|
16
|
-
p.must_be_kind_of Metric::Property
|
16
|
+
p.must_be_kind_of Deltacloud::Metric::Property
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -21,6 +21,5 @@ VCR.configure do |c|
|
|
21
21
|
# NOTE: Empty this directory before re-recording
|
22
22
|
c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures')
|
23
23
|
c.hook_into :webmock
|
24
|
-
|
25
|
-
c.default_cassette_options = { :record => :none }
|
24
|
+
c.default_cassette_options = { :record => vcr_record_mode }
|
26
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
%li
|
2
|
-
%a{ :href => address_url(
|
2
|
+
%a{ :href => address_url(address.id), :'data-ajax' => 'false'}
|
3
3
|
%img{ :class => 'ui-link-thumb', :src => '/images/address.png'}
|
4
|
-
%h3=
|
4
|
+
%h3= address.id
|
5
5
|
%span{ :class => 'ui-li-count'}
|
6
|
-
=
|
6
|
+
= address.instance_id ? address.instance_id : 'Free'
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=header "Associate to instance"
|
2
|
-
=subheader
|
2
|
+
=subheader address.id
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
5
|
-
%form{ :action => "#{address_url(
|
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'}
|
9
9
|
%option
|
10
|
-
-
|
10
|
+
- instances.each do |inst|
|
11
11
|
%option{ :value => inst.id } #{inst.id} - #{inst.name}
|
12
12
|
%button{ :type => :submit} Associate
|
@@ -5,5 +5,5 @@
|
|
5
5
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
6
6
|
%ul#address_list{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
7
7
|
%li{ :'data-role' => 'list-divider'}=driver_symbol
|
8
|
-
-
|
9
|
-
= haml :"addresses/_address", :locals => {
|
8
|
+
- elements.each do |address|
|
9
|
+
= haml :"addresses/_address", :locals => { :address => address, :partial => true }
|
@@ -1,20 +1,20 @@
|
|
1
1
|
=header "Address"
|
2
|
-
=subheader
|
2
|
+
=subheader address.id
|
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'} Address
|
7
7
|
%li
|
8
|
-
%p{ :'data-role' => 'fieldcontain'}
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=address.id
|
9
9
|
%li{ :'data-role' => 'list-divider'} Associated to instance
|
10
10
|
%li
|
11
|
-
%p{ :'data-role' => 'fieldcontain'}
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=address.instance_id || "Not associated yet"
|
12
12
|
%li{ :'data-role' => 'list-divider'} Actions
|
13
13
|
%li
|
14
14
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
15
|
-
- if
|
16
|
-
=link_to_action 'Disassociate', "#{address_url(
|
15
|
+
- if address.associated?
|
16
|
+
=link_to_action 'Disassociate', "#{address_url(address.id)}/disassociate", :post
|
17
17
|
- else
|
18
18
|
- if driver.respond_to?(:associate_address)
|
19
|
-
=link_to_action 'Associate...',"#{address_url(
|
20
|
-
=link_to_action "Destroy", destroy_address_url(
|
19
|
+
=link_to_action 'Associate...',"#{address_url(address.id)}/associate", :get
|
20
|
+
=link_to_action "Destroy", destroy_address_url(address.id), :delete
|
@@ -1,14 +1,14 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
|
-
%address{ :href => address_url(
|
3
|
+
%address{ :href => address_url(address.id), :id => address.id }
|
4
4
|
%ip<
|
5
|
-
|
5
|
+
=address.id
|
6
6
|
%actions
|
7
7
|
- if driver.respond_to?(:destroy_address)
|
8
|
-
%link{ :rel => "destroy", :method => "delete", :href => destroy_address_url(
|
9
|
-
- if driver.respond_to?(:associate_address) and not
|
10
|
-
%link{ :rel => "associate", :method => "post", :href => associate_address_url(
|
11
|
-
- if driver.respond_to?(:disassociate_address) and
|
12
|
-
%link{ :rel => "disassociate", :method => "post", :href => disassociate_address_url(
|
13
|
-
- if
|
14
|
-
%instance{ :href => instance_url(
|
8
|
+
%link{ :rel => "destroy", :method => "delete", :href => destroy_address_url(address.id)}
|
9
|
+
- if driver.respond_to?(:associate_address) and not address.instance_id
|
10
|
+
%link{ :rel => "associate", :method => "post", :href => associate_address_url(address.id)}
|
11
|
+
- if driver.respond_to?(:disassociate_address) and address.instance_id
|
12
|
+
%link{ :rel => "disassociate", :method => "post", :href => disassociate_address_url(address.id)}
|
13
|
+
- if address.instance_id
|
14
|
+
%instance{ :href => instance_url(address.instance_id), :id => address.instance_id}
|
data/views/api/show.html.haml
CHANGED
@@ -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
|
-
-
|
6
|
+
- collections.each do |c|
|
7
7
|
%li
|
8
8
|
%a{ :href => url_for(c.collection_name), :'data-icon' => "arrow-r"}=c.collection_name.to_s.gsub('_', ' ').titlecase
|
9
9
|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
- unless driver.configured_providers.empty?
|
23
23
|
%div{ :'data-role' => :footer, :'data-theme' => 'a'}
|
24
24
|
%form{ :action => settings.root_url, :method => :post, :'data-ajax' => 'false'}
|
25
|
-
- if
|
25
|
+
- if driver_name
|
26
26
|
%input{ :name => :driver, :type => :hidden, :value => driver.name }/
|
27
27
|
%fieldset{ :'data-type' => "horizontal", :'data-role' => "controlgroup", :id => "providers" }
|
28
28
|
%select{:name => 'provider', :'data-inline' => 'true', :'data-native-menu' => 'false'}
|
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
|
- f.operations.each do |operation|
|
data/views/blobs/new.html.haml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
=header "Create new blob"
|
2
2
|
|
3
3
|
%div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
|
4
|
-
%form{ :action => bucket_url(
|
4
|
+
%form{ :action => bucket_url(bucket_id), :method => :post, :enctype => 'multipart/form-data', "data-ajax" => "false"}
|
5
5
|
%div{ 'data-role' => :fieldcontain }
|
6
6
|
%label
|
7
7
|
Blob Name:
|
data/views/blobs/show.html.haml
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
=header "Blob"
|
2
|
-
=subheader
|
2
|
+
=subheader blob.id
|
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'} Bucket
|
7
7
|
%li
|
8
|
-
%p{ :'data-role' => 'fieldcontain'}
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=blob.bucket
|
9
9
|
%li{ :'data-role' => 'list-divider'} Content length
|
10
10
|
%li
|
11
|
-
%p{ :'data-role' => 'fieldcontain'}
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=blob.content_length
|
12
12
|
%li{ :'data-role' => 'list-divider'} Content type
|
13
13
|
%li
|
14
|
-
%p{ :'data-role' => 'fieldcontain'}
|
14
|
+
%p{ :'data-role' => 'fieldcontain'}=blob.content_type
|
15
15
|
%li{ :'data-role' => 'list-divider'} Last modified
|
16
16
|
%li
|
17
|
-
%p{ :'data-role' => 'fieldcontain'}
|
17
|
+
%p{ :'data-role' => 'fieldcontain'}=blob.last_modified
|
18
18
|
%li{ :'data-role' => 'list-divider'} Content
|
19
19
|
%li
|
20
|
-
%a{ :href => bucket_url(
|
20
|
+
%a{ :href => bucket_url(blob.bucket) + '/' + blob.id + '/content' }="Download"
|
21
21
|
%li{ :'data-role' => 'list-divider'} User meta-data
|
22
22
|
%li
|
23
23
|
%p{ :'data-role' => 'fieldcontain'}
|
24
|
-
-
|
24
|
+
- blob.user_metadata.each do |k,v|
|
25
25
|
%b #{k} :
|
26
26
|
#{v}
|
27
27
|
%br
|
28
28
|
%li{ :'data-role' => 'list-divider'} Actions
|
29
29
|
%li
|
30
30
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
31
|
-
=link_to_action 'Delete',bucket_url(
|
31
|
+
=link_to_action 'Delete',bucket_url(blob.bucket) + '/' + blob.id, :delete
|
data/views/blobs/show.xml.haml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
!!! XML
|
2
|
-
%blob{:href => bucket_url(
|
3
|
-
%bucket
|
4
|
-
-
|
2
|
+
%blob{:href => bucket_url(blob.bucket) + '/' + blob.id, :id => blob.id}
|
3
|
+
%bucket=blob.bucket
|
4
|
+
- blob.attributes.select{ |attr| (attr!=:id && attr!=:user_metadata) }.each do |attribute|
|
5
5
|
- next if attribute == :bucket
|
6
6
|
- unless attribute == :content
|
7
7
|
- haml_tag(attribute, :<) do
|
8
|
-
- haml_concat
|
8
|
+
- haml_concat blob.send(attribute)
|
9
9
|
%user_metadata
|
10
|
-
- if
|
11
|
-
-
|
10
|
+
- if blob.user_metadata.respond_to? :each
|
11
|
+
- blob.user_metadata.each do |k, v|
|
12
12
|
%entry{:key => k}=render_cdata(v)
|
13
|
-
%content{:href => bucket_url(
|
13
|
+
%content{:href => bucket_url(blob.bucket) + '/' + blob.id + '/content', :rel => 'blob_content'}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
6
|
-
-
|
6
|
+
- elements.each do |bucket|
|
7
7
|
%li
|
8
8
|
%a{ :href => bucket_url(bucket.id), :'data-ajax' => 'false'}
|
9
9
|
%img{ :class => 'ui-link-thumb', :src => '/images/bucket.png'}
|
@@ -1,23 +1,23 @@
|
|
1
1
|
=header "Bucket"
|
2
|
-
=subheader
|
2
|
+
=subheader bucket.id
|
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'}
|
8
|
+
%p{ :'data-role' => 'fieldcontain'}=bucket.name
|
9
9
|
%li{ :'data-role' => 'list-divider'} Size
|
10
10
|
%li
|
11
|
-
%p{ :'data-role' => 'fieldcontain'}
|
11
|
+
%p{ :'data-role' => 'fieldcontain'}=bucket.size
|
12
12
|
%li{ :'data-role' => 'list-divider'}
|
13
13
|
Blobs
|
14
|
-
-
|
14
|
+
- bucket.blob_list.each do |blob|
|
15
15
|
%li
|
16
|
-
%a{ :href => bucket_url(
|
16
|
+
%a{ :href => bucket_url(bucket.name) + "/" + blob, :'data-ajax' => 'false'}
|
17
17
|
%img{ :class => 'ui-link-thumb', :src => '/images/blob.png'}
|
18
18
|
%h3=blob
|
19
19
|
%li{ :'data-role' => 'list-divider'} Actions
|
20
20
|
%li
|
21
21
|
%div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
|
22
|
-
%a{ :href => new_blob_form_url(
|
23
|
-
=link_to_action 'Delete bucket', destroy_bucket_url(
|
22
|
+
%a{ :href => new_blob_form_url(bucket), :'data-role' => "button", :'data-ajax' => 'false'} Create new blob...
|
23
|
+
=link_to_action 'Delete bucket', destroy_bucket_url(bucket.name), :delete
|
data/views/buckets/show.xml.haml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
- unless defined?(partial)
|
2
2
|
!!! XML
|
3
|
-
%bucket{:href => bucket_url(
|
4
|
-
-
|
3
|
+
%bucket{:href => bucket_url(bucket.id), :id => bucket.id}
|
4
|
+
- bucket.attributes.select{ |attr| attr!=:id }.each do |attribute|
|
5
5
|
- unless attribute == :blob_list
|
6
6
|
-haml_tag(attribute, :<) do
|
7
|
-
- haml_concat
|
8
|
-
- if
|
9
|
-
-
|
10
|
-
%blob{:id => blb, :href => bucket_url(
|
7
|
+
- haml_concat bucket.send(attribute)
|
8
|
+
- if bucket.blob_list
|
9
|
+
- bucket.blob_list.each do |blb|
|
10
|
+
%blob{:id => blb, :href => bucket_url(bucket.id) +"/#{blb}"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
%div{ :'data-role' => :content, :'data-theme' => 'c'}
|
5
5
|
%ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
|
6
|
-
-
|
6
|
+
- drivers.each do |id, details|
|
7
7
|
%li
|
8
8
|
%a{ :href => driver_url(id), :'data-ajax' => 'false'}
|
9
9
|
%img{ :class => 'ui-link-thumb', :src => '/images/cloud.png'}
|