fog 1.19.0 → 1.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (533) hide show
  1. data/.gitignore +2 -0
  2. data/.travis.yml +10 -0
  3. data/CONTRIBUTORS.md +694 -0
  4. data/Gemfile.1.8.7 +1 -1
  5. data/LICENSE.md +17 -17
  6. data/Rakefile +1 -1
  7. data/benchs/each_provider.sh +6 -0
  8. data/benchs/each_service.sh +6 -0
  9. data/benchs/load_times.rb +6 -0
  10. data/changelog.txt +312 -0
  11. data/fog.gemspec +3 -5
  12. data/lib/fog.rb +1 -0
  13. data/lib/fog/atmos.rb +1 -11
  14. data/lib/fog/atmos/core.rb +11 -0
  15. data/lib/fog/atmos/requests/storage/get_namespace.rb +1 -1
  16. data/lib/fog/atmos/requests/storage/head_namespace.rb +1 -1
  17. data/lib/fog/atmos/storage.rb +1 -1
  18. data/lib/fog/aws.rb +22 -327
  19. data/lib/fog/aws/auto_scaling.rb +1 -1
  20. data/lib/fog/aws/beanstalk.rb +1 -1
  21. data/lib/fog/aws/cdn.rb +1 -1
  22. data/lib/fog/aws/cloud_formation.rb +1 -1
  23. data/lib/fog/aws/cloud_watch.rb +1 -1
  24. data/lib/fog/aws/compute.rb +12 -1
  25. data/lib/fog/aws/core.rb +329 -0
  26. data/lib/fog/aws/data_pipeline.rb +1 -1
  27. data/lib/fog/aws/dns.rb +1 -1
  28. data/lib/fog/aws/dynamodb.rb +1 -1
  29. data/lib/fog/aws/elasticache.rb +10 -3
  30. data/lib/fog/aws/elb.rb +1 -1
  31. data/lib/fog/aws/emr.rb +1 -2
  32. data/lib/fog/aws/glacier.rb +1 -1
  33. data/lib/fog/aws/iam.rb +1 -1
  34. data/lib/fog/aws/models/compute/dhcp_option.rb +2 -2
  35. data/lib/fog/aws/models/compute/flavor.rb +2 -0
  36. data/lib/fog/aws/models/compute/flavors.rb +363 -49
  37. data/lib/fog/aws/models/compute/network_acl.rb +170 -0
  38. data/lib/fog/aws/models/compute/network_acls.rb +138 -0
  39. data/lib/fog/aws/models/compute/server.rb +2 -2
  40. data/lib/fog/aws/models/compute/servers.rb +7 -2
  41. data/lib/fog/aws/models/compute/subnet.rb +2 -2
  42. data/lib/fog/aws/models/elasticache/cluster.rb +6 -0
  43. data/lib/fog/aws/models/elasticache/subnet_group.rb +35 -0
  44. data/lib/fog/aws/models/elasticache/subnet_groups.rb +27 -0
  45. data/lib/fog/aws/models/rds/snapshot.rb +1 -0
  46. data/lib/fog/aws/models/storage/file.rb +1 -1
  47. data/lib/fog/aws/parsers/compute/create_network_acl.rb +28 -0
  48. data/lib/fog/aws/parsers/compute/create_subnet.rb +2 -3
  49. data/lib/fog/aws/parsers/compute/describe_network_acls.rb +42 -0
  50. data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +29 -3
  51. data/lib/fog/aws/parsers/compute/network_acl_parser.rb +105 -0
  52. data/lib/fog/aws/parsers/compute/network_interface_parser.rb +16 -0
  53. data/lib/fog/aws/parsers/compute/replace_network_acl_association.rb +20 -0
  54. data/lib/fog/aws/parsers/compute/run_instances.rb +1 -1
  55. data/lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb +2 -2
  56. data/lib/fog/aws/parsers/elasticache/create_cache_subnet_group.rb +38 -0
  57. data/lib/fog/aws/parsers/elasticache/describe_cache_subnet_groups.rb +38 -0
  58. data/lib/fog/aws/parsers/elasticache/subnet_group_parser.rb +38 -0
  59. data/lib/fog/aws/parsers/iam/upload_server_certificate.rb +1 -1
  60. data/lib/fog/aws/parsers/rds/db_parser.rb +6 -0
  61. data/lib/fog/aws/parsers/rds/snapshot_parser.rb +1 -0
  62. data/lib/fog/aws/rds.rb +1 -1
  63. data/lib/fog/aws/redshift.rb +1 -1
  64. data/lib/fog/aws/requests/compute/associate_address.rb +1 -0
  65. data/lib/fog/aws/requests/compute/create_network_acl.rb +105 -0
  66. data/lib/fog/aws/requests/compute/create_network_acl_entry.rb +80 -0
  67. data/lib/fog/aws/requests/compute/create_subnet.rb +14 -4
  68. data/lib/fog/aws/requests/compute/create_vpc.rb +7 -1
  69. data/lib/fog/aws/requests/compute/delete_network_acl.rb +52 -0
  70. data/lib/fog/aws/requests/compute/delete_network_acl_entry.rb +55 -0
  71. data/lib/fog/aws/requests/compute/delete_vpc.rb +4 -0
  72. data/lib/fog/aws/requests/compute/describe_addresses.rb +1 -1
  73. data/lib/fog/aws/requests/compute/describe_network_acls.rb +104 -0
  74. data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +4 -0
  75. data/lib/fog/aws/requests/compute/disassociate_address.rb +4 -3
  76. data/lib/fog/aws/requests/compute/replace_network_acl_association.rb +66 -0
  77. data/lib/fog/aws/requests/compute/replace_network_acl_entry.rb +81 -0
  78. data/lib/fog/aws/requests/compute/replace_route.rb +84 -0
  79. data/lib/fog/aws/requests/compute/request_spot_instances.rb +8 -0
  80. data/lib/fog/aws/requests/compute/run_instances.rb +23 -3
  81. data/lib/fog/aws/requests/data_pipeline/put_pipeline_definition.rb +29 -21
  82. data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +18 -11
  83. data/lib/fog/aws/requests/elasticache/create_cache_subnet_group.rb +66 -0
  84. data/lib/fog/aws/requests/elasticache/delete_cache_subnet_group.rb +40 -0
  85. data/lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb +63 -0
  86. data/lib/fog/aws/requests/elb/create_load_balancer.rb +3 -2
  87. data/lib/fog/aws/requests/iam/delete_server_certificate.rb +3 -1
  88. data/lib/fog/aws/requests/rds/create_db_instance.rb +2 -0
  89. data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +1 -0
  90. data/lib/fog/aws/requests/rds/create_db_snapshot.rb +1 -1
  91. data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +2 -0
  92. data/lib/fog/aws/requests/rds/modify_db_instance.rb +1 -0
  93. data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +18 -0
  94. data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +23 -0
  95. data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +24 -0
  96. data/lib/fog/aws/requests/storage/put_object.rb +18 -54
  97. data/lib/fog/aws/requests/storage/shared_mock_methods.rb +87 -0
  98. data/lib/fog/aws/requests/storage/upload_part.rb +18 -0
  99. data/lib/fog/aws/ses.rb +1 -1
  100. data/lib/fog/aws/simpledb.rb +1 -1
  101. data/lib/fog/aws/sns.rb +1 -2
  102. data/lib/fog/aws/sqs.rb +5 -4
  103. data/lib/fog/aws/storage.rb +15 -5
  104. data/lib/fog/aws/sts.rb +1 -1
  105. data/lib/fog/bare_metal_cloud.rb +1 -11
  106. data/lib/fog/bare_metal_cloud/compute.rb +1 -1
  107. data/lib/fog/bare_metal_cloud/core.rb +11 -0
  108. data/lib/fog/bin.rb +1 -0
  109. data/lib/fog/bin/rage4.rb +31 -0
  110. data/lib/fog/bluebox.rb +3 -13
  111. data/lib/fog/bluebox/blb.rb +2 -2
  112. data/lib/fog/bluebox/compute.rb +1 -1
  113. data/lib/fog/bluebox/core.rb +13 -0
  114. data/lib/fog/bluebox/dns.rb +2 -2
  115. data/lib/fog/bluebox/models/compute/server.rb +1 -1
  116. data/lib/fog/brightbox.rb +1 -10
  117. data/lib/fog/brightbox/compute.rb +20 -1
  118. data/lib/fog/brightbox/core.rb +10 -0
  119. data/lib/fog/brightbox/models/compute/cloud_ip.rb +5 -0
  120. data/lib/fog/brightbox/models/compute/database_server.rb +91 -0
  121. data/lib/fog/brightbox/models/compute/database_servers.rb +28 -0
  122. data/lib/fog/brightbox/models/compute/database_snapshot.rb +52 -0
  123. data/lib/fog/brightbox/models/compute/database_snapshots.rb +24 -0
  124. data/lib/fog/brightbox/models/compute/database_type.rb +19 -0
  125. data/lib/fog/brightbox/models/compute/database_types.rb +26 -0
  126. data/lib/fog/brightbox/requests/compute/create_database_server.rb +25 -0
  127. data/lib/fog/brightbox/requests/compute/delete_database_server.rb +26 -0
  128. data/lib/fog/brightbox/requests/compute/delete_database_snapshot.rb +26 -0
  129. data/lib/fog/brightbox/requests/compute/get_database_server.rb +19 -0
  130. data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +19 -0
  131. data/lib/fog/brightbox/requests/compute/get_database_type.rb +21 -0
  132. data/lib/fog/brightbox/requests/compute/list_database_servers.rb +17 -0
  133. data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +17 -0
  134. data/lib/fog/brightbox/requests/compute/list_database_types.rb +19 -0
  135. data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +19 -0
  136. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +19 -0
  137. data/lib/fog/brightbox/requests/compute/update_database_server.rb +25 -0
  138. data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +26 -0
  139. data/lib/fog/clodo.rb +1 -34
  140. data/lib/fog/clodo/compute.rb +2 -0
  141. data/lib/fog/clodo/core.rb +34 -0
  142. data/lib/fog/clodo/models/compute/server.rb +2 -2
  143. data/lib/fog/cloudsigma.rb +1 -9
  144. data/lib/fog/cloudsigma/compute.rb +2 -2
  145. data/lib/fog/cloudsigma/core.rb +9 -0
  146. data/lib/fog/cloudstack.rb +1 -40
  147. data/lib/fog/cloudstack/compute.rb +1 -1
  148. data/lib/fog/cloudstack/core.rb +40 -0
  149. data/lib/fog/cloudstack/models/compute/server.rb +3 -0
  150. data/lib/fog/compute/models/server.rb +33 -7
  151. data/lib/fog/core/collection.rb +1 -3
  152. data/lib/fog/core/errors.rb +2 -0
  153. data/lib/fog/core/hmac.rb +3 -16
  154. data/lib/fog/core/logger.rb +3 -3
  155. data/lib/fog/core/provider.rb +1 -2
  156. data/lib/fog/digitalocean.rb +1 -9
  157. data/lib/fog/digitalocean/compute.rb +1 -1
  158. data/lib/fog/digitalocean/core.rb +9 -0
  159. data/lib/fog/digitalocean/models/compute/server.rb +3 -2
  160. data/lib/fog/digitalocean/models/compute/servers.rb +23 -4
  161. data/lib/fog/digitalocean/requests/compute/create_server.rb +2 -1
  162. data/lib/fog/digitalocean/requests/compute/destroy_server.rb +3 -1
  163. data/lib/fog/dnsimple.rb +1 -11
  164. data/lib/fog/dnsimple/core.rb +11 -0
  165. data/lib/fog/dnsimple/dns.rb +5 -2
  166. data/lib/fog/dnsimple/models/dns/record.rb +3 -3
  167. data/lib/fog/dnsimple/requests/dns/create_domain.rb +26 -22
  168. data/lib/fog/dnsimple/requests/dns/create_record.rb +21 -24
  169. data/lib/fog/dnsimple/requests/dns/delete_domain.rb +7 -6
  170. data/lib/fog/dnsimple/requests/dns/delete_record.rb +7 -5
  171. data/lib/fog/dnsimple/requests/dns/get_domain.rb +12 -18
  172. data/lib/fog/dnsimple/requests/dns/get_record.rb +11 -17
  173. data/lib/fog/dnsimple/requests/dns/list_domains.rb +7 -15
  174. data/lib/fog/dnsimple/requests/dns/list_records.rb +10 -15
  175. data/lib/fog/dnsimple/requests/dns/update_record.rb +14 -19
  176. data/lib/fog/dnsmadeeasy.rb +1 -11
  177. data/lib/fog/dnsmadeeasy/core.rb +11 -0
  178. data/lib/fog/dnsmadeeasy/dns.rb +1 -1
  179. data/lib/fog/dreamhost.rb +1 -11
  180. data/lib/fog/dreamhost/core.rb +11 -0
  181. data/lib/fog/dreamhost/dns.rb +1 -1
  182. data/lib/fog/dynect.rb +1 -26
  183. data/lib/fog/dynect/core.rb +26 -0
  184. data/lib/fog/dynect/dns.rb +1 -1
  185. data/lib/fog/dynect/requests/dns/put_record.rb +5 -4
  186. data/lib/fog/dynect/requests/dns/put_zone.rb +5 -4
  187. data/lib/fog/ecloud.rb +1 -31
  188. data/lib/fog/ecloud/compute.rb +1 -0
  189. data/lib/fog/ecloud/core.rb +31 -0
  190. data/lib/fog/glesys.rb +1 -11
  191. data/lib/fog/glesys/compute.rb +6 -4
  192. data/lib/fog/glesys/core.rb +11 -0
  193. data/lib/fog/glesys/models/compute/server.rb +2 -2
  194. data/lib/fog/go_grid.rb +1 -11
  195. data/lib/fog/go_grid/compute.rb +1 -1
  196. data/lib/fog/go_grid/core.rb +11 -0
  197. data/lib/fog/go_grid/models/compute/server.rb +2 -2
  198. data/lib/fog/google.rb +2 -24
  199. data/lib/fog/google/README.md +8 -5
  200. data/lib/fog/google/compute.rb +60 -17
  201. data/lib/fog/google/core.rb +24 -0
  202. data/lib/fog/google/examples/create.rb +12 -1
  203. data/lib/fog/google/examples/eric-fail.rb +13 -2
  204. data/lib/fog/google/examples/image_create.rb +0 -1
  205. data/lib/fog/google/examples/launch_micro_instance.rb +1 -2
  206. data/lib/fog/google/examples/metadata.rb +14 -2
  207. data/lib/fog/google/examples/network.rb +13 -2
  208. data/lib/fog/google/models/compute/disk.rb +12 -11
  209. data/lib/fog/google/models/compute/flavor.rb +1 -0
  210. data/lib/fog/google/models/compute/flavors.rb +1 -1
  211. data/lib/fog/google/models/compute/image.rb +10 -3
  212. data/lib/fog/google/models/compute/images.rb +2 -0
  213. data/lib/fog/google/models/compute/server.rb +27 -4
  214. data/lib/fog/google/models/compute/servers.rb +26 -10
  215. data/lib/fog/google/models/compute/zone.rb +1 -0
  216. data/lib/fog/google/models/compute/zones.rb +1 -1
  217. data/lib/fog/google/requests/compute/attach_disk.rb +29 -0
  218. data/lib/fog/google/requests/compute/delete_address.rb +31 -0
  219. data/lib/fog/google/requests/compute/delete_snapshot.rb +35 -0
  220. data/lib/fog/google/requests/compute/detach_disk.rb +29 -0
  221. data/lib/fog/google/requests/compute/get_address.rb +31 -0
  222. data/lib/fog/google/requests/compute/insert_address.rb +30 -0
  223. data/lib/fog/google/requests/compute/insert_disk.rb +38 -20
  224. data/lib/fog/google/requests/compute/insert_firewall.rb +6 -9
  225. data/lib/fog/google/requests/compute/insert_image.rb +1 -5
  226. data/lib/fog/google/requests/compute/insert_server.rb +13 -29
  227. data/lib/fog/google/requests/compute/list_addresses.rb +28 -0
  228. data/lib/fog/google/requests/compute/set_metadata.rb +4 -5
  229. data/lib/fog/google/requests/compute/set_tags.rb +33 -0
  230. data/lib/fog/google/requests/storage/get_bucket_acl.rb +2 -2
  231. data/lib/fog/google/requests/storage/put_bucket_acl.rb +39 -48
  232. data/lib/fog/google/requests/storage/put_object_acl.rb +55 -0
  233. data/lib/fog/google/storage.rb +2 -1
  234. data/lib/fog/hp.rb +9 -352
  235. data/lib/fog/hp/block_storage.rb +1 -1
  236. data/lib/fog/hp/block_storage_v2.rb +1 -1
  237. data/lib/fog/hp/cdn.rb +1 -1
  238. data/lib/fog/hp/compute.rb +1 -1
  239. data/lib/fog/hp/compute_v2.rb +1 -1
  240. data/lib/fog/hp/core.rb +352 -0
  241. data/lib/fog/hp/dns.rb +1 -1
  242. data/lib/fog/hp/lb.rb +1 -1
  243. data/lib/fog/hp/models/compute/server.rb +2 -2
  244. data/lib/fog/hp/models/compute_v2/server.rb +2 -2
  245. data/lib/fog/hp/models/storage/directory.rb +12 -6
  246. data/lib/fog/hp/network.rb +1 -1
  247. data/lib/fog/hp/storage.rb +1 -1
  248. data/lib/fog/ibm.rb +2 -176
  249. data/lib/fog/ibm/compute.rb +1 -1
  250. data/lib/fog/ibm/core.rb +176 -0
  251. data/lib/fog/ibm/storage.rb +1 -1
  252. data/lib/fog/internet_archive.rb +1 -292
  253. data/lib/fog/internet_archive/core.rb +292 -0
  254. data/lib/fog/internet_archive/models/storage/file.rb +1 -1
  255. data/lib/fog/internet_archive/storage.rb +1 -1
  256. data/lib/fog/joyent.rb +2 -10
  257. data/lib/fog/joyent/compute.rb +1 -1
  258. data/lib/fog/joyent/core.rb +10 -0
  259. data/lib/fog/joyent/errors.rb +1 -0
  260. data/lib/fog/libvirt.rb +1 -11
  261. data/lib/fog/libvirt/compute.rb +1 -1
  262. data/lib/fog/libvirt/core.rb +11 -0
  263. data/lib/fog/libvirt/models/compute/README.md +1 -1
  264. data/lib/fog/libvirt/models/compute/server.rb +6 -6
  265. data/lib/fog/libvirt/models/compute/templates/volume.xml.erb +12 -0
  266. data/lib/fog/libvirt/models/compute/volume.rb +1 -0
  267. data/lib/fog/linode.rb +2 -10
  268. data/lib/fog/linode/compute.rb +1 -1
  269. data/lib/fog/linode/core.rb +10 -0
  270. data/lib/fog/linode/dns.rb +1 -1
  271. data/lib/fog/local.rb +1 -11
  272. data/lib/fog/local/core.rb +11 -0
  273. data/lib/fog/local/storage.rb +1 -1
  274. data/lib/fog/ninefold.rb +1 -12
  275. data/lib/fog/ninefold/compute.rb +1 -1
  276. data/lib/fog/ninefold/core.rb +12 -0
  277. data/lib/fog/openstack.rb +8 -249
  278. data/lib/fog/openstack/compute.rb +3 -1
  279. data/lib/fog/openstack/core.rb +249 -0
  280. data/lib/fog/openstack/docs/compute.md +681 -0
  281. data/lib/fog/openstack/docs/getting_started.md +81 -0
  282. data/lib/fog/openstack/docs/storage.md +441 -0
  283. data/lib/fog/openstack/identity.rb +1 -1
  284. data/lib/fog/openstack/image.rb +1 -1
  285. data/lib/fog/openstack/metering.rb +1 -1
  286. data/lib/fog/openstack/models/compute/server.rb +13 -5
  287. data/lib/fog/openstack/models/compute/servers.rb +13 -0
  288. data/lib/fog/openstack/models/network/network.rb +9 -11
  289. data/lib/fog/openstack/models/network/security_group.rb +32 -0
  290. data/lib/fog/openstack/models/network/security_group_rule.rb +33 -0
  291. data/lib/fog/openstack/models/network/security_group_rules.rb +33 -0
  292. data/lib/fog/openstack/models/network/security_groups.rb +34 -0
  293. data/lib/fog/openstack/models/storage/directories.rb +1 -0
  294. data/lib/fog/openstack/network.rb +19 -1
  295. data/lib/fog/openstack/orchestration.rb +1 -1
  296. data/lib/fog/openstack/requests/compute/add_security_group.rb +24 -0
  297. data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
  298. data/lib/fog/openstack/requests/compute/create_server.rb +3 -3
  299. data/lib/fog/openstack/requests/compute/remove_security_group.rb +24 -0
  300. data/lib/fog/openstack/requests/image/update_image_members.rb +2 -2
  301. data/lib/fog/openstack/requests/network/create_security_group.rb +94 -0
  302. data/lib/fog/openstack/requests/network/create_security_group_rule.rb +79 -0
  303. data/lib/fog/openstack/requests/network/delete_security_group.rb +32 -0
  304. data/lib/fog/openstack/requests/network/delete_security_group_rule.rb +36 -0
  305. data/lib/fog/openstack/requests/network/get_security_group.rb +52 -0
  306. data/lib/fog/openstack/requests/network/get_security_group_rule.rb +47 -0
  307. data/lib/fog/openstack/requests/network/list_networks.rb +0 -1
  308. data/lib/fog/openstack/requests/network/list_security_group_rules.rb +52 -0
  309. data/lib/fog/openstack/requests/network/list_security_groups.rb +57 -0
  310. data/lib/fog/openstack/storage.rb +2 -2
  311. data/lib/fog/openstack/volume.rb +1 -1
  312. data/lib/fog/openvz.rb +1 -9
  313. data/lib/fog/openvz/compute.rb +1 -1
  314. data/lib/fog/openvz/core.rb +9 -0
  315. data/lib/fog/ovirt.rb +1 -17
  316. data/lib/fog/ovirt/compute.rb +2 -0
  317. data/lib/fog/ovirt/core.rb +17 -0
  318. data/lib/fog/rackspace.rb +12 -145
  319. data/lib/fog/rackspace/auto_scale.rb +1 -1
  320. data/lib/fog/rackspace/block_storage.rb +5 -1
  321. data/lib/fog/rackspace/cdn.rb +22 -16
  322. data/lib/fog/rackspace/compute.rb +1 -1
  323. data/lib/fog/rackspace/compute_v2.rb +6 -2
  324. data/lib/fog/rackspace/core.rb +145 -0
  325. data/lib/fog/rackspace/databases.rb +5 -1
  326. data/lib/fog/rackspace/dns.rb +1 -1
  327. data/lib/fog/rackspace/docs/compute_v2.md +2 -10
  328. data/lib/fog/rackspace/errors.rb +1 -1
  329. data/lib/fog/rackspace/examples/storage/upload_file.rb +1 -1
  330. data/lib/fog/rackspace/identity.rb +26 -16
  331. data/lib/fog/rackspace/load_balancers.rb +7 -1
  332. data/lib/fog/rackspace/mock_data.rb +17 -0
  333. data/lib/fog/rackspace/models/compute/server.rb +2 -2
  334. data/lib/fog/rackspace/models/compute_v2/key_pair.rb +1 -1
  335. data/lib/fog/rackspace/models/compute_v2/server.rb +42 -5
  336. data/lib/fog/rackspace/models/monitoring/entities.rb +1 -1
  337. data/lib/fog/rackspace/models/queues/claim.rb +9 -1
  338. data/lib/fog/rackspace/models/storage/directory.rb +5 -2
  339. data/lib/fog/rackspace/models/storage/file.rb +14 -0
  340. data/lib/fog/rackspace/monitoring.rb +11 -2
  341. data/lib/fog/rackspace/queues.rb +318 -34
  342. data/lib/fog/rackspace/requests/compute_v2/create_keypair.rb +16 -5
  343. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +7 -1
  344. data/lib/fog/rackspace/requests/compute_v2/delete_keypair.rb +1 -1
  345. data/lib/fog/rackspace/requests/identity/create_token.rb +192 -0
  346. data/lib/fog/rackspace/requests/identity/list_tenants.rb +23 -0
  347. data/lib/fog/rackspace/requests/monitoring/get_agent.rb +45 -0
  348. data/lib/fog/rackspace/requests/monitoring/get_cpus_info.rb +63 -0
  349. data/lib/fog/rackspace/requests/monitoring/get_disks_info.rb +56 -0
  350. data/lib/fog/rackspace/requests/monitoring/get_filesystems_info.rb +64 -0
  351. data/lib/fog/rackspace/requests/monitoring/get_logged_in_user_info.rb +58 -0
  352. data/lib/fog/rackspace/requests/monitoring/get_memory_info.rb +59 -0
  353. data/lib/fog/rackspace/requests/monitoring/get_network_interfaces_info.rb +91 -0
  354. data/lib/fog/rackspace/requests/monitoring/get_processes_info.rb +72 -0
  355. data/lib/fog/rackspace/requests/monitoring/get_system_info.rb +53 -0
  356. data/lib/fog/rackspace/requests/monitoring/list_agents.rb +62 -0
  357. data/lib/fog/rackspace/requests/queues/create_claim.rb +37 -0
  358. data/lib/fog/rackspace/requests/queues/create_message.rb +23 -0
  359. data/lib/fog/rackspace/requests/queues/create_queue.rb +15 -1
  360. data/lib/fog/rackspace/requests/queues/delete_claim.rb +18 -0
  361. data/lib/fog/rackspace/requests/queues/delete_message.rb +34 -0
  362. data/lib/fog/rackspace/requests/queues/delete_queue.rb +12 -0
  363. data/lib/fog/rackspace/requests/queues/get_claim.rb +15 -0
  364. data/lib/fog/rackspace/requests/queues/get_message.rb +17 -0
  365. data/lib/fog/rackspace/requests/queues/get_queue.rb +14 -1
  366. data/lib/fog/rackspace/requests/queues/get_queue_stats.rb +36 -0
  367. data/lib/fog/rackspace/requests/queues/list_messages.rb +33 -0
  368. data/lib/fog/rackspace/requests/queues/list_queues.rb +35 -1
  369. data/lib/fog/rackspace/requests/queues/update_claim.rb +17 -0
  370. data/lib/fog/rackspace/requests/storage/delete_container.rb +15 -0
  371. data/lib/fog/rackspace/requests/storage/delete_multiple_objects.rb +57 -0
  372. data/lib/fog/rackspace/requests/storage/delete_object.rb +14 -0
  373. data/lib/fog/rackspace/requests/storage/delete_static_large_object.rb +33 -0
  374. data/lib/fog/rackspace/requests/storage/extract_archive.rb +39 -0
  375. data/lib/fog/rackspace/requests/storage/get_container.rb +25 -0
  376. data/lib/fog/rackspace/requests/storage/get_containers.rb +17 -0
  377. data/lib/fog/rackspace/requests/storage/get_object.rb +26 -0
  378. data/lib/fog/rackspace/requests/storage/get_object_http_url.rb +9 -2
  379. data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +8 -1
  380. data/lib/fog/rackspace/requests/storage/head_container.rb +12 -0
  381. data/lib/fog/rackspace/requests/storage/head_containers.rb +19 -0
  382. data/lib/fog/rackspace/requests/storage/head_object.rb +26 -0
  383. data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +10 -0
  384. data/lib/fog/rackspace/requests/storage/put_container.rb +16 -0
  385. data/lib/fog/rackspace/requests/storage/put_dynamic_obj_manifest.rb +23 -0
  386. data/lib/fog/rackspace/requests/storage/put_object.rb +39 -0
  387. data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +9 -1
  388. data/lib/fog/rackspace/requests/storage/put_static_obj_manifest.rb +48 -0
  389. data/lib/fog/rackspace/storage.rb +320 -67
  390. data/lib/fog/rage4.rb +2 -0
  391. data/lib/fog/rage4/core.rb +11 -0
  392. data/lib/fog/rage4/dns.rb +74 -0
  393. data/lib/fog/rage4/models/dns/record.rb +77 -0
  394. data/lib/fog/rage4/models/dns/records.rb +42 -0
  395. data/lib/fog/rage4/models/dns/zone.rb +46 -0
  396. data/lib/fog/rage4/models/dns/zones.rb +34 -0
  397. data/lib/fog/rage4/requests/dns/create_domain.rb +33 -0
  398. data/lib/fog/rage4/requests/dns/create_domain_vanity.rb +34 -0
  399. data/lib/fog/rage4/requests/dns/create_record.rb +65 -0
  400. data/lib/fog/rage4/requests/dns/create_reverse_domain_4.rb +32 -0
  401. data/lib/fog/rage4/requests/dns/delete_domain.rb +28 -0
  402. data/lib/fog/rage4/requests/dns/delete_record.rb +28 -0
  403. data/lib/fog/rage4/requests/dns/get_domain.rb +30 -0
  404. data/lib/fog/rage4/requests/dns/get_domain_by_name.rb +30 -0
  405. data/lib/fog/rage4/requests/dns/list_domains.rb +41 -0
  406. data/lib/fog/rage4/requests/dns/list_geo_regions.rb +27 -0
  407. data/lib/fog/rage4/requests/dns/list_record_types.rb +26 -0
  408. data/lib/fog/rage4/requests/dns/list_records.rb +31 -0
  409. data/lib/fog/rage4/requests/dns/set_record_failover.rb +29 -0
  410. data/lib/fog/rage4/requests/dns/show_current_usage.rb +25 -0
  411. data/lib/fog/rage4/requests/dns/show_global_usage.rb +25 -0
  412. data/lib/fog/rage4/requests/dns/update_domain.rb +43 -0
  413. data/lib/fog/rage4/requests/dns/update_record.rb +64 -0
  414. data/lib/fog/riakcs.rb +2 -122
  415. data/lib/fog/riakcs/core.rb +122 -0
  416. data/lib/fog/riakcs/provisioning.rb +1 -1
  417. data/lib/fog/riakcs/usage.rb +1 -1
  418. data/lib/fog/serverlove.rb +1 -10
  419. data/lib/fog/serverlove/compute.rb +2 -0
  420. data/lib/fog/serverlove/core.rb +10 -0
  421. data/lib/fog/storm_on_demand.rb +9 -20
  422. data/lib/fog/storm_on_demand/account.rb +1 -1
  423. data/lib/fog/storm_on_demand/billing.rb +1 -1
  424. data/lib/fog/storm_on_demand/compute.rb +1 -1
  425. data/lib/fog/storm_on_demand/core.rb +20 -0
  426. data/lib/fog/storm_on_demand/dns.rb +1 -1
  427. data/lib/fog/storm_on_demand/monitoring.rb +1 -1
  428. data/lib/fog/storm_on_demand/network.rb +1 -1
  429. data/lib/fog/storm_on_demand/shared.rb +0 -1
  430. data/lib/fog/storm_on_demand/storage.rb +1 -1
  431. data/lib/fog/storm_on_demand/support.rb +1 -1
  432. data/lib/fog/storm_on_demand/vpn.rb +1 -1
  433. data/lib/fog/vcloud.rb +1 -11
  434. data/lib/fog/vcloud/compute.rb +1 -1
  435. data/lib/fog/vcloud/core.rb +11 -0
  436. data/lib/fog/vcloud_director.rb +1 -67
  437. data/lib/fog/vcloud_director/compute.rb +1 -1
  438. data/lib/fog/vcloud_director/core.rb +67 -0
  439. data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +1 -1
  440. data/lib/fog/version.rb +1 -1
  441. data/lib/fog/vmfusion.rb +1 -11
  442. data/lib/fog/vmfusion/compute.rb +1 -1
  443. data/lib/fog/vmfusion/core.rb +11 -0
  444. data/lib/fog/vmfusion/models/compute/server.rb +5 -5
  445. data/lib/fog/voxel.rb +1 -16
  446. data/lib/fog/voxel/compute.rb +1 -1
  447. data/lib/fog/voxel/core.rb +16 -0
  448. data/lib/fog/vsphere.rb +1 -17
  449. data/lib/fog/vsphere/compute.rb +1 -0
  450. data/lib/fog/vsphere/core.rb +17 -0
  451. data/lib/fog/xenserver.rb +1 -83
  452. data/lib/fog/xenserver/compute.rb +1 -1
  453. data/lib/fog/xenserver/core.rb +83 -0
  454. data/lib/fog/xenserver/models/compute/storage_manager.rb +1 -1
  455. data/lib/fog/zerigo.rb +1 -11
  456. data/lib/fog/zerigo/core.rb +11 -0
  457. data/lib/fog/zerigo/dns.rb +1 -1
  458. data/lib/tasks/changelog_task.rb +2 -0
  459. data/tests/aws/models/compute/network_acl_tests.rb +109 -0
  460. data/tests/aws/models/compute/network_acls_tests.rb +7 -0
  461. data/tests/aws/models/elasticache/subnet_groups_tests.rb +44 -0
  462. data/tests/aws/requests/compute/network_acl_tests.rb +86 -0
  463. data/tests/aws/requests/compute/route_tests.rb +64 -3
  464. data/tests/aws/requests/compute/subnet_tests.rb +18 -11
  465. data/tests/aws/requests/elasticache/helper.rb +19 -0
  466. data/tests/aws/requests/elasticache/subnet_group_tests.rb +52 -0
  467. data/tests/aws/requests/iam/server_certificate_tests.rb +3 -0
  468. data/tests/aws/requests/rds/subnet_groups_tests.rb +1 -1
  469. data/tests/aws/requests/storage/multipart_upload_tests.rb +3 -14
  470. data/tests/brightbox/compute/schema.rb +118 -2
  471. data/tests/brightbox/helper.rb +1 -0
  472. data/tests/brightbox/models/compute/cloud_ip_tests.rb +32 -0
  473. data/tests/brightbox/models/compute/database_server_tests.rb +66 -0
  474. data/tests/brightbox/models/compute/database_snapshot_tests.rb +26 -0
  475. data/tests/brightbox/models/compute/database_type_tests.rb +27 -0
  476. data/tests/brightbox/requests/compute/database_server_tests.rb +54 -0
  477. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +47 -0
  478. data/tests/brightbox/requests/compute/database_type_tests.rb +17 -0
  479. data/tests/compute/models/server_tests.rb +20 -2
  480. data/tests/digitalocean/helper.rb +9 -4
  481. data/tests/digitalocean/models/compute/server_tests.rb +1 -0
  482. data/tests/digitalocean/models/compute/servers_tests.rb +19 -4
  483. data/tests/digitalocean/requests/compute/create_server_tests.rb +13 -6
  484. data/tests/digitalocean/requests/compute/list_servers_tests.rb +2 -1
  485. data/tests/dns/helper.rb +3 -0
  486. data/tests/dns/models/record_tests.rb +1 -1
  487. data/tests/dns/models/records_tests.rb +1 -1
  488. data/tests/dns/models/zone_tests.rb +1 -1
  489. data/tests/dns/models/zones_tests.rb +1 -1
  490. data/tests/google/helpers/disk_helper.rb +12 -0
  491. data/tests/google/models/compute/server_tests.rb +4 -1
  492. data/tests/google/models/compute/servers_tests.rb +4 -1
  493. data/tests/google/requests/compute/image_tests.rb +0 -1
  494. data/tests/google/requests/compute/server_tests.rb +2 -1
  495. data/tests/helper.rb +7 -1
  496. data/tests/helpers/compute/server_helper.rb +1 -0
  497. data/tests/helpers/compute/servers_helper.rb +1 -0
  498. data/tests/openstack/models/network/security_group_rule_tests.rb +27 -0
  499. data/tests/openstack/models/network/security_group_rules_tests.rb +25 -0
  500. data/tests/openstack/models/network/security_group_tests.rb +17 -0
  501. data/tests/openstack/models/network/security_groups_tests.rb +16 -0
  502. data/tests/openstack/requests/compute/helper.rb +5 -0
  503. data/tests/openstack/requests/compute/server_tests.rb +11 -0
  504. data/tests/openstack/requests/network/security_group_rule_tests.rb +58 -0
  505. data/tests/openstack/requests/network/security_group_tests.rb +43 -0
  506. data/tests/rackspace/identity_tests.rb +0 -4
  507. data/tests/rackspace/models/compute_v2/server_tests.rb +36 -8
  508. data/tests/rackspace/models/queues/claim_tests.rb +1 -3
  509. data/tests/rackspace/models/queues/claims_tests.rb +1 -3
  510. data/tests/rackspace/models/queues/message_tests.rb +1 -3
  511. data/tests/rackspace/models/queues/messages_tests.rb +1 -3
  512. data/tests/rackspace/models/queues/queue_tests.rb +1 -3
  513. data/tests/rackspace/models/queues/queues_tests.rb +1 -3
  514. data/tests/rackspace/models/storage/account_tests.rb +0 -2
  515. data/tests/rackspace/models/storage/directories_tests.rb +0 -3
  516. data/tests/rackspace/models/storage/directory_tests.rb +2 -5
  517. data/tests/rackspace/models/storage/file_tests.rb +49 -2
  518. data/tests/rackspace/models/storage/files_tests.rb +1 -4
  519. data/tests/rackspace/queues_tests.rb +0 -13
  520. data/tests/rackspace/requests/identity/token_tests.rb +1 -3
  521. data/tests/rackspace/requests/monitoring/agent_tests.rb +42 -0
  522. data/tests/rackspace/requests/queues/claim_tests.rb +1 -3
  523. data/tests/rackspace/requests/queues/messages_tests.rb +0 -6
  524. data/tests/rackspace/requests/queues/queues_tests.rb +0 -5
  525. data/tests/rackspace/requests/storage/account_tests.rb +0 -1
  526. data/tests/rackspace/requests/storage/container_tests.rb +7 -11
  527. data/tests/rackspace/requests/storage/large_object_tests.rb +33 -43
  528. data/tests/rackspace/requests/storage/object_tests.rb +2 -27
  529. data/tests/rackspace/storage_tests.rb +9 -15
  530. data/tests/rage4/requests/dns/dns_tests.rb +241 -0
  531. data/tests/vcloud/requests/compute/disk_configure_tests.rb +0 -8
  532. metadata +193 -38
  533. data/lib/fog/brightbox/requests/compute/destroy_user_collaboration.rb +0 -21
@@ -1,7 +1,7 @@
1
1
  for provider, config in dns_providers
2
2
 
3
3
  # FIXME: delay/timing breaks things :(
4
- next if [:dnsmadeeasy].include?(provider)
4
+ next if [:dnsmadeeasy, :rage4].include?(provider)
5
5
 
6
6
  domain_name = uniq_id + '.com'
7
7
 
@@ -1,7 +1,7 @@
1
1
  for provider, config in dns_providers
2
2
 
3
3
  # FIXME: delay/timing breaks things :(
4
- next if [:dnsmadeeasy].include?(provider)
4
+ next if [:dnsmadeeasy, :rage4].include?(provider)
5
5
 
6
6
  domain_name = uniq_id + '.com'
7
7
 
@@ -0,0 +1,12 @@
1
+ # create a disk to be used in tests
2
+ def create_test_disk(connection, zone)
3
+ zone = 'us-central1-a'
4
+ disk = connection.disks.create({
5
+ :name => "fogservername",
6
+ :size_gb => "2",
7
+ :zone_name => zone,
8
+ :source_image => "debian-7-wheezy-v20131120",
9
+ })
10
+ disk.wait_for { ready? }
11
+ disk
12
+ end
@@ -1,6 +1,9 @@
1
1
  Shindo.tests("Fog::Compute[:google] | server model", ['google']) do
2
2
 
3
- model_tests(Fog::Compute[:google].disks, {:name => 'fogservername', :zone_name => 'us-central1-a', :machine_type => 'n1-standard-1'})
3
+ @zone = 'us-central1-a'
4
+ @disk = create_test_disk(Fog::Compute[:google], @zone)
5
+
6
+ model_tests(Fog::Compute[:google].servers, {:name => 'fogservername', :zone_name => @zone, :machine_type => 'n1-standard-1', :disks => [@disk]})
4
7
 
5
8
  tests('servers') do
6
9
  @instance = nil
@@ -1,5 +1,8 @@
1
1
  Shindo.tests("Fog::Compute[:google] | servers", ['google']) do
2
2
 
3
- collection_tests(Fog::Compute[:google].servers, {:name => 'fogservername', :zone_name => 'us-central1-a', :machine_type => 'n1-standard-1'})
3
+ @zone = 'us-central1-a'
4
+ @disk = create_test_disk(Fog::Compute[:google], @zone)
5
+
6
+ collection_tests(Fog::Compute[:google].servers, {:name => 'fogservername', :zone_name => @zone, :machine_type => 'n1-standard-1', :disks => [@disk]})
4
7
 
5
8
  end
@@ -24,7 +24,6 @@ Shindo.tests('Fog::Compute[:google] | image requests', ['google']) do
24
24
  'name' => String,
25
25
  'description' => String,
26
26
  'sourceType' => String,
27
- 'preferredKernel' => String,
28
27
  'rawDisk' => {
29
28
  'containerType' => String,
30
29
  'source' => String
@@ -59,10 +59,11 @@ Shindo.tests('Fog::Compute[:google] | server requests', ['google']) do
59
59
  zone_name = "us-central1-a"
60
60
 
61
61
  tests("#insert_server").formats(@insert_server_format) do
62
+ disk = create_test_disk(Fog::Compute[:google], zone_name)
62
63
  @google.insert_server(
63
64
  server_name,
64
65
  zone_name,
65
- { 'image' => image_name, 'machineType' => machine_type }
66
+ { 'image' => image_name, 'machineType' => machine_type, 'disks' => [disk] }
66
67
  ).body
67
68
  end
68
69
 
@@ -1,6 +1,6 @@
1
1
  require 'simplecov'
2
2
 
3
- if ENV['COVERAGE'] != 'false' && RUBY_VERSION != "1.9.2"
3
+ if ENV['COVERAGE'] == 'true' && RUBY_VERSION != "1.9.2"
4
4
  require 'coveralls'
5
5
  SimpleCov.command_name "shindo:#{Process.pid.to_s}"
6
6
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
@@ -39,6 +39,12 @@ available_providers = Fog.available_providers.map {|provider| provider.downcase}
39
39
 
40
40
  unavailable_providers = all_providers - available_providers
41
41
 
42
+ if !ENV['PROVIDER'].nil? && unavailable_providers.include?(ENV['PROVIDER'])
43
+ Formatador.display_line("[red]Requested provider #{ENV['PROVIDER']} is not available.[/]" +
44
+ "[red]Check if .fog file has correct configuration (see '#{Fog.credentials_path}')[/]")
45
+ exit(0)
46
+ end
47
+
42
48
  for provider in unavailable_providers
43
49
  Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '#{Fog.credentials_path}' to run them)[/]")
44
50
  Thread.current[:tags] << ('-' << provider)
@@ -10,6 +10,7 @@ def server_tests(connection, params = {}, mocks_implemented = true)
10
10
  end
11
11
 
12
12
  responds_to([:ready?, :state])
13
+ yield if block_given?
13
14
 
14
15
  tests('#reboot').succeeds do
15
16
  pending if Fog.mocking? && !mocks_implemented
@@ -4,6 +4,7 @@ def servers_tests(connection, params = {}, mocks_implemented = true)
4
4
 
5
5
  if !Fog.mocking? || mocks_implemented
6
6
  @instance.wait_for { ready? }
7
+ yield if block_given?
7
8
  end
8
9
 
9
10
  end
@@ -0,0 +1,27 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_group_rule model', ['openstack']) do
2
+
3
+ @secgroup = Fog::Network[:openstack].security_groups.create({:name => "fogsecgroup"})
4
+ attributes = {:security_group_id => @secgroup.id, :direction => "ingress"}
5
+ model_tests(Fog::Network[:openstack].security_group_rules, attributes, true)
6
+
7
+ tests('success') do
8
+ tests('#create').succeeds do
9
+ attributes = {
10
+ :security_group_id => @secgroup.id,
11
+ :direction => "ingress",
12
+ :protocol => "tcp",
13
+ :port_range_min => 22,
14
+ :port_range_max => 22,
15
+ :remote_ip_prefix => "0.0.0.0/0"
16
+ }
17
+ @secgrouprule = Fog::Network[:openstack].security_group_rules.create(attributes)
18
+ @secgrouprule.wait_for { ready? } unless Fog.mocking?
19
+ !@secgrouprule.id.nil?
20
+ end
21
+
22
+ tests('#destroy').succeeds do
23
+ @secgrouprule.destroy
24
+ end
25
+ end
26
+ @secgroup.destroy
27
+ end
@@ -0,0 +1,25 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_group_rules collection', ['openstack']) do
2
+
3
+ @secgroup = Fog::Network[:openstack].security_groups.create({:name => "my_secgroup"})
4
+ attributes = {:security_group_id => @secgroup.id, :direction => "ingress"}
5
+ collection_tests(Fog::Network[:openstack].security_group_rules, attributes, true)
6
+
7
+ tests('success') do
8
+ attributes = {
9
+ :security_group_id => @secgroup.id,
10
+ :direction => "ingress",
11
+ :protocol => "tcp",
12
+ :port_range_min => 22,
13
+ :port_range_max => 22,
14
+ :remote_ip_prefix => "0.0.0.0/0"
15
+ }
16
+ @secgrouprule = Fog::Network[:openstack].security_group_rules.create(attributes)
17
+
18
+ tests('#all(filter)').succeeds do
19
+ secgrouprule = Fog::Network[:openstack].security_group_rules.all({:direction => "ingress"})
20
+ secgrouprule.first.direction == "ingress"
21
+ end
22
+ @secgrouprule.destroy
23
+ end
24
+ @secgroup.destroy
25
+ end
@@ -0,0 +1,17 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_group model', ['openstack']) do
2
+
3
+ model_tests(Fog::Network[:openstack].security_groups, {:name => "fogsecgroup"}, true)
4
+
5
+ tests('success') do
6
+ tests('#create').succeeds do
7
+ attributes = {:name => "my_secgroup", :description => "my sec group desc"}
8
+ @secgroup = Fog::Network[:openstack].security_groups.create(attributes)
9
+ @secgroup.wait_for { ready? } unless Fog.mocking?
10
+ !@secgroup.id.nil?
11
+ end
12
+
13
+ tests('#destroy').succeeds do
14
+ @secgroup.destroy
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_groups collection', ['openstack']) do
2
+
3
+ attributes = {:name => "my_secgroup", :description => "my sec group desc"}
4
+ collection_tests(Fog::Network[:openstack].security_groups, attributes, true)
5
+
6
+ tests('success') do
7
+ attributes = {:name => "fogsecgroup", :description => "fog sec group desc"}
8
+ @secgroup = Fog::Network[:openstack].security_groups.create(attributes)
9
+
10
+ tests('#all(filter)').succeeds do
11
+ secgroup = Fog::Network[:openstack].security_groups.all({:name => "fogsecgroup"})
12
+ secgroup.first.name == "fogsecgroup"
13
+ end
14
+ @secgroup.destroy
15
+ end
16
+ end
@@ -35,3 +35,8 @@ def set_password_enabled
35
35
  pw_enabled = ENV['OPENSTACK_SET_PASSWORD_ENABLED'] || "true"
36
36
  return pw_enabled == "true"
37
37
  end
38
+
39
+ def get_security_group_ref
40
+ compute = Fog::Compute[:openstack]
41
+ ENV['OPENSTACK_SECURITY_GROUP_REF'] || compute.list_security_groups.body['security_groups'].first['name']
42
+ end
@@ -49,6 +49,7 @@ Shindo.tests('Fog::Compute[:openstack] | server requests', ['openstack']) do
49
49
  @image_id = get_image_ref
50
50
  @snapshot_id = nil
51
51
  @flavor_id = get_flavor_ref
52
+ @security_group_name = get_security_group_ref
52
53
 
53
54
  tests('#create_server("test", #{@image_id} , 19)').formats(@create_format, false) do
54
55
  data = Fog::Compute[:openstack].create_server("test", @image_id, @flavor_id).body['server']
@@ -112,6 +113,16 @@ Shindo.tests('Fog::Compute[:openstack] | server requests', ['openstack']) do
112
113
  Fog::Compute[:openstack].update_server(@server_id, :name => 'fogupdatedserver')
113
114
  end
114
115
  Fog::Compute[:openstack].servers.get(@server_id).wait_for { ready? }
116
+
117
+ #ADD SECURITY GROUP
118
+ tests("#add_security_group(#{@server_id}, #{@security_group_name})").succeeds do
119
+ Fog::Compute[:openstack].add_security_group(@server_id, @security_group_name)
120
+ end
121
+
122
+ #REMOVE SECURITY GROUP
123
+ tests("#remove_security_group(#{@server_id}, #{@security_group_name})").succeeds do
124
+ Fog::Compute[:openstack].remove_security_group(@server_id, @security_group_name)
125
+ end
115
126
 
116
127
  #CREATE IMAGE WITH METADATA
117
128
  tests("#create_image(#{@server_id}, 'fog')").formats('image' => @image_format) do
@@ -0,0 +1,58 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_grouprule requests', ['openstack']) do
2
+
3
+ @security_group_rule_format = {
4
+ "id" => String,
5
+ "remote_group_id" => Fog::Nullable::String,
6
+ "direction" => String,
7
+ "remote_ip_prefix" => Fog::Nullable::String,
8
+ "protocol" => Fog::Nullable::String,
9
+ "ethertype" => String,
10
+ "port_range_max" => Fog::Nullable::Integer,
11
+ "port_range_min" => Fog::Nullable::Integer,
12
+ "security_group_id" => String,
13
+ "tenant_id" => String
14
+ }
15
+
16
+ tests('success') do
17
+ attributes = {:name => "my_security_group", :description => "tests group"}
18
+ data = Fog::Network[:openstack].create_security_group(attributes).body["security_group"]
19
+ @sec_group_id = data["id"]
20
+ @sec_group_rule_id = nil
21
+
22
+ tests("#create_security_group_rule(#{@sec_group_id}, 'ingress', attributes)").formats(@security_group_rule_format) do
23
+ attributes = {
24
+ :remote_ip_prefix => "0.0.0.0/0",
25
+ :protocol => "tcp",
26
+ :port_range_min => 22,
27
+ :port_range_max => 22
28
+ }
29
+ data = Fog::Network[:openstack].create_security_group_rule(@sec_group_id, 'ingress', attributes).body["security_group_rule"]
30
+ @sec_group_rule_id = data["id"]
31
+ data
32
+ end
33
+
34
+ tests("#get_security_group_rule('#{@sec_group_rule_id}')").formats(@security_group_rule_format) do
35
+ Fog::Network[:openstack].get_security_group_rule(@sec_group_rule_id).body["security_group_rule"]
36
+ end
37
+
38
+ tests("#list_security_group_rules").formats("security_group_rules" => [@security_group_rule_format]) do
39
+ Fog::Network[:openstack].list_security_group_rules.body
40
+ end
41
+
42
+ tests("#delete_security_group_rule('#{@sec_group_rule_id}')").succeeds do
43
+ Fog::Network[:openstack].delete_security_group_rule(@sec_group_rule_id)
44
+ end
45
+
46
+ end
47
+
48
+ tests('failure') do
49
+ tests('#get_security_group_rule(0)').raises(Fog::Network::OpenStack::NotFound) do
50
+ Fog::Network[:openstack].get_security_group_rule(0)
51
+ end
52
+
53
+ tests('#delete_security_group_rule(0)').raises(Fog::Network::OpenStack::NotFound) do
54
+ Fog::Network[:openstack].delete_security_group_rule(0)
55
+ end
56
+ end
57
+ Fog::Network[:openstack].delete_security_group(@sec_group_id)
58
+ end
@@ -0,0 +1,43 @@
1
+ Shindo.tests('Fog::Network[:openstack] | security_group requests', ['openstack']) do
2
+
3
+ @security_group_format = {
4
+ "id" => String,
5
+ "name" => String,
6
+ "description" => String,
7
+ "tenant_id" => String,
8
+ "security_group_rules" => [Hash]
9
+ }
10
+
11
+ tests('success') do
12
+ @sec_group_id = nil
13
+
14
+ tests("#create_security_group('fog_security_group', 'tests group')").formats(@security_group_format) do
15
+ attributes = {:name => "fog_security_group", :description => "tests group"}
16
+ data = Fog::Network[:openstack].create_security_group(attributes).body["security_group"]
17
+ @sec_group_id = data["id"]
18
+ data
19
+ end
20
+
21
+ tests("#get_security_group('#{@sec_group_id}')").formats(@security_group_format) do
22
+ Fog::Network[:openstack].get_security_group(@sec_group_id).body["security_group"]
23
+ end
24
+
25
+ tests("#list_security_groups").formats('security_groups' => [@security_group_format]) do
26
+ Fog::Network[:openstack].list_security_groups.body
27
+ end
28
+
29
+ tests("#delete_security_group('#{@sec_group_id}')").succeeds do
30
+ Fog::Network[:openstack].delete_security_group(@sec_group_id)
31
+ end
32
+ end
33
+
34
+ tests('failure') do
35
+ tests("#get_security_group(0)").raises(Fog::Network::OpenStack::NotFound) do
36
+ Fog::Network[:openstack].get_security_group(0)
37
+ end
38
+
39
+ tests("#delete_security_group(0)").raises(Fog::Network::OpenStack::NotFound) do
40
+ Fog::Network[:openstack].delete_security_group(0)
41
+ end
42
+ end
43
+ end
@@ -1,8 +1,6 @@
1
1
  Shindo.tests('Fog::Rackspace::Identity', ['rackspace']) do
2
2
 
3
3
  tests('current authentication') do
4
- pending if Fog.mocking?
5
-
6
4
  tests('variables populated').returns(200) do
7
5
  @service = Fog::Rackspace::Identity.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :connection_options => {:ssl_verify_peer => true}
8
6
  returns(true, "auth token populated") { !@service.auth_token.nil? }
@@ -14,8 +12,6 @@ Shindo.tests('Fog::Rackspace::Identity', ['rackspace']) do
14
12
  end
15
13
 
16
14
  tests('reauthentication') do
17
- pending if Fog.mocking?
18
-
19
15
  tests('should reauth with valid credentials') do
20
16
  @service = Fog::Rackspace::Identity.new :rackspace_region => :ord
21
17
  returns(true, "auth token populated") { !@service.auth_token.nil? }
@@ -198,30 +198,58 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
198
198
  end
199
199
 
200
200
  tests('#setup') do
201
- perform_setup = lambda { |attributes|
201
+ ATTRIBUTES = {
202
+ :name => "foo",
203
+ :image_id => 42,
204
+ :flavor_id => 42
205
+ }
206
+
207
+ create_server = lambda { |attributes|
208
+ service = Fog::Compute::RackspaceV2.new
209
+ attributes.merge!(:service => service)
210
+
202
211
  Fog::SSH::Mock.data.clear
203
212
 
204
213
  server = Fog::Compute::RackspaceV2::Server.new(attributes)
214
+ server.save(attributes)
205
215
 
206
- address = 123
216
+ @address = 123
207
217
 
208
- server.ipv4_address = address
218
+ server.ipv4_address = @address
209
219
  server.identity = "bar"
210
220
  server.public_key = "baz"
211
221
 
212
222
  server.setup
213
223
 
214
- Fog::SSH::Mock.data[address].first[:commands]
224
+ server
225
+ }
226
+
227
+ commands = lambda {
228
+ Fog::SSH::Mock.data[@address].first[:commands]
215
229
  }
216
230
 
217
231
  test("leaves user unlocked only when requested") do
218
- perform_setup.call(:service => service, :no_passwd_lock => true)
219
- .none? { |c| c =~ /passwd\s+-l\s+root/ }
232
+ create_server.call(ATTRIBUTES.merge(:no_passwd_lock => true))
233
+ commands.call.none? { |c| c =~ /passwd\s+-l\s+root/ }
234
+ end
235
+
236
+ test("provide a password when the passed isn't locked") do
237
+ pwd = create_server.call(
238
+ ATTRIBUTES.merge(:no_passwd_lock => true)
239
+ ).password
240
+
241
+ # shindo expects a boolean not truthyness :-(
242
+ !!pwd
220
243
  end
221
244
 
222
245
  test("locks user by default") do
223
- perform_setup.call(:service => service)
224
- .one? { |c| c =~ /passwd\s+-l\s+root/ }
246
+ create_server.call(ATTRIBUTES)
247
+ commands.call.one? { |c| c =~ /passwd\s+-l\s+root/ }
248
+ end
249
+
250
+ test("nils password when password is locked") do
251
+ pwd = create_server.call(ATTRIBUTES).password
252
+ pwd.nil?
225
253
  end
226
254
  end
227
255
 
@@ -1,7 +1,5 @@
1
1
  Shindo.tests('Fog::Rackspace::Queues | claim', ['rackspace']) do
2
2
 
3
- pending if Fog.mocking?
4
-
5
3
  service = Fog::Rackspace::Queues.new
6
4
  queue = service.queues.create({
7
5
  :name => "fog_queue_#{Time.now.to_i.to_s}",
@@ -17,7 +15,7 @@ Shindo.tests('Fog::Rackspace::Queues | claim', ['rackspace']) do
17
15
  }
18
16
 
19
17
  begin
20
- model_tests(queue.claims, params, false) do
18
+ model_tests(queue.claims, params) do
21
19
  tests('#messages') do
22
20
  returns(1) { @instance.messages.length }
23
21
  returns('body') { @instance.messages.first.body['random'] }