fog-maestrodev 1.18.0.20131209091424 → 1.18.0.20131218202447
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CONTRIBUTING.md +22 -0
- data/LICENSE.md +20 -0
- data/README.md +29 -42
- data/fog.gemspec +3 -3
- data/lib/fog/aws/compute.rb +1 -0
- data/lib/fog/aws/models/compute/subnet.rb +4 -0
- data/lib/fog/aws/models/compute/vpc.rb +5 -0
- data/lib/fog/aws/models/rds/server.rb +2 -0
- data/lib/fog/aws/models/storage/file.rb +2 -2
- data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
- data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
- data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
- data/lib/fog/cloudstack.rb +1 -1
- data/lib/fog/core/connection.rb +1 -2
- data/lib/fog/core/hmac.rb +3 -3
- data/lib/fog/core/mock.rb +2 -2
- data/lib/fog/core/wait_for.rb +1 -1
- data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
- data/lib/fog/core.rb +1 -1
- data/lib/fog/google/compute.rb +19 -11
- data/lib/fog/google/examples/create.rb +12 -1
- data/lib/fog/google/examples/eric-fail.rb +13 -2
- data/lib/fog/google/examples/image_create.rb +0 -1
- data/lib/fog/google/examples/launch_micro_instance.rb +1 -2
- data/lib/fog/google/examples/metadata.rb +14 -2
- data/lib/fog/google/examples/network.rb +13 -2
- data/lib/fog/google/models/compute/disk.rb +10 -8
- data/lib/fog/google/models/compute/image.rb +8 -3
- data/lib/fog/google/models/compute/server.rb +19 -4
- data/lib/fog/google/models/compute/servers.rb +25 -9
- data/lib/fog/google/requests/compute/insert_disk.rb +6 -3
- data/lib/fog/google/requests/compute/insert_image.rb +1 -5
- data/lib/fog/google/requests/compute/insert_server.rb +8 -21
- data/lib/fog/openstack/compute.rb +3 -0
- data/lib/fog/openstack/models/compute/host.rb +1 -0
- data/lib/fog/openstack/models/compute/security_group.rb +18 -4
- data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
- data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
- data/lib/fog/openstack/network.rb +33 -3
- data/lib/fog/openstack/requests/compute/create_security_group.rb +3 -3
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
- data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
- data/lib/fog/openstack/volume.rb +3 -1
- data/lib/fog/rackspace/docs/auto_scale.md +9 -9
- data/lib/fog/rackspace/docs/getting_started.md +1 -0
- data/lib/fog/rackspace/docs/queues.md +312 -0
- data/lib/fog/vcloud_director/README.md +2 -0
- data/lib/fog/vcloud_director/compute.rb +78 -8
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
- data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +83 -0
- data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
- data/lib/fog/vsphere/models/compute/server.rb +1 -1
- data/lib/fog/xenserver/compute.rb +35 -0
- data/lib/fog/xenserver/models/compute/blob.rb +22 -0
- data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
- data/lib/fog/xenserver/models/compute/bond.rb +23 -0
- data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
- data/lib/fog/xenserver/models/compute/console.rb +3 -1
- data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
- data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
- data/lib/fog/xenserver/models/compute/host.rb +41 -8
- data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/network.rb +7 -6
- data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
- data/lib/fog/xenserver/models/compute/pci.rb +22 -0
- data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
- data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
- data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
- data/lib/fog/xenserver/models/compute/pif.rb +19 -8
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
- data/lib/fog/xenserver/models/compute/pool.rb +18 -1
- data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/role.rb +19 -0
- data/lib/fog/xenserver/models/compute/roles.rb +25 -0
- data/lib/fog/xenserver/models/compute/server.rb +59 -26
- data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
- data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
- data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
- data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
- data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
- data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
- data/lib/fog/xenserver/models/compute/vif.rb +11 -2
- data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
- data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
- data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
- data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
- data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
- data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
- data/tests/google/models/compute/servers_tests.rb +12 -1
- data/tests/google/requests/compute/image_tests.rb +0 -1
- data/tests/helpers/mock_helper.rb +1 -1
- data/tests/openstack/models/compute/security_group_tests.rb +54 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
- data/tests/openstack/requests/network/network_tests.rb +8 -8
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +17 -8
- data/tests/vcloud_director/requests/compute/network_tests.rb +25 -1
- data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
- metadata +125 -132
- checksums.yaml +0 -15
@@ -11,23 +11,88 @@ Shindo.tests('Compute::VcloudDirector | query requests', ['vclouddirector']) do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
# for each queriable type, query and check that each available format
|
15
|
+
# returns a result that matches the base schema
|
16
|
+
#
|
16
17
|
@query_list[:Link].select do |link|
|
17
18
|
link[:rel] == 'down'
|
18
19
|
end.sort_by do |link|
|
19
20
|
[link[:name], link[:href]]
|
20
21
|
end.each do |link|
|
22
|
+
|
21
23
|
href = Nokogiri::XML.fragment(link[:href])
|
22
24
|
query = CGI.parse(URI.parse(href.text).query)
|
23
25
|
type = query['type'].first
|
24
26
|
format = query['format'].first
|
25
27
|
next if %w[right role strandedUser].include?(type)
|
26
28
|
tests("type => #{type}, format => #{format}") do
|
29
|
+
|
30
|
+
pending if Fog.mocking? && (format != 'records' || type != 'orgVdcNetwork')
|
31
|
+
|
27
32
|
tests("#get_execute_query").data_matches_schema(VcloudDirector::Compute::Schema::CONTAINER_TYPE) do
|
28
33
|
@body = @service.get_execute_query(type, :format => format).body
|
29
34
|
end
|
30
35
|
tests("resource type").returns(link[:type]) { @body[:type] }
|
36
|
+
|
37
|
+
unless ( type == 'event' || type == 'edgeGateway' )
|
38
|
+
records_key = @body.keys.detect {|key| key.to_s =~ /Record|Reference$/}
|
39
|
+
if records = @body[records_key]
|
40
|
+
records.first do |record|
|
41
|
+
case format
|
42
|
+
when 'records'
|
43
|
+
tests("record is correct schema").data_matches_schema(VcloudDirector::Compute::Schema::REFERENCE_TYPE) do
|
44
|
+
record
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
if Fog.mocking?
|
55
|
+
tests('ensure Mock logic is sound') do
|
56
|
+
tests('#get_execute_query') do
|
57
|
+
tests('orgVdcNetwork') do
|
58
|
+
output = @service.get_execute_query('orgVdcNetwork').body
|
59
|
+
tests('all records').returns(@service.data[:networks].size) do
|
60
|
+
output[:OrgVdcNetworkRecords].size
|
61
|
+
end
|
62
|
+
output = @service.get_execute_query('orgVdcNetwork', :filter => 'name==vDC1 backend network').body
|
63
|
+
tests(':filter by name').returns(1) do
|
64
|
+
output[:OrgVdcNetworkRecords].size
|
65
|
+
end
|
66
|
+
tests(':page option is ok if :page == 1').returns(@service.data[:networks].size) do
|
67
|
+
output = @service.get_execute_query('orgVdcNetwork', :page => '1').body
|
68
|
+
output[:OrgVdcNetworkRecords].size
|
69
|
+
end
|
70
|
+
tests('AND expression in :filter raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
71
|
+
@service.get_execute_query('orgVdcNetwork', :filter => 'name==Default Network;thing==wibble')
|
72
|
+
end
|
73
|
+
tests('OR expression in :filter raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
74
|
+
@service.get_execute_query('orgVdcNetwork', :filter => 'name==Default Network,thing==wibble')
|
75
|
+
end
|
76
|
+
tests('sortAsc option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
77
|
+
@service.get_execute_query('orgVdcNetwork', :sortAsc => 'name')
|
78
|
+
end
|
79
|
+
tests('sortDesc option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
80
|
+
@service.get_execute_query('orgVdcNetwork', :sortDesc => 'name')
|
81
|
+
end
|
82
|
+
tests('page option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
83
|
+
@service.get_execute_query('orgVdcNetwork', :page => '2')
|
84
|
+
end
|
85
|
+
tests('pageSize option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
86
|
+
@service.get_execute_query('orgVdcNetwork', :pageSize => '50')
|
87
|
+
end
|
88
|
+
tests('offset option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
89
|
+
@service.get_execute_query('orgVdcNetwork', :offset => '5')
|
90
|
+
end
|
91
|
+
tests('fields option raises MockNotImplemented').raises(Fog::Errors::MockNotImplemented) do
|
92
|
+
@service.get_execute_query('orgVdcNetwork', :fields => 'name,thing')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
31
96
|
end
|
32
97
|
end
|
33
98
|
|