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.
Files changed (133) hide show
  1. data/.gitignore +1 -0
  2. data/CONTRIBUTING.md +22 -0
  3. data/LICENSE.md +20 -0
  4. data/README.md +29 -42
  5. data/fog.gemspec +3 -3
  6. data/lib/fog/aws/compute.rb +1 -0
  7. data/lib/fog/aws/models/compute/subnet.rb +4 -0
  8. data/lib/fog/aws/models/compute/vpc.rb +5 -0
  9. data/lib/fog/aws/models/rds/server.rb +2 -0
  10. data/lib/fog/aws/models/storage/file.rb +2 -2
  11. data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
  12. data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
  13. data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
  14. data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
  15. data/lib/fog/cloudstack.rb +1 -1
  16. data/lib/fog/core/connection.rb +1 -2
  17. data/lib/fog/core/hmac.rb +3 -3
  18. data/lib/fog/core/mock.rb +2 -2
  19. data/lib/fog/core/wait_for.rb +1 -1
  20. data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
  21. data/lib/fog/core.rb +1 -1
  22. data/lib/fog/google/compute.rb +19 -11
  23. data/lib/fog/google/examples/create.rb +12 -1
  24. data/lib/fog/google/examples/eric-fail.rb +13 -2
  25. data/lib/fog/google/examples/image_create.rb +0 -1
  26. data/lib/fog/google/examples/launch_micro_instance.rb +1 -2
  27. data/lib/fog/google/examples/metadata.rb +14 -2
  28. data/lib/fog/google/examples/network.rb +13 -2
  29. data/lib/fog/google/models/compute/disk.rb +10 -8
  30. data/lib/fog/google/models/compute/image.rb +8 -3
  31. data/lib/fog/google/models/compute/server.rb +19 -4
  32. data/lib/fog/google/models/compute/servers.rb +25 -9
  33. data/lib/fog/google/requests/compute/insert_disk.rb +6 -3
  34. data/lib/fog/google/requests/compute/insert_image.rb +1 -5
  35. data/lib/fog/google/requests/compute/insert_server.rb +8 -21
  36. data/lib/fog/openstack/compute.rb +3 -0
  37. data/lib/fog/openstack/models/compute/host.rb +1 -0
  38. data/lib/fog/openstack/models/compute/security_group.rb +18 -4
  39. data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
  40. data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
  41. data/lib/fog/openstack/network.rb +33 -3
  42. data/lib/fog/openstack/requests/compute/create_security_group.rb +3 -3
  43. data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
  44. data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
  45. data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
  46. data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
  47. data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
  48. data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
  49. data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
  50. data/lib/fog/openstack/volume.rb +3 -1
  51. data/lib/fog/rackspace/docs/auto_scale.md +9 -9
  52. data/lib/fog/rackspace/docs/getting_started.md +1 -0
  53. data/lib/fog/rackspace/docs/queues.md +312 -0
  54. data/lib/fog/vcloud_director/README.md +2 -0
  55. data/lib/fog/vcloud_director/compute.rb +78 -8
  56. data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
  57. data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
  58. data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
  59. data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
  60. data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
  61. data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
  62. data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
  63. data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
  64. data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +83 -0
  65. data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
  66. data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
  67. data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
  68. data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
  69. data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
  70. data/lib/fog/vsphere/models/compute/server.rb +1 -1
  71. data/lib/fog/xenserver/compute.rb +35 -0
  72. data/lib/fog/xenserver/models/compute/blob.rb +22 -0
  73. data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
  74. data/lib/fog/xenserver/models/compute/bond.rb +23 -0
  75. data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
  76. data/lib/fog/xenserver/models/compute/console.rb +3 -1
  77. data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
  78. data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
  79. data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
  80. data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
  81. data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
  82. data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
  83. data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
  84. data/lib/fog/xenserver/models/compute/host.rb +41 -8
  85. data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
  86. data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
  87. data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
  88. data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
  89. data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
  90. data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
  91. data/lib/fog/xenserver/models/compute/network.rb +7 -6
  92. data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
  93. data/lib/fog/xenserver/models/compute/pci.rb +22 -0
  94. data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
  95. data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
  96. data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
  97. data/lib/fog/xenserver/models/compute/pif.rb +19 -8
  98. data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
  99. data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
  100. data/lib/fog/xenserver/models/compute/pool.rb +18 -1
  101. data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
  102. data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
  103. data/lib/fog/xenserver/models/compute/role.rb +19 -0
  104. data/lib/fog/xenserver/models/compute/roles.rb +25 -0
  105. data/lib/fog/xenserver/models/compute/server.rb +59 -26
  106. data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
  107. data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
  108. data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
  109. data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
  110. data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
  111. data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
  112. data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
  113. data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
  114. data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
  115. data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
  116. data/lib/fog/xenserver/models/compute/vif.rb +11 -2
  117. data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
  118. data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
  119. data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
  120. data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
  121. data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
  122. data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
  123. data/tests/google/models/compute/servers_tests.rb +12 -1
  124. data/tests/google/requests/compute/image_tests.rb +0 -1
  125. data/tests/helpers/mock_helper.rb +1 -1
  126. data/tests/openstack/models/compute/security_group_tests.rb +54 -0
  127. data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
  128. data/tests/openstack/requests/network/network_tests.rb +8 -8
  129. data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +17 -8
  130. data/tests/vcloud_director/requests/compute/network_tests.rb +25 -1
  131. data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
  132. metadata +125 -132
  133. 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
- pending if Fog.mocking?
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