fog 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. data/.gitignore +2 -1
  2. data/Rakefile +90 -1
  3. data/bin/fog +5 -1
  4. data/changelog.txt +156 -0
  5. data/docs/_layouts/default.html +1 -0
  6. data/docs/about/press.markdown +4 -0
  7. data/docs/compute/index.markdown +4 -0
  8. data/docs/storage/index.markdown +4 -0
  9. data/fog.gemspec +3 -3
  10. data/lib/fog.rb +1 -1
  11. data/lib/fog/aws/iam.rb +7 -6
  12. data/lib/fog/aws/models/rds/server.rb +27 -23
  13. data/lib/fog/aws/parsers/iam/get_group.rb +2 -2
  14. data/lib/fog/aws/requests/iam/update_server_certificate.rb +37 -0
  15. data/lib/fog/bin.rb +2 -1
  16. data/lib/fog/bin/dynect.rb +30 -0
  17. data/lib/fog/bin/rackspace.rb +4 -0
  18. data/lib/fog/cdn.rb +4 -0
  19. data/lib/fog/cdn/aws.rb +6 -0
  20. data/lib/fog/cdn/parsers/aws/get_invalidation_list.rb +43 -0
  21. data/lib/fog/cdn/parsers/aws/get_streaming_distribution_list.rb +59 -0
  22. data/lib/fog/cdn/parsers/aws/streaming_distribution.rb +59 -0
  23. data/lib/fog/cdn/requests/aws/delete_streaming_distribution.rb +28 -0
  24. data/lib/fog/cdn/requests/aws/get_invalidation_list.rb +42 -0
  25. data/lib/fog/cdn/requests/aws/get_streaming_distribution.rb +50 -0
  26. data/lib/fog/cdn/requests/aws/get_streaming_distribution_list.rb +59 -0
  27. data/lib/fog/cdn/requests/aws/post_streaming_distribution.rb +78 -0
  28. data/lib/fog/cdn/requests/aws/put_streaming_distribution_config.rb +83 -0
  29. data/lib/fog/compute.rb +6 -2
  30. data/lib/fog/compute/aws.rb +12 -1
  31. data/lib/fog/compute/brightbox.rb +22 -12
  32. data/lib/fog/compute/models/aws/image.rb +5 -0
  33. data/lib/fog/compute/models/aws/server.rb +19 -22
  34. data/lib/fog/compute/models/aws/tag.rb +1 -1
  35. data/lib/fog/compute/models/bluebox/server.rb +2 -18
  36. data/lib/fog/compute/models/brightbox/account.rb +1 -1
  37. data/lib/fog/compute/models/brightbox/server.rb +2 -2
  38. data/lib/fog/compute/models/go_grid/server.rb +2 -18
  39. data/lib/fog/compute/models/linode/server.rb +5 -5
  40. data/lib/fog/compute/models/ninefold/server.rb +2 -2
  41. data/lib/fog/compute/models/rackspace/server.rb +2 -18
  42. data/lib/fog/compute/models/server.rb +27 -0
  43. data/lib/fog/compute/models/slicehost/server.rb +2 -18
  44. data/lib/fog/compute/models/storm_on_demand/server.rb +3 -3
  45. data/lib/fog/compute/models/voxel/server.rb +2 -2
  46. data/lib/fog/compute/parsers/aws/describe_images.rb +15 -3
  47. data/lib/fog/compute/parsers/aws/describe_instances.rb +1 -1
  48. data/lib/fog/compute/parsers/aws/describe_security_groups.rb +31 -7
  49. data/lib/fog/compute/requests/aws/describe_images.rb +33 -14
  50. data/lib/fog/compute/requests/aws/describe_volumes.rb +1 -0
  51. data/lib/fog/compute/requests/aws/modify_image_attribute.rb +39 -0
  52. data/lib/fog/compute/requests/aws/modify_instance_attribute.rb +37 -0
  53. data/lib/fog/compute/requests/aws/modify_snapshot_attribute.rb +10 -10
  54. data/lib/fog/compute/requests/aws/register_image.rb +54 -13
  55. data/lib/fog/compute/requests/aws/run_instances.rb +5 -0
  56. data/lib/fog/compute/requests/aws/stop_instances.rb +2 -1
  57. data/lib/fog/compute/requests/brightbox/activate_console_server.rb +2 -8
  58. data/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +2 -8
  59. data/lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb +2 -8
  60. data/lib/fog/compute/requests/brightbox/create_api_client.rb +2 -8
  61. data/lib/fog/compute/requests/brightbox/create_cloud_ip.rb +2 -8
  62. data/lib/fog/compute/requests/brightbox/create_image.rb +2 -8
  63. data/lib/fog/compute/requests/brightbox/create_load_balancer.rb +2 -8
  64. data/lib/fog/compute/requests/brightbox/create_server.rb +2 -8
  65. data/lib/fog/compute/requests/brightbox/destroy_api_client.rb +2 -8
  66. data/lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb +2 -8
  67. data/lib/fog/compute/requests/brightbox/destroy_image.rb +2 -8
  68. data/lib/fog/compute/requests/brightbox/destroy_load_balancer.rb +2 -8
  69. data/lib/fog/compute/requests/brightbox/destroy_server.rb +2 -8
  70. data/lib/fog/compute/requests/brightbox/get_account.rb +2 -8
  71. data/lib/fog/compute/requests/brightbox/get_api_client.rb +2 -8
  72. data/lib/fog/compute/requests/brightbox/get_cloud_ip.rb +2 -8
  73. data/lib/fog/compute/requests/brightbox/get_image.rb +2 -8
  74. data/lib/fog/compute/requests/brightbox/get_interface.rb +2 -8
  75. data/lib/fog/compute/requests/brightbox/get_load_balancer.rb +2 -8
  76. data/lib/fog/compute/requests/brightbox/get_server.rb +2 -8
  77. data/lib/fog/compute/requests/brightbox/get_server_type.rb +2 -8
  78. data/lib/fog/compute/requests/brightbox/get_user.rb +2 -8
  79. data/lib/fog/compute/requests/brightbox/get_zone.rb +2 -8
  80. data/lib/fog/compute/requests/brightbox/list_api_clients.rb +2 -8
  81. data/lib/fog/compute/requests/brightbox/list_cloud_ips.rb +2 -8
  82. data/lib/fog/compute/requests/brightbox/list_images.rb +2 -8
  83. data/lib/fog/compute/requests/brightbox/list_load_balancers.rb +2 -8
  84. data/lib/fog/compute/requests/brightbox/list_server_types.rb +2 -8
  85. data/lib/fog/compute/requests/brightbox/list_servers.rb +2 -8
  86. data/lib/fog/compute/requests/brightbox/list_users.rb +2 -8
  87. data/lib/fog/compute/requests/brightbox/list_zones.rb +2 -8
  88. data/lib/fog/compute/requests/brightbox/map_cloud_ip.rb +2 -8
  89. data/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +2 -8
  90. data/lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb +2 -8
  91. data/lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb +2 -8
  92. data/lib/fog/compute/requests/brightbox/shutdown_server.rb +2 -8
  93. data/lib/fog/compute/requests/brightbox/snapshot_server.rb +2 -8
  94. data/lib/fog/compute/requests/brightbox/start_server.rb +2 -8
  95. data/lib/fog/compute/requests/brightbox/stop_server.rb +2 -8
  96. data/lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb +2 -8
  97. data/lib/fog/compute/requests/brightbox/update_account.rb +2 -8
  98. data/lib/fog/compute/requests/brightbox/update_api_client.rb +2 -8
  99. data/lib/fog/compute/requests/brightbox/update_image.rb +2 -8
  100. data/lib/fog/compute/requests/brightbox/update_load_balancer.rb +2 -8
  101. data/lib/fog/compute/requests/brightbox/update_server.rb +2 -8
  102. data/lib/fog/compute/requests/brightbox/update_user.rb +2 -8
  103. data/lib/fog/core.rb +1 -0
  104. data/lib/fog/core/credentials.rb +1 -1
  105. data/lib/fog/core/errors.rb +3 -1
  106. data/lib/fog/core/json.rb +20 -0
  107. data/lib/fog/core/provider.rb +3 -1
  108. data/lib/fog/core/service.rb +5 -0
  109. data/lib/fog/dns.rb +8 -1
  110. data/lib/fog/dns/dynect.rb +80 -0
  111. data/lib/fog/dns/models/dynect/record.rb +67 -0
  112. data/lib/fog/dns/models/dynect/records.rb +53 -0
  113. data/lib/fog/dns/models/dynect/zone.rb +60 -0
  114. data/lib/fog/dns/models/dynect/zones.rb +29 -0
  115. data/lib/fog/dns/requests/dynect/delete_record.rb +24 -0
  116. data/lib/fog/dns/requests/dynect/delete_zone.rb +21 -0
  117. data/lib/fog/dns/requests/dynect/get_node_list.rb +23 -0
  118. data/lib/fog/dns/requests/dynect/get_record.rb +25 -0
  119. data/lib/fog/dns/requests/dynect/get_zone.rb +22 -0
  120. data/lib/fog/dns/requests/dynect/post_record.rb +27 -0
  121. data/lib/fog/dns/requests/dynect/post_session.rb +36 -0
  122. data/lib/fog/dns/requests/dynect/post_zone.rb +32 -0
  123. data/lib/fog/dns/requests/dynect/put_zone.rb +26 -0
  124. data/lib/fog/dns/zerigo.rb +1 -1
  125. data/lib/fog/providers.rb +1 -0
  126. data/lib/fog/providers/dynect.rb +14 -0
  127. data/lib/fog/providers/rackspace.rb +1 -0
  128. data/lib/fog/rackspace/load_balancers.rb +179 -0
  129. data/lib/fog/rackspace/models/load_balancers/access_rule.rb +39 -0
  130. data/lib/fog/rackspace/models/load_balancers/access_rules.rb +29 -0
  131. data/lib/fog/rackspace/models/load_balancers/load_balancer.rb +216 -0
  132. data/lib/fog/rackspace/models/load_balancers/load_balancers.rb +27 -0
  133. data/lib/fog/rackspace/models/load_balancers/node.rb +58 -0
  134. data/lib/fog/rackspace/models/load_balancers/nodes.rb +29 -0
  135. data/lib/fog/rackspace/models/load_balancers/virtual_ip.rb +35 -0
  136. data/lib/fog/rackspace/models/load_balancers/virtual_ips.rb +32 -0
  137. data/lib/fog/rackspace/requests/load_balancers/create_access_rule.rb +24 -0
  138. data/lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb +26 -0
  139. data/lib/fog/rackspace/requests/load_balancers/create_node.rb +27 -0
  140. data/lib/fog/rackspace/requests/load_balancers/create_virtual_ip.rb +20 -0
  141. data/lib/fog/rackspace/requests/load_balancers/delete_access_rule.rb +15 -0
  142. data/lib/fog/rackspace/requests/load_balancers/delete_all_access_rules.rb +15 -0
  143. data/lib/fog/rackspace/requests/load_balancers/delete_load_balancer.rb +15 -0
  144. data/lib/fog/rackspace/requests/load_balancers/delete_node.rb +15 -0
  145. data/lib/fog/rackspace/requests/load_balancers/delete_nodes.rb +17 -0
  146. data/lib/fog/rackspace/requests/load_balancers/delete_virtual_ip.rb +15 -0
  147. data/lib/fog/rackspace/requests/load_balancers/get_connection_logging.rb +15 -0
  148. data/lib/fog/rackspace/requests/load_balancers/get_connection_throttling.rb +15 -0
  149. data/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb +15 -0
  150. data/lib/fog/rackspace/requests/load_balancers/get_load_balancer_usage.rb +21 -0
  151. data/lib/fog/rackspace/requests/load_balancers/get_monitor.rb +15 -0
  152. data/lib/fog/rackspace/requests/load_balancers/get_node.rb +15 -0
  153. data/lib/fog/rackspace/requests/load_balancers/get_session_persistence.rb +15 -0
  154. data/lib/fog/rackspace/requests/load_balancers/get_usage.rb +20 -0
  155. data/lib/fog/rackspace/requests/load_balancers/list_access_rules.rb +15 -0
  156. data/lib/fog/rackspace/requests/load_balancers/list_algorithms.rb +15 -0
  157. data/lib/fog/rackspace/requests/load_balancers/list_load_balancers.rb +15 -0
  158. data/lib/fog/rackspace/requests/load_balancers/list_nodes.rb +15 -0
  159. data/lib/fog/rackspace/requests/load_balancers/list_protocols.rb +15 -0
  160. data/lib/fog/rackspace/requests/load_balancers/list_virtual_ips.rb +15 -0
  161. data/lib/fog/rackspace/requests/load_balancers/remove_connection_throttling.rb +15 -0
  162. data/lib/fog/rackspace/requests/load_balancers/remove_monitor.rb +15 -0
  163. data/lib/fog/rackspace/requests/load_balancers/remove_session_persistence.rb +15 -0
  164. data/lib/fog/rackspace/requests/load_balancers/set_connection_logging.rb +21 -0
  165. data/lib/fog/rackspace/requests/load_balancers/set_connection_throttling.rb +22 -0
  166. data/lib/fog/rackspace/requests/load_balancers/set_monitor.rb +31 -0
  167. data/lib/fog/rackspace/requests/load_balancers/set_session_persistence.rb +21 -0
  168. data/lib/fog/rackspace/requests/load_balancers/update_load_balancer.rb +24 -0
  169. data/lib/fog/rackspace/requests/load_balancers/update_node.rb +26 -0
  170. data/lib/fog/storage.rb +5 -1
  171. data/lib/fog/storage/aws.rb +3 -0
  172. data/lib/fog/storage/models/aws/directory.rb +1 -3
  173. data/lib/fog/storage/models/aws/file.rb +1 -1
  174. data/lib/fog/storage/models/google/file.rb +1 -1
  175. data/lib/fog/storage/models/local/file.rb +8 -6
  176. data/lib/fog/storage/models/ninefold/file.rb +0 -1
  177. data/lib/fog/storage/requests/aws/copy_object.rb +1 -1
  178. data/lib/fog/storage/requests/aws/get_bucket.rb +14 -11
  179. data/lib/fog/storage/requests/aws/post_object_hidden_fields.rb +2 -4
  180. data/tests/aws/models/rds/server_tests.rb +4 -4
  181. data/tests/compute/models/aws/server_tests.rb +15 -1
  182. data/tests/compute/requests/aws/helper.rb +0 -4
  183. data/tests/compute/requests/aws/image_tests.rb +40 -9
  184. data/tests/compute/requests/brightbox/account_tests.rb +1 -1
  185. data/tests/compute/requests/brightbox/helper.rb +3 -0
  186. data/tests/compute/requests/brightbox/load_balancer_tests.rb +1 -1
  187. data/tests/compute/requests/voxel/server_tests.rb +2 -2
  188. data/tests/dns/helper.rb +18 -0
  189. data/tests/dns/models/record_tests.rb +3 -2
  190. data/tests/dns/models/records_tests.rb +2 -2
  191. data/tests/dns/models/zone_tests.rb +2 -2
  192. data/tests/dns/models/zones_tests.rb +1 -1
  193. data/tests/dns/requests/bluebox/dns_tests.rb +0 -12
  194. data/tests/dns/requests/dnsimple/dns_tests.rb +0 -12
  195. data/tests/dns/requests/dnsmadeeasy/dns_tests.rb +0 -12
  196. data/tests/dns/requests/dynect/dns_tests.rb +132 -0
  197. data/tests/dns/requests/linode/dns_tests.rb +1 -13
  198. data/tests/dns/requests/slicehost/dns_tests.rb +1 -13
  199. data/tests/helper.rb +1 -1
  200. data/tests/helpers/collection_helper.rb +2 -2
  201. data/tests/helpers/formats_helper.rb +2 -0
  202. data/tests/helpers/mock_helper.rb +4 -1
  203. data/tests/rackspace/helper.rb +24 -0
  204. data/tests/rackspace/load_balancer_tests.rb +21 -0
  205. data/tests/rackspace/models/access_list_tests.rb +12 -0
  206. data/tests/rackspace/models/access_lists_tests.rb +12 -0
  207. data/tests/rackspace/models/load_balancer_tests.rb +116 -0
  208. data/tests/rackspace/models/load_balancers_tests.rb +19 -0
  209. data/tests/rackspace/models/node_tests.rb +19 -0
  210. data/tests/rackspace/models/nodes_tests.rb +12 -0
  211. data/tests/rackspace/models/virtual_ip_tests.rb +16 -0
  212. data/tests/rackspace/models/virtual_ips_tests.rb +12 -0
  213. data/tests/rackspace/requests/access_list_tests.rb +56 -0
  214. data/tests/rackspace/requests/algorithm_tests.rb +19 -0
  215. data/tests/rackspace/requests/connection_logging_tests.rb +25 -0
  216. data/tests/rackspace/requests/connection_throttling_tests.rb +37 -0
  217. data/tests/rackspace/requests/helper.rb +112 -0
  218. data/tests/rackspace/requests/load_balancer_tests.rb +63 -0
  219. data/tests/rackspace/requests/load_balancer_usage_tests.rb +19 -0
  220. data/tests/rackspace/requests/monitor_tests.rb +46 -0
  221. data/tests/rackspace/requests/node_tests.rb +87 -0
  222. data/tests/rackspace/requests/protocol_tests.rb +21 -0
  223. data/tests/rackspace/requests/session_persistence_tests.rb +33 -0
  224. data/tests/rackspace/requests/usage_tests.rb +17 -0
  225. data/tests/rackspace/requests/virtual_ip_tests.rb +40 -0
  226. data/tests/storage/requests/aws/bucket_tests.rb +53 -0
  227. metadata +127 -8
  228. data/lib/fog/compute/requests/aws/modify_image_attributes.rb +0 -37
@@ -14,7 +14,3 @@ class AWS
14
14
  end
15
15
 
16
16
  end
17
-
18
- unless defined?(GENTOO_AMI)
19
- GENTOO_AMI = 'ami-5ee70037'
20
- end
@@ -1,37 +1,68 @@
1
1
  Shindo.tests('Fog::Compute[:aws] | image requests', ['aws']) do
2
-
3
- @images_format = {
2
+ @describe_images_format = {
4
3
  'imagesSet' => [{
5
4
  'architecture' => String,
6
- 'blockDeviceMapping' =>[],
5
+ 'blockDeviceMapping' => [],
6
+ 'description' => Fog::Nullable::String,
7
+ 'hypervisor' => String,
7
8
  'imageId' => String,
8
9
  'imageLocation' => String,
10
+ 'imageOwnerAlias' => Fog::Nullable::String,
9
11
  'imageOwnerId' => String,
10
12
  'imageState' => String,
11
13
  'imageType' => String,
12
14
  'isPublic' => Fog::Boolean,
13
15
  'kernelId' => String,
16
+ 'name' => String,
17
+ 'platform' => Fog::Nullable::String,
14
18
  'productCodes' => [],
15
- 'ramdiskId' => String,
19
+ 'ramdiskId' => Fog::Nullable::String,
20
+ 'rootDeviceName' => String,
16
21
  'rootDeviceType' => String,
22
+ 'stateReason' => {},
17
23
  'tagSet' => {},
18
24
  'virtualizationType' => String
19
25
  }],
20
26
  'requestId' => String,
21
27
  }
22
28
 
23
- tests('success') do
29
+ @register_image_format = {
30
+ 'imageId' => String,
31
+ 'requestId' => String
32
+ }
24
33
 
34
+ tests('success') do
25
35
  # the result for this is HUGE and relatively uninteresting...
26
36
  # tests("#describe_images").formats(@images_format) do
27
37
  # Fog::Compute[:aws].describe_images.body
28
38
  # end
39
+ @image_id = 'ami-1aad5273'
40
+
41
+ if Fog.mocking?
42
+ tests("#register_image").formats(@register_image_format) do
43
+ @image = Fog::Compute[:aws].register_image('image', 'image', '/dev/sda1').body
44
+ end
45
+
46
+ @image_id = @image['imageId']
47
+ sleep 1
29
48
 
30
- tests("#describe_images('ImageId' => '#{GENTOO_AMI}')").formats(@images_format) do
31
- pending if Fog.mocking?
32
- Fog::Compute[:aws].describe_images('ImageId' => GENTOO_AMI).body
49
+ tests("#describe_images('Owner' => 'self')").formats(@describe_images_format) do
50
+ Fog::Compute[:aws].describe_images('Owner' => 'self').body
51
+ end
52
+
53
+ tests("#describe_images('state' => 'available')").formats(@describe_images_format) do
54
+ Fog::Compute[:aws].describe_images('state' => 'available').body
55
+ end
33
56
  end
34
57
 
35
- end
58
+ tests("#describe_images('image-id' => '#{@image_id}')").formats(@describe_images_format) do
59
+ @other_image = Fog::Compute[:aws].describe_images('image-id' => @image_id).body
60
+ end
36
61
 
62
+ unless Fog.mocking?
63
+ tests("#describe_images('Owner' => '#{@other_image['imageOwnerAlias']}', 'image-id' => '#{@image_id}')").formats(@describe_images_format) do
64
+ Fog::Compute[:aws].describe_images('Owner' => @other_image['imageOwnerAlias'], 'image-id' => @image_id).body
65
+ end
66
+ end
67
+ end
37
68
  end
@@ -30,7 +30,7 @@ Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
30
30
 
31
31
  tests('failure') do
32
32
 
33
- tests("#update_account").returns(nil) do
33
+ tests("#update_account").raises(ArgumentError) do
34
34
  pending if Fog.mocking?
35
35
  Fog::Compute[:brightbox].update_account
36
36
  end
@@ -103,6 +103,7 @@ class Brightbox
103
103
  "url" => String,
104
104
  "id" => String,
105
105
  "ipv4_address" => String,
106
+ "ipv6_address" => Fog::Nullable::String,
106
107
  "mac_address" => String
107
108
  }
108
109
 
@@ -281,6 +282,7 @@ class Brightbox
281
282
  "verified_telephone" => Fog::Nullable::String,
282
283
  "verified_at" => Fog::Nullable::String,
283
284
  "verified_ip" => Fog::Nullable::String,
285
+ "valid_credit_card" => Fog::Boolean,
284
286
  "owner" => Brightbox::Compute::Formats::Nested::USER,
285
287
  "users" => [Brightbox::Compute::Formats::Nested::USER],
286
288
  "clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
@@ -338,6 +340,7 @@ class Brightbox
338
340
  "url" => String,
339
341
  "id" => String,
340
342
  "ipv4_address" => String,
343
+ "ipv6_address" => Fog::Nullable::String,
341
344
  "mac_address" => String,
342
345
  "server" => Brightbox::Compute::Formats::Nested::SERVER
343
346
  }
@@ -55,7 +55,7 @@ Shindo.tests('Fog::Compute[:brightbox] | load balancer requests', ['brightbox'])
55
55
 
56
56
  tests('failure') do
57
57
 
58
- tests("#create_load_balancer").raises(Excon::Errors::BadRequest) do
58
+ tests("#create_load_balancer").raises(ArgumentError) do
59
59
  pending if Fog.mocking?
60
60
  Fog::Compute[:brightbox].create_load_balancer
61
61
  end
@@ -13,7 +13,7 @@ Shindo.tests('Fog::Compute[:voxel] | server requests', ['voxel']) do
13
13
  'access_methods' => [],
14
14
  'description' => String,
15
15
  'drives' => [{
16
- 'position' => Fog::Nullable::Integer,
16
+ 'position' => Fog::Nullable::String,
17
17
  'size' => Integer
18
18
  }],
19
19
  'id' => String,
@@ -34,7 +34,7 @@ Shindo.tests('Fog::Compute[:voxel] | server requests', ['voxel']) do
34
34
  'id' => String,
35
35
  'value' => String
36
36
  },
37
- 'position' => Fog::Nullable::Integer,
37
+ 'position' => Fog::Nullable::String,
38
38
  'rack' => {
39
39
  'id' => String,
40
40
  'value' => String
data/tests/dns/helper.rb CHANGED
@@ -15,6 +15,12 @@ def dns_providers
15
15
  :dnsmadeeasy => {
16
16
  :mocked => false
17
17
  },
18
+ :dynect => {
19
+ :mocked => false,
20
+ :zone_attributes => {
21
+ :email => 'fog@example.com'
22
+ }
23
+ },
18
24
  :linode => {
19
25
  :mocked => false,
20
26
  :zone_attributes => {
@@ -29,3 +35,15 @@ def dns_providers
29
35
  }
30
36
  }
31
37
  end
38
+
39
+ def generate_unique_domain( with_trailing_dot = false)
40
+ #get time (with 1/100th of sec accuracy)
41
+ #want unique domain name and if provider is fast, this can be called more than once per second
42
+ time= (Time.now.to_f * 100).to_i
43
+ domain = 'test-' + time.to_s + '.com'
44
+ if with_trailing_dot
45
+ domain+= '.'
46
+ end
47
+
48
+ domain
49
+ end
@@ -3,7 +3,7 @@ for provider, config in dns_providers
3
3
  # FIXME: delay/timing breaks things :(
4
4
  next if [:dnsmadeeasy].include?(provider)
5
5
 
6
- Shindo.tests("Fog::DNS[:#{provider}] | record", [provider]) do
6
+ Shindo.tests("Fog::DNS[:#{provider}] | record", [provider.to_s]) do
7
7
 
8
8
  record_attributes = {
9
9
  :name => 'www.fogrecordtests.com',
@@ -17,6 +17,7 @@ for provider, config in dns_providers
17
17
  }.merge(config[:zone_attributes] || {})
18
18
 
19
19
  @zone = Fog::DNS[provider].zones.create(zone_attributes)
20
+
20
21
  model_tests(@zone.records, record_attributes, config[:mocked])
21
22
 
22
23
  @zone.destroy
@@ -24,4 +25,4 @@ for provider, config in dns_providers
24
25
 
25
26
  end
26
27
 
27
- end
28
+ end
@@ -3,7 +3,7 @@ for provider, config in dns_providers
3
3
  # FIXME: delay/timing breaks things :(
4
4
  next if [:dnsmadeeasy].include?(provider)
5
5
 
6
- Shindo.tests("Fog::DNS[:#{provider}] | records", [provider]) do
6
+ Shindo.tests("Fog::DNS[:#{provider}] | records", [provider.to_s]) do
7
7
 
8
8
  record_attributes = {
9
9
  :name => 'www.fogrecordstests.com',
@@ -25,4 +25,4 @@ for provider, config in dns_providers
25
25
 
26
26
  end
27
27
 
28
- end
28
+ end
@@ -3,7 +3,7 @@ for provider, config in dns_providers
3
3
  # FIXME: delay/timing breaks things :(
4
4
  next if [:dnsmadeeasy].include?(provider)
5
5
 
6
- Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider]) do
6
+ Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider.to_s]) do
7
7
 
8
8
  zone_attributes = {
9
9
  :domain => 'fogzonetests.com'
@@ -13,4 +13,4 @@ for provider, config in dns_providers
13
13
 
14
14
  end
15
15
 
16
- end
16
+ end
@@ -3,7 +3,7 @@ for provider, config in dns_providers
3
3
  # FIXME: delay/timing breaks things :(
4
4
  next if [:dnsmadeeasy].include?(provider)
5
5
 
6
- Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider]) do
6
+ Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider.to_s]) do
7
7
 
8
8
  zone_attributes = {
9
9
  :domain => 'fogzonestests.com'
@@ -4,18 +4,6 @@ Shindo.tests('Fog::DNS[:bluebox] | DNS requests', ['bluebox', 'dns']) do
4
4
  @new_zones = []
5
5
  @new_records =[]
6
6
 
7
- def generate_unique_domain(with_trailing_dot = false)
8
- #get time (with 1/100th of sec accuracy)
9
- #want unique domain name and if provider is fast, this can be called more than once per second
10
- time= (Time.now.to_f * 100).to_i
11
- domain = 'test-' + time.to_s + '.com'
12
- if with_trailing_dot
13
- domain+= '.'
14
- end
15
-
16
- domain
17
- end
18
-
19
7
  tests( 'success') do
20
8
 
21
9
  test('get current zone count') do
@@ -3,18 +3,6 @@ Shindo.tests('Fog::DNS[:dnsimple] | DNS requests', ['dnsimple', 'dns']) do
3
3
  @domain = ''
4
4
  @domain_count = 0
5
5
 
6
- def generate_unique_domain( with_trailing_dot = false)
7
- #get time (with 1/100th of sec accuracy)
8
- #want unique domain name and if provider is fast, this can be called more than once per second
9
- time= (Time.now.to_f * 100).to_i
10
- domain = 'test-' + time.to_s + '.com'
11
- if with_trailing_dot
12
- domain+= '.'
13
- end
14
-
15
- domain
16
- end
17
-
18
6
  tests("success") do
19
7
 
20
8
  test("get current domain count") do
@@ -3,18 +3,6 @@ Shindo.tests('Fog::DNS[:dnsmadeeasy] | DNS requests', ['dnsmadeeasy', 'dns']) do
3
3
  @domain = ''
4
4
  @domain_count = 0
5
5
 
6
- def generate_unique_domain( with_trailing_dot = false)
7
- #get time (with 1/100th of sec accuracy)
8
- #want unique domain name and if provider is fast, this can be called more than once per second
9
- time= (Time.now.to_f * 100).to_i
10
- domain = 'test-' + time.to_s + '.com'
11
- if with_trailing_dot
12
- domain+= '.'
13
- end
14
-
15
- domain
16
- end
17
-
18
6
  tests("success") do
19
7
 
20
8
  test("get current domain count") do
@@ -0,0 +1,132 @@
1
+ Shindo.tests('Dynect::dns | DNS requests', ['dynect', 'dns']) do
2
+
3
+ pending if Fog.mocking?
4
+
5
+ shared_format = {
6
+ 'job_id' => Integer,
7
+ 'msgs' => [{
8
+ 'ERR_CD' => Fog::Nullable::String,
9
+ 'INFO' => String,
10
+ 'LVL' => String,
11
+ 'SOURCE' => String
12
+ }],
13
+ 'status' => String
14
+ }
15
+
16
+ tests "success" do
17
+
18
+ @dns = Fog::DNS[:dynect]
19
+ @domain = generate_unique_domain
20
+ @fqdn = "www.#{@domain}"
21
+
22
+ post_session_format = shared_format.merge({
23
+ 'data' => {
24
+ 'token' => String,
25
+ 'version' => String
26
+ }
27
+ })
28
+
29
+ tests("post_session").formats(post_session_format) do
30
+ @dns.post_session.body
31
+ end
32
+
33
+ post_zone_format = shared_format.merge({
34
+ 'data' => {
35
+ 'serial' => Integer,
36
+ 'zone' => String,
37
+ 'zone_type' => String,
38
+ 'serial_style' => String
39
+ }
40
+ })
41
+
42
+ tests("post_zone('netops@#{@domain}', 3600, '#{@domain}')").formats(post_zone_format) do
43
+ @dns.post_zone("netops@#{@domain}", 3600, @domain).body
44
+ end
45
+
46
+ get_zones_format = shared_format.merge({
47
+ 'data' => [String]
48
+ })
49
+
50
+ tests("get_zone").formats(get_zones_format) do
51
+ @dns.get_zone.body
52
+ end
53
+
54
+ get_zone_format = shared_format.merge({
55
+ 'data' => {
56
+ "serial" => Integer,
57
+ "serial_style" => String,
58
+ "zone" => String,
59
+ "zone_type" => String
60
+ }
61
+ })
62
+
63
+ tests("get_zone('zone' => '#{@domain}')").formats(get_zone_format) do
64
+ @dns.get_zone('zone' => @domain).body
65
+ end
66
+
67
+ post_record_format = shared_format.merge({
68
+ 'data' => {
69
+ 'fqdn' => String,
70
+ 'rdata' => {
71
+ 'address' => String
72
+ },
73
+ 'record_id' => Integer,
74
+ 'record_type' => String,
75
+ 'ttl' => Integer,
76
+ 'zone' => String
77
+ }
78
+ })
79
+
80
+ tests("post_record('A', '#{@domain}', '#{@fqdn}', 'address' => '1.2.3.4')").formats(post_record_format) do
81
+ @dns.post_record('A', @domain, @fqdn, {'address' => '1.2.3.4'}, {}).body
82
+ end
83
+
84
+ put_zone_format = shared_format.merge({
85
+ 'data' => {
86
+ 'serial' => Integer,
87
+ 'serial_style' => String,
88
+ 'zone' => String,
89
+ 'zone_type' => String
90
+ }
91
+ })
92
+
93
+ tests("put_zone('#{@domain}', :publish => true)").formats(put_zone_format) do
94
+ @dns.put_zone(@domain, :publish => true).body
95
+ end
96
+
97
+ get_node_list_format = shared_format.merge({
98
+ 'data' => [String]
99
+ })
100
+
101
+ tests("get_node_list('#{@domain}')").formats(get_node_list_format) do
102
+ @dns.get_node_list(@domain).body
103
+ end
104
+
105
+ get_records_format = shared_format.merge({
106
+ 'data' => [String]
107
+ })
108
+
109
+ tests("get_record('A', '#{@domain}', '#{@fqdn}')").formats(get_records_format) do
110
+ data = @dns.get_record('A', @domain, @fqdn).body
111
+ @record_id = data['data'].first.split('/').last
112
+ data
113
+ end
114
+
115
+ delete_record_format = shared_format.merge({
116
+ 'data' => {}
117
+ })
118
+
119
+ tests("delete_record('A', '#{@domain}', '#{@fqdn}', '#{@record_id}')").formats(delete_record_format) do
120
+ @dns.delete_record('A', @domain, "#{@fqdn}", @record_id).body
121
+ end
122
+
123
+ delete_zone_format = shared_format.merge({
124
+ 'data' => {}
125
+ })
126
+
127
+ tests("delete_zone('#{@domain}')").formats(delete_zone_format) do
128
+ @dns.delete_zone(@domain).body
129
+ end
130
+
131
+ end
132
+ end
@@ -3,19 +3,7 @@ Shindo.tests('Fog::DNS[:linode] | DNS requests', ['linode', 'dns']) do
3
3
  @domain = ''
4
4
  @new_zones = []
5
5
  @new_records =[]
6
-
7
- def generate_unique_domain( with_trailing_dot = false)
8
- #get time (with 1/100th of sec accuracy)
9
- #want unique domain name and if provider is fast, this can be called more than once per second
10
- time= (Time.now.to_f * 100).to_i
11
- domain = 'test-' + time.to_s + '.com'
12
- if with_trailing_dot
13
- domain+= '.'
14
- end
15
-
16
- domain
17
- end
18
-
6
+
19
7
  tests( 'success') do
20
8
 
21
9
  test('get current zone count') do