fog-maestrodev 1.19.0.20140212012611 → 1.20.0.20140305101305

Sign up to get free protection for your applications and to get access to all the features.
Files changed (513) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +2 -0
  3. data/.travis.yml +10 -0
  4. data/CONTRIBUTORS.md +694 -0
  5. data/Gemfile.1.8.7 +1 -1
  6. data/LICENSE.md +17 -17
  7. data/Rakefile +1 -1
  8. data/benchs/each_provider.sh +6 -0
  9. data/benchs/each_service.sh +6 -0
  10. data/benchs/load_times.rb +6 -0
  11. data/changelog.txt +312 -0
  12. data/fog.gemspec +3 -5
  13. data/lib/fog.rb +1 -0
  14. data/lib/fog/atmos.rb +1 -11
  15. data/lib/fog/atmos/core.rb +11 -0
  16. data/lib/fog/atmos/requests/storage/get_namespace.rb +1 -1
  17. data/lib/fog/atmos/requests/storage/head_namespace.rb +1 -1
  18. data/lib/fog/atmos/storage.rb +1 -1
  19. data/lib/fog/aws.rb +22 -323
  20. data/lib/fog/aws/auto_scaling.rb +1 -1
  21. data/lib/fog/aws/beanstalk.rb +1 -1
  22. data/lib/fog/aws/cdn.rb +1 -1
  23. data/lib/fog/aws/cloud_formation.rb +1 -1
  24. data/lib/fog/aws/cloud_watch.rb +1 -1
  25. data/lib/fog/aws/compute.rb +12 -1
  26. data/lib/fog/aws/core.rb +329 -0
  27. data/lib/fog/aws/data_pipeline.rb +1 -1
  28. data/lib/fog/aws/dns.rb +1 -1
  29. data/lib/fog/aws/dynamodb.rb +1 -1
  30. data/lib/fog/aws/elasticache.rb +10 -3
  31. data/lib/fog/aws/elb.rb +1 -1
  32. data/lib/fog/aws/emr.rb +1 -2
  33. data/lib/fog/aws/glacier.rb +1 -1
  34. data/lib/fog/aws/iam.rb +1 -1
  35. data/lib/fog/aws/models/compute/dhcp_option.rb +2 -2
  36. data/lib/fog/aws/models/compute/flavor.rb +2 -0
  37. data/lib/fog/aws/models/compute/flavors.rb +363 -49
  38. data/lib/fog/aws/models/compute/network_acl.rb +170 -0
  39. data/lib/fog/aws/models/compute/network_acls.rb +138 -0
  40. data/lib/fog/aws/models/compute/server.rb +2 -2
  41. data/lib/fog/aws/models/compute/servers.rb +7 -2
  42. data/lib/fog/aws/models/compute/subnet.rb +2 -2
  43. data/lib/fog/aws/models/elasticache/cluster.rb +6 -0
  44. data/lib/fog/aws/models/elasticache/subnet_group.rb +35 -0
  45. data/lib/fog/aws/models/elasticache/subnet_groups.rb +27 -0
  46. data/lib/fog/aws/models/rds/snapshot.rb +1 -0
  47. data/lib/fog/aws/models/storage/file.rb +1 -1
  48. data/lib/fog/aws/parsers/compute/create_network_acl.rb +28 -0
  49. data/lib/fog/aws/parsers/compute/create_subnet.rb +2 -3
  50. data/lib/fog/aws/parsers/compute/describe_network_acls.rb +42 -0
  51. data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +29 -3
  52. data/lib/fog/aws/parsers/compute/network_acl_parser.rb +105 -0
  53. data/lib/fog/aws/parsers/compute/network_interface_parser.rb +16 -0
  54. data/lib/fog/aws/parsers/compute/replace_network_acl_association.rb +20 -0
  55. data/lib/fog/aws/parsers/compute/run_instances.rb +1 -1
  56. data/lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb +2 -2
  57. data/lib/fog/aws/parsers/elasticache/create_cache_subnet_group.rb +38 -0
  58. data/lib/fog/aws/parsers/elasticache/describe_cache_subnet_groups.rb +38 -0
  59. data/lib/fog/aws/parsers/elasticache/subnet_group_parser.rb +38 -0
  60. data/lib/fog/aws/parsers/iam/upload_server_certificate.rb +1 -1
  61. data/lib/fog/aws/parsers/rds/db_parser.rb +6 -0
  62. data/lib/fog/aws/parsers/rds/snapshot_parser.rb +1 -0
  63. data/lib/fog/aws/rds.rb +1 -1
  64. data/lib/fog/aws/redshift.rb +1 -1
  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_network_acls.rb +104 -0
  73. data/lib/fog/aws/requests/compute/describe_network_interfaces.rb +4 -0
  74. data/lib/fog/aws/requests/compute/disassociate_address.rb +4 -3
  75. data/lib/fog/aws/requests/compute/replace_network_acl_association.rb +66 -0
  76. data/lib/fog/aws/requests/compute/replace_network_acl_entry.rb +81 -0
  77. data/lib/fog/aws/requests/compute/replace_route.rb +84 -0
  78. data/lib/fog/aws/requests/compute/request_spot_instances.rb +8 -0
  79. data/lib/fog/aws/requests/compute/run_instances.rb +23 -3
  80. data/lib/fog/aws/requests/data_pipeline/put_pipeline_definition.rb +29 -21
  81. data/lib/fog/aws/requests/elasticache/create_cache_cluster.rb +18 -11
  82. data/lib/fog/aws/requests/elasticache/create_cache_subnet_group.rb +66 -0
  83. data/lib/fog/aws/requests/elasticache/delete_cache_subnet_group.rb +40 -0
  84. data/lib/fog/aws/requests/elasticache/describe_cache_subnet_groups.rb +63 -0
  85. data/lib/fog/aws/requests/elb/create_load_balancer.rb +3 -2
  86. data/lib/fog/aws/requests/iam/delete_server_certificate.rb +3 -1
  87. data/lib/fog/aws/requests/rds/create_db_instance.rb +2 -0
  88. data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +1 -0
  89. data/lib/fog/aws/requests/rds/create_db_snapshot.rb +1 -1
  90. data/lib/fog/aws/requests/rds/create_db_subnet_group.rb +2 -0
  91. data/lib/fog/aws/requests/rds/modify_db_instance.rb +1 -0
  92. data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +18 -0
  93. data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +23 -0
  94. data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +24 -0
  95. data/lib/fog/aws/requests/storage/put_object.rb +18 -54
  96. data/lib/fog/aws/requests/storage/shared_mock_methods.rb +87 -0
  97. data/lib/fog/aws/requests/storage/upload_part.rb +18 -0
  98. data/lib/fog/aws/ses.rb +1 -1
  99. data/lib/fog/aws/simpledb.rb +1 -1
  100. data/lib/fog/aws/sns.rb +1 -2
  101. data/lib/fog/aws/sqs.rb +5 -4
  102. data/lib/fog/aws/storage.rb +15 -5
  103. data/lib/fog/aws/sts.rb +1 -1
  104. data/lib/fog/bare_metal_cloud.rb +1 -11
  105. data/lib/fog/bare_metal_cloud/compute.rb +1 -1
  106. data/lib/fog/bare_metal_cloud/core.rb +11 -0
  107. data/lib/fog/bin.rb +1 -0
  108. data/lib/fog/bin/rage4.rb +31 -0
  109. data/lib/fog/bluebox.rb +3 -13
  110. data/lib/fog/bluebox/blb.rb +2 -2
  111. data/lib/fog/bluebox/compute.rb +1 -1
  112. data/lib/fog/bluebox/core.rb +13 -0
  113. data/lib/fog/bluebox/dns.rb +2 -2
  114. data/lib/fog/bluebox/models/compute/server.rb +1 -1
  115. data/lib/fog/brightbox.rb +1 -10
  116. data/lib/fog/brightbox/compute.rb +20 -1
  117. data/lib/fog/brightbox/core.rb +10 -0
  118. data/lib/fog/brightbox/models/compute/cloud_ip.rb +5 -0
  119. data/lib/fog/brightbox/models/compute/database_server.rb +91 -0
  120. data/lib/fog/brightbox/models/compute/database_servers.rb +28 -0
  121. data/lib/fog/brightbox/models/compute/database_snapshot.rb +52 -0
  122. data/lib/fog/brightbox/models/compute/database_snapshots.rb +24 -0
  123. data/lib/fog/brightbox/models/compute/database_type.rb +19 -0
  124. data/lib/fog/brightbox/models/compute/database_types.rb +26 -0
  125. data/lib/fog/brightbox/requests/compute/create_database_server.rb +25 -0
  126. data/lib/fog/brightbox/requests/compute/delete_database_server.rb +26 -0
  127. data/lib/fog/brightbox/requests/compute/delete_database_snapshot.rb +26 -0
  128. data/lib/fog/brightbox/requests/compute/get_database_server.rb +19 -0
  129. data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +19 -0
  130. data/lib/fog/brightbox/requests/compute/get_database_type.rb +21 -0
  131. data/lib/fog/brightbox/requests/compute/list_database_servers.rb +17 -0
  132. data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +17 -0
  133. data/lib/fog/brightbox/requests/compute/list_database_types.rb +19 -0
  134. data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +19 -0
  135. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +19 -0
  136. data/lib/fog/brightbox/requests/compute/update_database_server.rb +25 -0
  137. data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +26 -0
  138. data/lib/fog/clodo.rb +1 -34
  139. data/lib/fog/clodo/compute.rb +2 -0
  140. data/lib/fog/clodo/core.rb +34 -0
  141. data/lib/fog/clodo/models/compute/server.rb +2 -2
  142. data/lib/fog/cloudsigma.rb +1 -9
  143. data/lib/fog/cloudsigma/compute.rb +2 -2
  144. data/lib/fog/cloudsigma/core.rb +9 -0
  145. data/lib/fog/cloudstack.rb +1 -40
  146. data/lib/fog/cloudstack/compute.rb +1 -1
  147. data/lib/fog/cloudstack/core.rb +40 -0
  148. data/lib/fog/cloudstack/models/compute/server.rb +3 -0
  149. data/lib/fog/compute/models/server.rb +33 -7
  150. data/lib/fog/core/collection.rb +1 -3
  151. data/lib/fog/core/errors.rb +2 -0
  152. data/lib/fog/core/hmac.rb +3 -16
  153. data/lib/fog/core/logger.rb +3 -3
  154. data/lib/fog/core/provider.rb +1 -2
  155. data/lib/fog/digitalocean.rb +1 -9
  156. data/lib/fog/digitalocean/compute.rb +1 -1
  157. data/lib/fog/digitalocean/core.rb +9 -0
  158. data/lib/fog/digitalocean/models/compute/server.rb +3 -2
  159. data/lib/fog/digitalocean/models/compute/servers.rb +23 -4
  160. data/lib/fog/digitalocean/requests/compute/create_server.rb +2 -1
  161. data/lib/fog/digitalocean/requests/compute/destroy_server.rb +3 -1
  162. data/lib/fog/dnsimple.rb +1 -11
  163. data/lib/fog/dnsimple/core.rb +11 -0
  164. data/lib/fog/dnsimple/dns.rb +5 -2
  165. data/lib/fog/dnsimple/models/dns/record.rb +3 -3
  166. data/lib/fog/dnsimple/requests/dns/create_domain.rb +26 -22
  167. data/lib/fog/dnsimple/requests/dns/create_record.rb +21 -24
  168. data/lib/fog/dnsimple/requests/dns/delete_domain.rb +7 -6
  169. data/lib/fog/dnsimple/requests/dns/delete_record.rb +7 -5
  170. data/lib/fog/dnsimple/requests/dns/get_domain.rb +12 -18
  171. data/lib/fog/dnsimple/requests/dns/get_record.rb +11 -17
  172. data/lib/fog/dnsimple/requests/dns/list_domains.rb +7 -15
  173. data/lib/fog/dnsimple/requests/dns/list_records.rb +10 -15
  174. data/lib/fog/dnsimple/requests/dns/update_record.rb +14 -19
  175. data/lib/fog/dnsmadeeasy.rb +1 -11
  176. data/lib/fog/dnsmadeeasy/core.rb +11 -0
  177. data/lib/fog/dnsmadeeasy/dns.rb +1 -1
  178. data/lib/fog/dreamhost.rb +1 -11
  179. data/lib/fog/dreamhost/core.rb +11 -0
  180. data/lib/fog/dreamhost/dns.rb +1 -1
  181. data/lib/fog/dynect.rb +1 -26
  182. data/lib/fog/dynect/core.rb +26 -0
  183. data/lib/fog/dynect/dns.rb +1 -1
  184. data/lib/fog/dynect/requests/dns/put_record.rb +5 -4
  185. data/lib/fog/dynect/requests/dns/put_zone.rb +5 -4
  186. data/lib/fog/ecloud.rb +1 -31
  187. data/lib/fog/ecloud/compute.rb +1 -0
  188. data/lib/fog/ecloud/core.rb +31 -0
  189. data/lib/fog/glesys.rb +1 -11
  190. data/lib/fog/glesys/compute.rb +6 -4
  191. data/lib/fog/glesys/core.rb +11 -0
  192. data/lib/fog/glesys/models/compute/server.rb +2 -2
  193. data/lib/fog/go_grid.rb +1 -11
  194. data/lib/fog/go_grid/compute.rb +1 -1
  195. data/lib/fog/go_grid/core.rb +11 -0
  196. data/lib/fog/go_grid/models/compute/server.rb +2 -2
  197. data/lib/fog/google.rb +2 -24
  198. data/lib/fog/google/README.md +8 -5
  199. data/lib/fog/google/compute.rb +10 -3
  200. data/lib/fog/google/core.rb +24 -0
  201. data/lib/fog/google/models/compute/flavors.rb +1 -1
  202. data/lib/fog/google/models/compute/images.rb +2 -0
  203. data/lib/fog/google/models/compute/servers.rb +1 -1
  204. data/lib/fog/google/models/compute/zones.rb +1 -1
  205. data/lib/fog/google/requests/compute/attach_disk.rb +29 -0
  206. data/lib/fog/google/requests/compute/delete_address.rb +31 -0
  207. data/lib/fog/google/requests/compute/delete_snapshot.rb +35 -0
  208. data/lib/fog/google/requests/compute/detach_disk.rb +29 -0
  209. data/lib/fog/google/requests/compute/get_address.rb +31 -0
  210. data/lib/fog/google/requests/compute/insert_address.rb +30 -0
  211. data/lib/fog/google/requests/compute/insert_firewall.rb +6 -9
  212. data/lib/fog/google/requests/compute/list_addresses.rb +28 -0
  213. data/lib/fog/google/requests/compute/set_metadata.rb +4 -5
  214. data/lib/fog/google/requests/compute/set_tags.rb +33 -0
  215. data/lib/fog/google/requests/storage/get_bucket_acl.rb +2 -2
  216. data/lib/fog/google/requests/storage/put_bucket_acl.rb +39 -48
  217. data/lib/fog/google/requests/storage/put_object_acl.rb +55 -0
  218. data/lib/fog/google/storage.rb +2 -1
  219. data/lib/fog/hp.rb +9 -352
  220. data/lib/fog/hp/block_storage.rb +1 -1
  221. data/lib/fog/hp/block_storage_v2.rb +1 -1
  222. data/lib/fog/hp/cdn.rb +1 -1
  223. data/lib/fog/hp/compute.rb +1 -1
  224. data/lib/fog/hp/compute_v2.rb +1 -1
  225. data/lib/fog/hp/core.rb +352 -0
  226. data/lib/fog/hp/dns.rb +1 -1
  227. data/lib/fog/hp/lb.rb +1 -1
  228. data/lib/fog/hp/models/compute/server.rb +2 -2
  229. data/lib/fog/hp/models/compute_v2/server.rb +2 -2
  230. data/lib/fog/hp/models/storage/directory.rb +12 -6
  231. data/lib/fog/hp/network.rb +1 -1
  232. data/lib/fog/hp/storage.rb +1 -1
  233. data/lib/fog/ibm.rb +2 -176
  234. data/lib/fog/ibm/compute.rb +1 -1
  235. data/lib/fog/ibm/core.rb +176 -0
  236. data/lib/fog/ibm/storage.rb +1 -1
  237. data/lib/fog/internet_archive.rb +1 -292
  238. data/lib/fog/internet_archive/core.rb +292 -0
  239. data/lib/fog/internet_archive/models/storage/file.rb +1 -1
  240. data/lib/fog/internet_archive/storage.rb +1 -1
  241. data/lib/fog/joyent.rb +2 -10
  242. data/lib/fog/joyent/compute.rb +1 -1
  243. data/lib/fog/joyent/core.rb +10 -0
  244. data/lib/fog/joyent/errors.rb +1 -0
  245. data/lib/fog/libvirt.rb +1 -11
  246. data/lib/fog/libvirt/compute.rb +1 -1
  247. data/lib/fog/libvirt/core.rb +11 -0
  248. data/lib/fog/libvirt/models/compute/README.md +1 -1
  249. data/lib/fog/libvirt/models/compute/server.rb +6 -6
  250. data/lib/fog/libvirt/models/compute/templates/volume.xml.erb +12 -0
  251. data/lib/fog/libvirt/models/compute/volume.rb +1 -0
  252. data/lib/fog/linode.rb +2 -10
  253. data/lib/fog/linode/compute.rb +1 -1
  254. data/lib/fog/linode/core.rb +10 -0
  255. data/lib/fog/linode/dns.rb +1 -1
  256. data/lib/fog/local.rb +1 -11
  257. data/lib/fog/local/core.rb +11 -0
  258. data/lib/fog/local/storage.rb +1 -1
  259. data/lib/fog/ninefold.rb +1 -12
  260. data/lib/fog/ninefold/compute.rb +1 -1
  261. data/lib/fog/ninefold/core.rb +12 -0
  262. data/lib/fog/openstack.rb +8 -249
  263. data/lib/fog/openstack/compute.rb +3 -1
  264. data/lib/fog/openstack/core.rb +249 -0
  265. data/lib/fog/openstack/docs/compute.md +681 -0
  266. data/lib/fog/openstack/docs/getting_started.md +81 -0
  267. data/lib/fog/openstack/docs/storage.md +441 -0
  268. data/lib/fog/openstack/identity.rb +1 -1
  269. data/lib/fog/openstack/image.rb +1 -1
  270. data/lib/fog/openstack/metering.rb +1 -1
  271. data/lib/fog/openstack/models/compute/server.rb +13 -5
  272. data/lib/fog/openstack/models/compute/servers.rb +13 -0
  273. data/lib/fog/openstack/models/network/network.rb +9 -11
  274. data/lib/fog/openstack/models/network/security_group.rb +32 -0
  275. data/lib/fog/openstack/models/network/security_group_rule.rb +33 -0
  276. data/lib/fog/openstack/models/network/security_group_rules.rb +33 -0
  277. data/lib/fog/openstack/models/network/security_groups.rb +34 -0
  278. data/lib/fog/openstack/models/storage/directories.rb +1 -0
  279. data/lib/fog/openstack/network.rb +19 -1
  280. data/lib/fog/openstack/orchestration.rb +1 -1
  281. data/lib/fog/openstack/requests/compute/add_security_group.rb +24 -0
  282. data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
  283. data/lib/fog/openstack/requests/compute/create_server.rb +3 -3
  284. data/lib/fog/openstack/requests/compute/remove_security_group.rb +24 -0
  285. data/lib/fog/openstack/requests/image/update_image_members.rb +2 -2
  286. data/lib/fog/openstack/requests/network/create_security_group.rb +94 -0
  287. data/lib/fog/openstack/requests/network/create_security_group_rule.rb +79 -0
  288. data/lib/fog/openstack/requests/network/delete_security_group.rb +32 -0
  289. data/lib/fog/openstack/requests/network/delete_security_group_rule.rb +36 -0
  290. data/lib/fog/openstack/requests/network/get_security_group.rb +52 -0
  291. data/lib/fog/openstack/requests/network/get_security_group_rule.rb +47 -0
  292. data/lib/fog/openstack/requests/network/list_networks.rb +0 -1
  293. data/lib/fog/openstack/requests/network/list_security_group_rules.rb +52 -0
  294. data/lib/fog/openstack/requests/network/list_security_groups.rb +57 -0
  295. data/lib/fog/openstack/storage.rb +2 -2
  296. data/lib/fog/openstack/volume.rb +1 -1
  297. data/lib/fog/openvz.rb +1 -9
  298. data/lib/fog/openvz/compute.rb +1 -1
  299. data/lib/fog/openvz/core.rb +9 -0
  300. data/lib/fog/ovirt.rb +1 -17
  301. data/lib/fog/ovirt/compute.rb +2 -0
  302. data/lib/fog/ovirt/core.rb +17 -0
  303. data/lib/fog/rackspace.rb +12 -145
  304. data/lib/fog/rackspace/auto_scale.rb +1 -1
  305. data/lib/fog/rackspace/block_storage.rb +5 -1
  306. data/lib/fog/rackspace/cdn.rb +22 -16
  307. data/lib/fog/rackspace/compute.rb +1 -1
  308. data/lib/fog/rackspace/compute_v2.rb +6 -2
  309. data/lib/fog/rackspace/core.rb +145 -0
  310. data/lib/fog/rackspace/databases.rb +5 -1
  311. data/lib/fog/rackspace/dns.rb +1 -1
  312. data/lib/fog/rackspace/docs/compute_v2.md +2 -10
  313. data/lib/fog/rackspace/errors.rb +1 -1
  314. data/lib/fog/rackspace/examples/storage/upload_file.rb +1 -1
  315. data/lib/fog/rackspace/identity.rb +26 -16
  316. data/lib/fog/rackspace/load_balancers.rb +7 -1
  317. data/lib/fog/rackspace/mock_data.rb +17 -0
  318. data/lib/fog/rackspace/models/compute/server.rb +2 -2
  319. data/lib/fog/rackspace/models/compute_v2/key_pair.rb +1 -1
  320. data/lib/fog/rackspace/models/compute_v2/server.rb +42 -5
  321. data/lib/fog/rackspace/models/monitoring/entities.rb +1 -1
  322. data/lib/fog/rackspace/models/queues/claim.rb +9 -1
  323. data/lib/fog/rackspace/models/storage/directory.rb +5 -2
  324. data/lib/fog/rackspace/models/storage/file.rb +14 -0
  325. data/lib/fog/rackspace/monitoring.rb +11 -2
  326. data/lib/fog/rackspace/queues.rb +318 -34
  327. data/lib/fog/rackspace/requests/compute_v2/create_keypair.rb +16 -5
  328. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +7 -1
  329. data/lib/fog/rackspace/requests/compute_v2/delete_keypair.rb +1 -1
  330. data/lib/fog/rackspace/requests/identity/create_token.rb +192 -0
  331. data/lib/fog/rackspace/requests/identity/list_tenants.rb +23 -0
  332. data/lib/fog/rackspace/requests/monitoring/get_agent.rb +45 -0
  333. data/lib/fog/rackspace/requests/monitoring/get_cpus_info.rb +63 -0
  334. data/lib/fog/rackspace/requests/monitoring/get_disks_info.rb +56 -0
  335. data/lib/fog/rackspace/requests/monitoring/get_filesystems_info.rb +64 -0
  336. data/lib/fog/rackspace/requests/monitoring/get_logged_in_user_info.rb +58 -0
  337. data/lib/fog/rackspace/requests/monitoring/get_memory_info.rb +59 -0
  338. data/lib/fog/rackspace/requests/monitoring/get_network_interfaces_info.rb +91 -0
  339. data/lib/fog/rackspace/requests/monitoring/get_processes_info.rb +72 -0
  340. data/lib/fog/rackspace/requests/monitoring/get_system_info.rb +53 -0
  341. data/lib/fog/rackspace/requests/monitoring/list_agents.rb +62 -0
  342. data/lib/fog/rackspace/requests/queues/create_claim.rb +37 -0
  343. data/lib/fog/rackspace/requests/queues/create_message.rb +23 -0
  344. data/lib/fog/rackspace/requests/queues/create_queue.rb +15 -1
  345. data/lib/fog/rackspace/requests/queues/delete_claim.rb +18 -0
  346. data/lib/fog/rackspace/requests/queues/delete_message.rb +34 -0
  347. data/lib/fog/rackspace/requests/queues/delete_queue.rb +12 -0
  348. data/lib/fog/rackspace/requests/queues/get_claim.rb +15 -0
  349. data/lib/fog/rackspace/requests/queues/get_message.rb +17 -0
  350. data/lib/fog/rackspace/requests/queues/get_queue.rb +14 -1
  351. data/lib/fog/rackspace/requests/queues/get_queue_stats.rb +36 -0
  352. data/lib/fog/rackspace/requests/queues/list_messages.rb +33 -0
  353. data/lib/fog/rackspace/requests/queues/list_queues.rb +35 -1
  354. data/lib/fog/rackspace/requests/queues/update_claim.rb +17 -0
  355. data/lib/fog/rackspace/requests/storage/delete_container.rb +15 -0
  356. data/lib/fog/rackspace/requests/storage/delete_multiple_objects.rb +57 -0
  357. data/lib/fog/rackspace/requests/storage/delete_object.rb +14 -0
  358. data/lib/fog/rackspace/requests/storage/delete_static_large_object.rb +33 -0
  359. data/lib/fog/rackspace/requests/storage/extract_archive.rb +39 -0
  360. data/lib/fog/rackspace/requests/storage/get_container.rb +25 -0
  361. data/lib/fog/rackspace/requests/storage/get_containers.rb +17 -0
  362. data/lib/fog/rackspace/requests/storage/get_object.rb +26 -0
  363. data/lib/fog/rackspace/requests/storage/get_object_http_url.rb +9 -2
  364. data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +8 -1
  365. data/lib/fog/rackspace/requests/storage/head_container.rb +12 -0
  366. data/lib/fog/rackspace/requests/storage/head_containers.rb +19 -0
  367. data/lib/fog/rackspace/requests/storage/head_object.rb +26 -0
  368. data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +10 -0
  369. data/lib/fog/rackspace/requests/storage/put_container.rb +16 -0
  370. data/lib/fog/rackspace/requests/storage/put_dynamic_obj_manifest.rb +23 -0
  371. data/lib/fog/rackspace/requests/storage/put_object.rb +39 -0
  372. data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +9 -1
  373. data/lib/fog/rackspace/requests/storage/put_static_obj_manifest.rb +48 -0
  374. data/lib/fog/rackspace/storage.rb +320 -67
  375. data/lib/fog/rage4.rb +2 -0
  376. data/lib/fog/rage4/core.rb +11 -0
  377. data/lib/fog/rage4/dns.rb +74 -0
  378. data/lib/fog/rage4/models/dns/record.rb +77 -0
  379. data/lib/fog/rage4/models/dns/records.rb +42 -0
  380. data/lib/fog/rage4/models/dns/zone.rb +46 -0
  381. data/lib/fog/rage4/models/dns/zones.rb +34 -0
  382. data/lib/fog/rage4/requests/dns/create_domain.rb +33 -0
  383. data/lib/fog/rage4/requests/dns/create_domain_vanity.rb +34 -0
  384. data/lib/fog/rage4/requests/dns/create_record.rb +65 -0
  385. data/lib/fog/rage4/requests/dns/create_reverse_domain_4.rb +32 -0
  386. data/lib/fog/rage4/requests/dns/delete_domain.rb +28 -0
  387. data/lib/fog/rage4/requests/dns/delete_record.rb +28 -0
  388. data/lib/fog/rage4/requests/dns/get_domain.rb +30 -0
  389. data/lib/fog/rage4/requests/dns/get_domain_by_name.rb +30 -0
  390. data/lib/fog/rage4/requests/dns/list_domains.rb +41 -0
  391. data/lib/fog/rage4/requests/dns/list_geo_regions.rb +27 -0
  392. data/lib/fog/rage4/requests/dns/list_record_types.rb +26 -0
  393. data/lib/fog/rage4/requests/dns/list_records.rb +31 -0
  394. data/lib/fog/rage4/requests/dns/set_record_failover.rb +29 -0
  395. data/lib/fog/rage4/requests/dns/show_current_usage.rb +25 -0
  396. data/lib/fog/rage4/requests/dns/show_global_usage.rb +25 -0
  397. data/lib/fog/rage4/requests/dns/update_domain.rb +43 -0
  398. data/lib/fog/rage4/requests/dns/update_record.rb +64 -0
  399. data/lib/fog/riakcs.rb +2 -122
  400. data/lib/fog/riakcs/core.rb +122 -0
  401. data/lib/fog/riakcs/provisioning.rb +1 -1
  402. data/lib/fog/riakcs/usage.rb +1 -1
  403. data/lib/fog/serverlove.rb +1 -10
  404. data/lib/fog/serverlove/compute.rb +2 -0
  405. data/lib/fog/serverlove/core.rb +10 -0
  406. data/lib/fog/storm_on_demand.rb +9 -20
  407. data/lib/fog/storm_on_demand/account.rb +1 -1
  408. data/lib/fog/storm_on_demand/billing.rb +1 -1
  409. data/lib/fog/storm_on_demand/compute.rb +1 -1
  410. data/lib/fog/storm_on_demand/core.rb +20 -0
  411. data/lib/fog/storm_on_demand/dns.rb +1 -1
  412. data/lib/fog/storm_on_demand/monitoring.rb +1 -1
  413. data/lib/fog/storm_on_demand/network.rb +1 -1
  414. data/lib/fog/storm_on_demand/shared.rb +0 -1
  415. data/lib/fog/storm_on_demand/storage.rb +1 -1
  416. data/lib/fog/storm_on_demand/support.rb +1 -1
  417. data/lib/fog/storm_on_demand/vpn.rb +1 -1
  418. data/lib/fog/vcloud.rb +1 -11
  419. data/lib/fog/vcloud/compute.rb +1 -1
  420. data/lib/fog/vcloud/core.rb +11 -0
  421. data/lib/fog/vcloud_director.rb +1 -67
  422. data/lib/fog/vcloud_director/compute.rb +1 -1
  423. data/lib/fog/vcloud_director/core.rb +67 -0
  424. data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +1 -1
  425. data/lib/fog/version.rb +1 -1
  426. data/lib/fog/vmfusion.rb +1 -11
  427. data/lib/fog/vmfusion/compute.rb +1 -1
  428. data/lib/fog/vmfusion/core.rb +11 -0
  429. data/lib/fog/vmfusion/models/compute/server.rb +5 -5
  430. data/lib/fog/voxel.rb +1 -16
  431. data/lib/fog/voxel/compute.rb +1 -1
  432. data/lib/fog/voxel/core.rb +16 -0
  433. data/lib/fog/vsphere.rb +1 -17
  434. data/lib/fog/vsphere/compute.rb +1 -0
  435. data/lib/fog/vsphere/core.rb +17 -0
  436. data/lib/fog/xenserver.rb +1 -83
  437. data/lib/fog/xenserver/compute.rb +1 -1
  438. data/lib/fog/xenserver/core.rb +83 -0
  439. data/lib/fog/xenserver/models/compute/storage_manager.rb +1 -1
  440. data/lib/fog/zerigo.rb +1 -11
  441. data/lib/fog/zerigo/core.rb +11 -0
  442. data/lib/fog/zerigo/dns.rb +1 -1
  443. data/lib/tasks/changelog_task.rb +2 -0
  444. data/tests/aws/models/compute/network_acl_tests.rb +109 -0
  445. data/tests/aws/models/compute/network_acls_tests.rb +7 -0
  446. data/tests/aws/models/elasticache/subnet_groups_tests.rb +44 -0
  447. data/tests/aws/requests/compute/network_acl_tests.rb +86 -0
  448. data/tests/aws/requests/compute/route_tests.rb +64 -3
  449. data/tests/aws/requests/compute/subnet_tests.rb +18 -11
  450. data/tests/aws/requests/elasticache/helper.rb +19 -0
  451. data/tests/aws/requests/elasticache/subnet_group_tests.rb +52 -0
  452. data/tests/aws/requests/iam/server_certificate_tests.rb +3 -0
  453. data/tests/aws/requests/rds/subnet_groups_tests.rb +1 -1
  454. data/tests/aws/requests/storage/multipart_upload_tests.rb +3 -14
  455. data/tests/brightbox/compute/schema.rb +118 -2
  456. data/tests/brightbox/helper.rb +1 -0
  457. data/tests/brightbox/models/compute/cloud_ip_tests.rb +32 -0
  458. data/tests/brightbox/models/compute/database_server_tests.rb +66 -0
  459. data/tests/brightbox/models/compute/database_snapshot_tests.rb +26 -0
  460. data/tests/brightbox/models/compute/database_type_tests.rb +27 -0
  461. data/tests/brightbox/requests/compute/database_server_tests.rb +54 -0
  462. data/tests/brightbox/requests/compute/database_snapsnot_tests.rb +47 -0
  463. data/tests/brightbox/requests/compute/database_type_tests.rb +17 -0
  464. data/tests/compute/models/server_tests.rb +20 -2
  465. data/tests/digitalocean/helper.rb +9 -4
  466. data/tests/digitalocean/models/compute/server_tests.rb +1 -0
  467. data/tests/digitalocean/models/compute/servers_tests.rb +19 -4
  468. data/tests/digitalocean/requests/compute/create_server_tests.rb +13 -6
  469. data/tests/digitalocean/requests/compute/list_servers_tests.rb +2 -1
  470. data/tests/dns/helper.rb +3 -0
  471. data/tests/dns/models/record_tests.rb +1 -1
  472. data/tests/dns/models/records_tests.rb +1 -1
  473. data/tests/dns/models/zone_tests.rb +1 -1
  474. data/tests/dns/models/zones_tests.rb +1 -1
  475. data/tests/helper.rb +7 -1
  476. data/tests/helpers/compute/server_helper.rb +1 -0
  477. data/tests/helpers/compute/servers_helper.rb +1 -0
  478. data/tests/openstack/models/network/security_group_rule_tests.rb +27 -0
  479. data/tests/openstack/models/network/security_group_rules_tests.rb +25 -0
  480. data/tests/openstack/models/network/security_group_tests.rb +17 -0
  481. data/tests/openstack/models/network/security_groups_tests.rb +16 -0
  482. data/tests/openstack/requests/compute/helper.rb +5 -0
  483. data/tests/openstack/requests/compute/server_tests.rb +11 -0
  484. data/tests/openstack/requests/network/security_group_rule_tests.rb +58 -0
  485. data/tests/openstack/requests/network/security_group_tests.rb +43 -0
  486. data/tests/rackspace/identity_tests.rb +0 -4
  487. data/tests/rackspace/models/compute_v2/server_tests.rb +36 -8
  488. data/tests/rackspace/models/queues/claim_tests.rb +1 -3
  489. data/tests/rackspace/models/queues/claims_tests.rb +1 -3
  490. data/tests/rackspace/models/queues/message_tests.rb +1 -3
  491. data/tests/rackspace/models/queues/messages_tests.rb +1 -3
  492. data/tests/rackspace/models/queues/queue_tests.rb +1 -3
  493. data/tests/rackspace/models/queues/queues_tests.rb +1 -3
  494. data/tests/rackspace/models/storage/account_tests.rb +0 -2
  495. data/tests/rackspace/models/storage/directories_tests.rb +0 -3
  496. data/tests/rackspace/models/storage/directory_tests.rb +2 -5
  497. data/tests/rackspace/models/storage/file_tests.rb +49 -2
  498. data/tests/rackspace/models/storage/files_tests.rb +1 -4
  499. data/tests/rackspace/queues_tests.rb +0 -13
  500. data/tests/rackspace/requests/identity/token_tests.rb +1 -3
  501. data/tests/rackspace/requests/monitoring/agent_tests.rb +42 -0
  502. data/tests/rackspace/requests/queues/claim_tests.rb +1 -3
  503. data/tests/rackspace/requests/queues/messages_tests.rb +0 -6
  504. data/tests/rackspace/requests/queues/queues_tests.rb +0 -5
  505. data/tests/rackspace/requests/storage/account_tests.rb +0 -1
  506. data/tests/rackspace/requests/storage/container_tests.rb +7 -11
  507. data/tests/rackspace/requests/storage/large_object_tests.rb +33 -43
  508. data/tests/rackspace/requests/storage/object_tests.rb +2 -27
  509. data/tests/rackspace/storage_tests.rb +9 -15
  510. data/tests/rage4/requests/dns/dns_tests.rb +241 -0
  511. data/tests/vcloud/requests/compute/disk_configure_tests.rb +0 -8
  512. metadata +190 -33
  513. data/lib/fog/brightbox/requests/compute/destroy_user_collaboration.rb +0 -21
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rackspace'))
1
+ require 'fog/rackspace/core'
2
2
 
3
3
  module Fog
4
4
  module Rackspace
@@ -143,6 +143,10 @@ module Fog
143
143
  regions = @identity_service.service_catalog.display_service_regions(service_name)
144
144
  Fog::Logger.deprecation("Please specify region using :rackspace_region rather than :rackspace_endpoint. Valid region for :rackspace_region are #{regions}.")
145
145
  end
146
+
147
+ unless options[:rackspace_region]
148
+ Fog::Logger.deprecation("Default region support will be removed in an upcoming release. Please switch to manually setting your endpoint. This requires settng the :rackspace_region option")
149
+ end
146
150
  end
147
151
 
148
152
  def append_tenant_v1(credentials)
@@ -1,4 +1,4 @@
1
- require 'fog/rackspace'
1
+ require 'fog/rackspace/core'
2
2
  require 'fog/dns'
3
3
 
4
4
  module Fog
@@ -250,8 +250,6 @@ This returns a collection of `Fog::Compute::RackspaceV2::Image` models:
250
250
  >,
251
251
 
252
252
 
253
- **Note**: In order to speed up access `service.images` does not retrieve all attribute values. To retrieve additional details you will either need to `reload` each individual image or use the request abstraction.
254
-
255
253
  ## Get Image
256
254
 
257
255
  To retrieve individual image:
@@ -276,13 +274,11 @@ This returns an `Fog::Compute::RackspaceV2::Image` instance:
276
274
  links=[{"href"=>"https://ord.servers.api.rackspacecloud.com/v2/772045/images/8a3a9f96-b997-46fd-b7a8-a9e740796ffd", "rel"=>"self"}, {"href"=>"https://ord.servers.api.rackspacecloud.com/772045/images/8a3a9f96-b997-46fd-b7a8-a9e740796ffd", "rel"=>"bookmark"}, {"href"=>"https://ord.images.api.rackspacecloud.com/772045/images/8a3a9f96-b997-46fd-b7a8-a9e740796ffd", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
277
275
  >
278
276
 
279
- **Note**: This request populates all Image attributes.
280
-
281
277
  ## List Flavors
282
278
 
283
279
  To retrieve a list of available flavors:
284
280
 
285
- service.images
281
+ service.flavors
286
282
 
287
283
  This returns a collection of `Fog::Compute::RackspaceV2::Flavor` models:
288
284
 
@@ -305,8 +301,6 @@ This returns a collection of `Fog::Compute::RackspaceV2::Flavor` models:
305
301
  links=[{"href"=>"https://dfw.servers.api.rackspacecloud.com/v2/772045/flavors/3", "rel"=>"self"}, {"href"=>"https://dfw.servers.api.rackspacecloud.com/772045/flavors/3", "rel"=>"bookmark"}]
306
302
  >,
307
303
 
308
-
309
- **Note**: In order to speed up access `service.flavors` does not retrieve all attribute values. To retrieve additional details you will either need to `reload` each individual flavor or use the request abstraction.
310
304
 
311
305
 
312
306
  ## Get Flavor
@@ -325,8 +319,6 @@ This returns a `Fog::Compute::RackspaceV2::Flavor` instance:
325
319
  vcpus=1,
326
320
  links=[{"href"=>"https://dfw.servers.api.rackspacecloud.com/v2/772045/flavors/2", "rel"=>"self"}, {"href"=>"https://dfw.servers.api.rackspacecloud.com/772045/flavors/2", "rel"=>"bookmark"}]
327
321
  >
328
-
329
- **Note**: This request populates all Flavor attributes.
330
322
 
331
323
 
332
324
  ## List Servers
@@ -486,7 +478,7 @@ The `create` method also supports the following key values:
486
478
  </tr>
487
479
  <tr>
488
480
  <td>:personality</td>
489
- <td>Array of files to be injected onto the server. Please refer to the Fog <a href="http://rubydoc.info/github/fog/fog/Fog/Compute/RackspaceV2/Servers:bootstrap">bootstrap </a> API documentation for further information.</td>
481
+ <td>Array of files to be injected onto the server. Please refer to the Fog <a href="http://rubydoc.info/github/fog/fog/Fog/Compute/RackspaceV2/Server:personality">personality </a> API documentation for further information.</td>
490
482
  </tr>
491
483
  </table>
492
484
 
@@ -31,4 +31,4 @@ module Fog
31
31
  end
32
32
  end
33
33
  end
34
- end
34
+ end
@@ -40,6 +40,6 @@ directory = service.directories.create :key => directory_name, :public => true
40
40
  upload_file = File.join(File.dirname(__FILE__), "lorem.txt")
41
41
  file = directory.files.create :key => 'sample.txt', :body => File.open(upload_file, "r")
42
42
 
43
- puts "You should not be able to view this file via CDN at #{file.public_url}"
43
+ puts "You should be able to view this file via CDN at #{file.public_url}"
44
44
  puts "To delete the container and associated file please execute the delete_directory.rb script\n\n"
45
45
 
@@ -1,4 +1,4 @@
1
- require 'fog/rackspace'
1
+ require 'fog/rackspace/core'
2
2
 
3
3
  module Fog
4
4
  module Rackspace
@@ -34,18 +34,16 @@ module Fog
34
34
  request :update_user
35
35
  request :delete_user
36
36
 
37
- class Mock < Fog::Rackspace::Service
38
- attr_reader :service_catalog
39
-
40
- def request
41
- Fog::Mock.not_implemented
37
+ module Common
38
+ attr_reader :service_catalog, :auth_token
39
+
40
+ def authenticate(options={})
41
+ data = self.create_token(@rackspace_username, @rackspace_api_key).body
42
+ @service_catalog = ServiceCatalog.from_response(self, data)
43
+ @auth_token = data['access']['token']['id']
42
44
  end
43
- end
44
45
 
45
- class Real < Fog::Rackspace::Service
46
- attr_reader :service_catalog, :auth_token
47
-
48
- def initialize(options={})
46
+ def apply_options(options)
49
47
  @rackspace_username = options[:rackspace_username]
50
48
  @rackspace_api_key = options[:rackspace_api_key]
51
49
  @rackspace_region = options[:rackspace_region]
@@ -58,15 +56,27 @@ module Fog
58
56
  @scheme = @uri.scheme
59
57
  @persistent = options[:persistent] || false
60
58
  @connection_options = options[:connection_options] || {}
61
- @connection = Fog::Connection.new(@uri.to_s, @persistent, @connection_options)
59
+ end
60
+ end
61
+
62
+ class Mock < Fog::Rackspace::Service
63
+ include Common
64
+
65
+ def initialize(options={})
66
+ apply_options(options)
62
67
 
63
68
  authenticate
64
69
  end
70
+ end
71
+
72
+ class Real < Fog::Rackspace::Service
73
+ include Common
65
74
 
66
- def authenticate(options={})
67
- data = self.create_token(@rackspace_username, @rackspace_api_key).body
68
- @service_catalog = ServiceCatalog.from_response(self, data)
69
- @auth_token = data['access']['token']['id']
75
+ def initialize(options={})
76
+ apply_options(options)
77
+ @connection = Fog::Connection.new(@uri.to_s, @persistent, @connection_options)
78
+
79
+ authenticate
70
80
  end
71
81
  end
72
82
  end
@@ -1,4 +1,4 @@
1
- require 'fog/rackspace'
1
+ require 'fog/rackspace/core'
2
2
 
3
3
  module Fog
4
4
  module Rackspace
@@ -116,6 +116,8 @@ module Fog
116
116
 
117
117
  authenticate
118
118
 
119
+ deprecation_warnings(options)
120
+
119
121
  @persistent = options[:persistent] || false
120
122
  @connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
121
123
  end
@@ -186,6 +188,10 @@ module Fog
186
188
  regions = @identity_service.service_catalog.display_service_regions(service_name)
187
189
  Fog::Logger.deprecation("Please specify region using :rackspace_region rather than :rackspace_endpoint. Valid regions for :rackspace_region are #{regions}.")
188
190
  end
191
+
192
+ unless options[:rackspace_region]
193
+ Fog::Logger.deprecation("Default region support will be removed in an upcoming release. Please switch to manually setting your endpoint. This requires settng the :rackspace_region option")
194
+ end
189
195
  end
190
196
 
191
197
  def append_tenant_v1(credentials)
@@ -232,6 +232,23 @@ module Fog
232
232
  def self.zulu_time
233
233
  Time.now.strftime("%Y-%m-%dT%H:%M:%SZ")
234
234
  end
235
+
236
+ def self.stringify(message)
237
+ case message
238
+ when Symbol
239
+ message.to_s
240
+ when Hash
241
+ result = Hash.new
242
+ message.each do |key, value|
243
+ nk = stringify(key)
244
+ nv = stringify(value)
245
+ result[nk] = nv
246
+ end
247
+ result
248
+ else
249
+ message
250
+ end
251
+ end
235
252
  end
236
253
  end
237
254
  end
@@ -80,8 +80,8 @@ module Fog
80
80
  end
81
81
 
82
82
  def setup(credentials = {})
83
- requires :public_ip_address, :identity, :public_key, :username
84
- Fog::SSH.new(public_ip_address, username, credentials).run([
83
+ requires :ssh_ip_address, :identity, :public_key, :username
84
+ Fog::SSH.new(ssh_ip_address, username, credentials).run([
85
85
  %{mkdir .ssh},
86
86
  %{echo "#{public_key}" >> ~/.ssh/authorized_keys},
87
87
  %{passwd -l #{username}},
@@ -33,7 +33,7 @@ module Fog
33
33
  # @raise [Fog::Compute::RackspaceV2::ServiceError]
34
34
  def save
35
35
  requires :name
36
- data = service.create_keypair(name, public_key)
36
+ data = service.create_keypair(name, attributes)
37
37
  merge_attributes(data.body['keypair'])
38
38
  data.body['keypair']['name'] == name
39
39
  end
@@ -137,10 +137,16 @@ module Fog
137
137
  # @return [String] The image Id.
138
138
  # @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/List_Images-d1e4435.html
139
139
  attribute :image_id, :aliases => 'image', :squash => 'id'
140
+
140
141
  # @!attribute [r] password
141
142
  # @return [String] Password for system adminstrator account.
142
143
  # @note This value is ONLY populated on server creation.
143
- attr_reader :password
144
+ attr_reader :password
145
+
146
+ # @!attribute [rw] key_name
147
+ # @return [String] The name of the key_pair used for server.
148
+ # @note The key_pair/key_name is used to specify the keypair used for server creation. It is not populated by cloud servers.
149
+ attribute :key_name
144
150
 
145
151
 
146
152
  def initialize(attributes={})
@@ -170,6 +176,27 @@ module Fog
170
176
  metadata.from_hash(hash)
171
177
  end
172
178
 
179
+ # Returns the key pair based on the key_name of the server
180
+ # @return [KeyPair]
181
+ # @note The key_pair/key_name is used to specify the keypair used for server creation. It is not populated by cloud servers.
182
+ def key_pair
183
+ requires :key_name
184
+
185
+ service.key_pairs.get(key_name)
186
+ end
187
+
188
+ # Sets the key_pair used by the server.
189
+ # @param new_keypair [KeyPair] key_pair object for server
190
+ # @note The key_pair/key_name is used to specify the keypair used for server creation. It is not populated by cloud servers.
191
+ def key_pair=(new_keypair)
192
+ if new_keypair.is_a?(String)
193
+ Fog::Logger.deprecation("#key_pair= should be used to set KeyPair objects. Please use #key_name method instead")
194
+ self.key_name = new_keypair
195
+ else
196
+ self.key_name = new_keypair && new_keypair.name
197
+ end
198
+ end
199
+
173
200
  # Saves the server.
174
201
  # Creates server if it is new, otherwise it will update server attributes name, accessIPv4, and accessIPv6.
175
202
  # @return [Boolean] true if server has started saving
@@ -201,11 +228,16 @@ module Fog
201
228
  requires :name, :image_id, :flavor_id
202
229
  modified_options = Marshal.load(Marshal.dump(options))
203
230
 
231
+ if attributes[:keypair]
232
+ Fog::Logger.deprecation(":keypair has been depreciated. Please use :key_name instead.")
233
+ modified_options[:key_name] = attributes[:keypair]
234
+ end
235
+
204
236
  modified_options[:networks] ||= attributes[:networks]
205
237
  modified_options[:disk_config] = disk_config unless disk_config.nil?
206
238
  modified_options[:metadata] = metadata.to_hash unless @metadata.nil?
207
239
  modified_options[:personality] = personality unless personality.nil?
208
- modified_options[:keypair] ||= attributes[:keypair]
240
+ modified_options[:key_name] ||= attributes[:key_name]
209
241
 
210
242
  if modified_options[:networks]
211
243
  modified_options[:networks].map! { |id| { :uuid => id } }
@@ -521,15 +553,20 @@ module Fog
521
553
  # Setup server for SSH access
522
554
  # @see Servers#bootstrap
523
555
  def setup(credentials = {})
524
- requires :public_ip_address, :identity, :public_key, :username
556
+ requires :ssh_ip_address, :identity, :public_key, :username
557
+
525
558
  commands = [
526
559
  %{mkdir .ssh},
527
560
  %{echo "#{public_key}" >> ~/.ssh/authorized_keys},
528
561
  password_lock,
529
562
  %{echo "#{Fog::JSON.encode(attributes)}" >> ~/attributes.json},
530
563
  %{echo "#{Fog::JSON.encode(metadata)}" >> ~/metadata.json}
531
- ].compact
532
- Fog::SSH.new(public_ip_address, username, credentials).run(commands)
564
+ ]
565
+ commands.compact
566
+
567
+ @password = nil if password_lock
568
+
569
+ Fog::SSH.new(ssh_ip_address, username, credentials).run(commands)
533
570
  rescue Errno::ECONNREFUSED
534
571
  sleep(1)
535
572
  retry
@@ -13,7 +13,7 @@ module Fog
13
13
 
14
14
  def all(options={})
15
15
  data = service.list_entities(options).body
16
- marker = data['metadata']['next_marker']
16
+ self.marker = data['metadata']['next_marker']
17
17
 
18
18
  load(data['values'])
19
19
  end
@@ -94,6 +94,14 @@ module Fog
94
94
  end
95
95
  end
96
96
 
97
+ def initialize(new_attributes = {})
98
+ # A hack in support of the #messages= hack up above. #messages= requires #collection to
99
+ # be populated first to succeed, which is always the case in modern Rubies that preserve
100
+ # Hash ordering, but not in 1.8.7.
101
+ @collection = new_attributes.delete(:collection)
102
+ super(new_attributes)
103
+ end
104
+
97
105
  private
98
106
 
99
107
  def queue
@@ -109,7 +117,7 @@ module Fog
109
117
  response = service.create_claim(queue.identity, ttl, grace, options)
110
118
 
111
119
  if [200, 201].include? response.status
112
- self.identity = response.headers['Location'].split('/').last
120
+ self.identity = response.get_header('Location').split('/').last
113
121
  self.messages = response.body
114
122
 
115
123
  #Since Claims aren't a server side collection, we need to
@@ -166,8 +166,11 @@ module Fog
166
166
  def save
167
167
  requires :key
168
168
  create_or_update_container
169
- raise Fog::Storage::Rackspace::Error.new("Directory can not be set as :public without a CDN provided") if public? && !cdn_enabled?
170
- @urls = service.cdn.publish_container(self, public?)
169
+ if cdn_enabled?
170
+ @urls = service.cdn.publish_container(self, public?)
171
+ else
172
+ raise Fog::Storage::Rackspace::Error.new("Directory can not be set as :public without a CDN provided") if public?
173
+ end
171
174
  true
172
175
  end
173
176
 
@@ -47,6 +47,18 @@ module Fog
47
47
  # @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Enabling_File_Compression_with_the_Content-Encoding_Header-d1e2198.html
48
48
  attribute :content_encoding, :aliases => 'Content-Encoding'
49
49
 
50
+ # @!attribute [rw] delete_at
51
+ # A Unix Epoch Timestamp, in integer form, representing the time when this object will be automatically deleted.
52
+ # @return [Integer] the unix epoch timestamp of when this object will be automatically deleted
53
+ # @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Expiring_Objects-e1e3228.html
54
+ attribute :delete_at, :aliases => ['X-Delete-At']
55
+
56
+ # @!attribute [rw] delete_after
57
+ # A number of seconds representing how long from now this object will be automatically deleted.
58
+ # @return [Integer] the number of seconds until this object will be automatically deleted
59
+ # @see http://docs.rackspace.com/files/api/v1/cf-devguide/content/Expiring_Objects-e1e3228.html
60
+ attribute :delete_after, :aliases => ['X-Delete-After']
61
+
50
62
  # @!attribute [r] directory
51
63
  # @return [Fog::Storage::Rackspace::Directory] directory containing file
52
64
  attr_accessor :directory
@@ -254,6 +266,8 @@ module Fog
254
266
  options['Content-Disposition'] = content_disposition if content_disposition
255
267
  options['Etag'] = etag if etag
256
268
  options['Content-Encoding'] = content_encoding if content_encoding
269
+ options['X-Delete-At'] = delete_at if delete_at
270
+ options['X-Delete-After'] = delete_after if delete_after
257
271
  options.merge!(metadata.to_headers)
258
272
 
259
273
  data = service.put_object(directory.key, key, body, options)
@@ -1,9 +1,8 @@
1
+ require 'fog/rackspace/core'
1
2
  # This class originally came from the rackspace-monitoring gem located here:
2
3
  # https://github.com/racker/rackspace-monitoring-rb
3
4
  # It has been heavily modified for import into Fog master.
4
5
 
5
- require 'fog'
6
- require 'fog/core'
7
6
 
8
7
  module Fog
9
8
  module Rackspace
@@ -61,6 +60,7 @@ module Fog
61
60
 
62
61
  request_path 'fog/rackspace/requests/monitoring'
63
62
  request :list_agent_tokens
63
+ request :list_agents
64
64
  request :list_alarms
65
65
  request :list_alarm_examples
66
66
  request :list_checks
@@ -72,12 +72,21 @@ module Fog
72
72
  request :list_notification_plans
73
73
  request :list_notifications
74
74
 
75
+ request :get_agent
75
76
  request :get_agent_token
76
77
  request :get_alarm
77
78
  request :get_alarm_example
78
79
  request :get_check
79
80
  request :get_entity
80
81
  request :get_notification
82
+ request :get_cpus_info
83
+ request :get_disks_info
84
+ request :get_filesystems_info
85
+ request :get_memory_info
86
+ request :get_network_interfaces_info
87
+ request :get_processes_info
88
+ request :get_system_info
89
+ request :get_logged_in_user_info
81
90
 
82
91
  request :create_agent_token
83
92
  request :create_alarm
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rackspace'))
1
+ require 'fog/rackspace/core'
2
2
 
3
3
  module Fog
4
4
  module Rackspace
@@ -42,23 +42,8 @@ module Fog
42
42
  request :update_claim
43
43
  request :delete_claim
44
44
 
45
- class Mock < Fog::Rackspace::Service
46
- def request(params)
47
- Fog::Mock.not_implemented
48
- end
49
- end
50
-
51
- class Real < Fog::Rackspace::Service
52
-
53
- def service_name
54
- :cloudQueues
55
- end
56
-
57
- def region
58
- @rackspace_region
59
- end
60
-
61
- def initialize(options = {})
45
+ module Common
46
+ def apply_options(options)
62
47
  @rackspace_api_key = options[:rackspace_api_key]
63
48
  @rackspace_username = options[:rackspace_username]
64
49
  @rackspace_queues_client_id = options[:rackspace_queues_client_id] || Fog::UUID.uuid
@@ -70,25 +55,14 @@ module Fog
70
55
  unless v2_authentication?
71
56
  raise Fog::Errors::NotImplemented.new("V2 authentication required for Queues")
72
57
  end
58
+ end
73
59
 
74
- authenticate
75
-
76
- @persistent = options[:persistent] || false
77
- @connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
60
+ def service_name
61
+ :cloudQueues
78
62
  end
79
63
 
80
- def request(params, parse_json = true, &block)
81
- super(params, parse_json, &block)
82
- rescue Excon::Errors::NotFound => error
83
- raise NotFound.slurp(error, self)
84
- rescue Excon::Errors::BadRequest => error
85
- raise BadRequest.slurp(error, self)
86
- rescue Excon::Errors::InternalServerError => error
87
- raise InternalServerError.slurp(error, self)
88
- rescue Excon::Errors::MethodNotAllowed => error
89
- raise MethodNotAllowed.slurp(error, self)
90
- rescue Excon::Errors::HTTPStatusError => error
91
- raise ServiceError.slurp(error, self)
64
+ def region
65
+ @rackspace_region
92
66
  end
93
67
 
94
68
  def endpoint_uri(service_endpoint_url=nil)
@@ -112,6 +86,316 @@ module Fog
112
86
  @rackspace_queues_client_id = client_id
113
87
  end
114
88
  end
89
+
90
+ class Mock < Fog::Rackspace::Service
91
+ include Common
92
+
93
+ PATH_BASE = "/v1/queues"
94
+
95
+ # An in-memory Queue implementation.
96
+ class MockQueue
97
+ attr_accessor :name, :metadata, :messages, :claims
98
+
99
+ def initialize(name)
100
+ @name, @metadata = name, {}
101
+ @messages, @claims = [], {}
102
+ @id_counter = Fog::Mock.random_hex(24).to_i(16)
103
+ end
104
+
105
+ # The total number of messages currently on the queue.
106
+ #
107
+ # @return [Integer]
108
+ def total
109
+ @messages.size
110
+ end
111
+
112
+ # The number of messages currently held by a claim.
113
+ #
114
+ # @return [Integer]
115
+ def claimed
116
+ @messages.count { |msg| msg.claimed? }
117
+ end
118
+
119
+ # The number of messages not held by any claim.
120
+ #
121
+ # @return [Integer]
122
+ def free
123
+ @messages.count { |msg| ! msg.claimed? }
124
+ end
125
+
126
+ # The oldest published message on this queue, or `nil`.
127
+ #
128
+ # @return [MockMessage|UndefinedObject]
129
+ def oldest
130
+ @messages.first
131
+ end
132
+
133
+ # The most recently published message on this queue, or `nil`.
134
+ #
135
+ # @return [MockMessage|UndefinedObject]
136
+ def newest
137
+ @messages.last
138
+ end
139
+
140
+ # Append a new message to the queue.
141
+ #
142
+ # @param client_id [String] UUID for the service object.
143
+ # @param data [Hash] Message payload.
144
+ # @param ttl [Integer] Number of seconds that the message should exist.
145
+ # @return [MockMessage] The message object that was created.
146
+ def add_message(client_id, data, ttl)
147
+ id = @id_counter.to_s(16)
148
+ @id_counter += 1
149
+ message = MockMessage.new(id, self, client_id, data, ttl)
150
+ @messages << message
151
+ message
152
+ end
153
+
154
+ # Create a new MockClaim.
155
+ #
156
+ # @param ttl [Integer] Time-to-live for the claim.
157
+ # @param grace [Integer] Grace period that's added to messages included in this claim.
158
+ def add_claim(ttl, grace)
159
+ claim = MockClaim.new(self, ttl, grace)
160
+ claims[claim.id] = claim
161
+ claim
162
+ end
163
+
164
+ # Access an existing MockClaim by id.
165
+ #
166
+ # @param claim_id [String] An ID of an existing claim.
167
+ # @raises [Fog::Rackspace::Queues::NotFound] If no MockClaim with this ID exists.
168
+ # @return [MockClaim] The requested MockClaim.
169
+ def claim!(claim_id)
170
+ claims[claim_id] or raise NotFound.new
171
+ end
172
+
173
+ # Remove any messages or claims whose ttls have expired.
174
+ def ageoff
175
+ messages.reject! { |m| m.expired? }
176
+
177
+ claims.keys.dup.each do |id|
178
+ claim = claims[id]
179
+ if claim.expired? || claim.messages.empty?
180
+ claim.messages.each { |m| m.claim = nil }
181
+ claims.delete(id)
182
+ end
183
+ end
184
+ end
185
+ end
186
+
187
+ # A single message posted to an in-memory MockQueue.
188
+ class MockMessage
189
+ attr_accessor :id, :queue, :data, :ttl, :producer_id
190
+ attr_accessor :claim, :created
191
+
192
+ # Create a new message. Use {MockQueue#add_message} instead.
193
+ def initialize(id, queue, client_id, data, ttl)
194
+ @id, @queue, @producer_id = id, queue, client_id
195
+ @data, @ttl = data, ttl
196
+ @created = Time.now.to_i
197
+ @claim = nil
198
+ end
199
+
200
+ # Determine how long ago this message was created, in seconds.
201
+ #
202
+ # @return [Integer]
203
+ def age
204
+ Time.now.to_i - @created
205
+ end
206
+
207
+ # Generate a URI segment that identifies this message.
208
+ #
209
+ # @return [String]
210
+ def href
211
+ "#{PATH_BASE}/#{@queue.name}/messages/#{@id}"
212
+ end
213
+
214
+ # Return true if this message has been claimed.
215
+ #
216
+ # @return [Boolean]
217
+ def claimed?
218
+ ! @claim.nil?
219
+ end
220
+
221
+ # Determine if this message has lived longer than its designated ttl.
222
+ #
223
+ # @return [Boolean]
224
+ def expired?
225
+ age > ttl
226
+ end
227
+
228
+ # Extend the {#ttl} of this message to include the lifetime of the claim it belongs to,
229
+ # plus the claim's grace period.
230
+ def extend_life
231
+ return unless @claim
232
+ extended = claim.message_end_of_life - @created
233
+ @ttl = extended if extended > @ttl
234
+ end
235
+
236
+ # Convert this message to a GET payload.
237
+ #
238
+ # @return [Hash]
239
+ def to_h
240
+ {
241
+ "body" => @data,
242
+ "age" => age,
243
+ "ttl" => @ttl,
244
+ "href" => href
245
+ }
246
+ end
247
+ end
248
+
249
+ # Reservation indicating that a consumer is in the process of handling a collection of
250
+ # messages from a queue.
251
+ class MockClaim
252
+ attr_accessor :id, :queue, :ttl, :grace
253
+
254
+ # Create a new MockClaim. Clients should use {MockQueue#add_claim} instead.
255
+ #
256
+ # @param queue [MockQueue] The queue that owns this claim.
257
+ # @param ttl [Integer] Duration, in seconds, that this queue should last.
258
+ # @param grace [Integer] Extra life granted to messages within this claim after this
259
+ # claim expires, to give another consumer a chance to process it.
260
+ def initialize(queue, ttl, grace)
261
+ @queue = queue
262
+ @id = Fog::Mock.random_hex(24)
263
+ @ttl, @grace = ttl, grace
264
+ touch!
265
+ end
266
+
267
+ # Set or reset the creation time of the claim to the present.
268
+ def touch!
269
+ @created = Time.now.to_i
270
+ end
271
+
272
+ # Calculate the time at which messages belonging to this claim should expire.
273
+ #
274
+ # @return [Integer] Seconds since the epoch.
275
+ def message_end_of_life
276
+ @created + @ttl + @grace
277
+ end
278
+
279
+ # Determine how long ago this claim was created, in seconds.
280
+ #
281
+ # @return [Integer]
282
+ def age
283
+ Time.now.to_i - @created
284
+ end
285
+
286
+ # Determine if this claim has lasted longer than its designated ttl.
287
+ #
288
+ # @return [Boolean]
289
+ def expired?
290
+ age > ttl
291
+ end
292
+
293
+ # Access the collection of messages owned by this claim.
294
+ #
295
+ # @return [Array<Message>]
296
+ def messages
297
+ @queue.messages.select { |m| m.claim == self }
298
+ end
299
+
300
+ # Convert this claim into a GET payload.
301
+ #
302
+ # @return [Hash]
303
+ def to_h
304
+ ms = messages.map { |m| m.to_h }
305
+
306
+ {
307
+ "age" => age,
308
+ "href" => "#{PATH_BASE}/#{@queue.name}/claims/#{@id}",
309
+ "ttl" => @ttl,
310
+ "messages" => ms
311
+ }
312
+ end
313
+ end
314
+
315
+ def initialize(options = {})
316
+ apply_options(options)
317
+ authenticate
318
+ endpoint_uri
319
+ end
320
+
321
+ def self.data
322
+ @data ||= Hash.new do |hash, key|
323
+ hash[key] = {}
324
+ end
325
+ end
326
+
327
+ def data
328
+ self.class.data[@rackspace_username]
329
+ end
330
+
331
+ # Create and remember a MockQueue with a given name. An existing MockQueue with the same
332
+ # name will be overridden without warning.
333
+ #
334
+ # @param [String] Valid queue name.
335
+ # @return [MockQueue] The MockQueue that was created.
336
+ def add_queue(queue_name)
337
+ queue = MockQueue.new(queue_name)
338
+ data[queue_name] = queue
339
+ queue
340
+ end
341
+
342
+ # Access a MockQueue with the specified name, or return `nil`.
343
+ #
344
+ # @param queue_name [String] Valid queue name.
345
+ # @return [MockQueue|UndefinedObject] The queue with the specified name, or `nil` if
346
+ # it doesn't exist.
347
+ def mock_queue(queue_name)
348
+ data[queue_name]
349
+ end
350
+
351
+ # Access a MockQueue with the specified name, raising an exception if it doesn't exist.
352
+ #
353
+ # @param queue_name [String] Valid queue name.
354
+ # @raises [Fog::Rackspace::Queue::NotFound] If there is no queue with the specified name.
355
+ # @return [MockQueue] The queue with the specified name.
356
+ def mock_queue!(queue_name)
357
+ mock_queue(queue_name) or raise NotFound.new
358
+ end
359
+
360
+ # Remove any messages or expire any claims that have exceeded their ttl values. Invoked
361
+ # before every request.
362
+ def ageoff
363
+ data.values.each { |q| q.ageoff }
364
+ end
365
+
366
+ def request(params)
367
+ ageoff
368
+ super
369
+ end
370
+ end
371
+
372
+ class Real < Fog::Rackspace::Service
373
+ include Common
374
+
375
+ def initialize(options = {})
376
+ apply_options(options)
377
+
378
+ authenticate
379
+
380
+ @persistent = options[:persistent] || false
381
+ @connection = Fog::Connection.new(endpoint_uri.to_s, @persistent, @connection_options)
382
+ end
383
+
384
+ def request(params, parse_json = true, &block)
385
+ super(params, parse_json, &block)
386
+ rescue Excon::Errors::NotFound => error
387
+ raise NotFound.slurp(error, self)
388
+ rescue Excon::Errors::BadRequest => error
389
+ raise BadRequest.slurp(error, self)
390
+ rescue Excon::Errors::InternalServerError => error
391
+ raise InternalServerError.slurp(error, self)
392
+ rescue Excon::Errors::MethodNotAllowed => error
393
+ raise MethodNotAllowed.slurp(error, self)
394
+ rescue Excon::Errors::HTTPStatusError => error
395
+ raise ServiceError.slurp(error, self)
396
+ end
397
+ end
398
+
115
399
  end
116
400
  end
117
401
  end