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
@@ -0,0 +1,681 @@
1
+ #Compute (Nova)
2
+
3
+ This document explains how to get started using OpenStack Compute (Nova) with Fog. It assumes you have read the [Getting Started with Fog and the OpenStack](getting_started.md) document.
4
+
5
+ ## Starting irb console
6
+
7
+ Start by executing the following command:
8
+
9
+ irb
10
+
11
+ Once `irb` has launched you need to require the Fog library by executing:
12
+
13
+ require 'fog'
14
+
15
+ ## Create Service
16
+
17
+ Next, create a connection to the Compute Service:
18
+
19
+ service = Fog::Compute.new({
20
+ :provider => 'openstack', # OpenStack Fog provider
21
+ :openstack_auth_url => 'http://KEYSTONE_HOST:KEYSTONE_PORT/v2.0/tokens', # OpenStack Keystone endpoint
22
+ :openstack_username => OPEN_STACK_USER, # Your OpenStack Username
23
+ :openstack_tenant => OPEN_STACK_TENANT, # Your tenant id
24
+ :openstack_api_key => OPEN_STACK_PASSWORD, # Your OpenStack Password
25
+ :connection_options => {} # Optional
26
+ })
27
+
28
+ **Note** `openstack_username` and `openstack_tenant` default to `admin` if omitted.
29
+
30
+ ### Optional Connection Parameters
31
+
32
+ Fog supports passing additional connection parameters to its underlying HTTP library (Excon) using the `:connection_options` parameter.
33
+
34
+ <table>
35
+ <tr>
36
+ <th>Key</th>
37
+ <th>Description</th>
38
+ </tr>
39
+ <tr>
40
+ <td>:connect_timeout</td>
41
+ <td>Connection timeout (default: 60 seconds)</td>
42
+ </tr>
43
+ <tr>
44
+ <td>:read_timeout</td>
45
+ <td>Read timeout for connection (default: 60 seconds)</td> </tr>
46
+ <tr>
47
+ <td>:write_timeout</td>
48
+ <td>Write timeout for connection (default: 60 seconds)</td>
49
+ </tr>
50
+ <tr>
51
+ <td>:proxy</td>
52
+ <td>Proxy for HTTP and HTTPS connections</td>
53
+ </tr>
54
+ <tr>
55
+ <td>:ssl_ca_path</td>
56
+ <td>Path to SSL certificate authorities</td>
57
+ </tr>
58
+ <tr>
59
+ <td>:ssl_ca_file</td>
60
+ <td>SSL certificate authority file</td>
61
+ </tr>
62
+ <tr>
63
+ <td>:ssl_verify_peer</td>
64
+ <td>SSL verify peer (default: true)</td>
65
+ </tr>
66
+ </table>
67
+
68
+
69
+ ## Fog Abstractions
70
+
71
+ Fog provides both a **model** and **request** abstraction. The request abstraction provides the most efficient interface and the model abstraction wraps the request abstraction to provide a convenient `ActiveModel` like interface.
72
+
73
+ ### Request Layer
74
+
75
+ The request abstraction maps directly to the [OpenStack Compute API](http://docs.openstack.org/api/openstack-compute/2/content/). It provides the most efficient interface to the OpenStack Compute service.
76
+
77
+ To see a list of requests supported by the service:
78
+
79
+ service.requests
80
+
81
+ This returns:
82
+
83
+ :list_servers, :list_servers_detail, :create_server, :get_server_details, :update_server, :delete_server, :server_actions, :server_action, :reboot_server, :rebuild_server, :resize_server, :confirm_resize_server, :revert_resize_server, :pause_server, :unpause_server, :suspend_server, :resume_server, :rescue_server, :change_server_password, :add_fixed_ip, :remove_fixed_ip, :server_diagnostics, :boot_from_snapshot, :reset_server_state, :get_console_output, :get_vnc_console, :live_migrate_server, :migrate_server, :list_images, :list_images_detail, :create_image, :get_image_details, :delete_image, :list_flavors, :list_flavors_detail, :get_flavor_details, :create_flavor, :delete_flavor, :add_flavor_access, :remove_flavor_access, :list_tenants_with_flavor_access, :list_metadata, :get_metadata, :set_metadata, :update_metadata, :delete_metadata, :delete_meta, :update_meta, :list_addresses, :list_address_pools, :list_all_addresses, :list_private_addresses, :list_public_addresses, :get_address, :allocate_address, :associate_address, :release_address, :disassociate_address, :list_security_groups, :get_security_group, :create_security_group, :create_security_group_rule, :delete_security_group, :delete_security_group_rule, :get_security_group_rule, :list_key_pairs, :create_key_pair, :delete_key_pair, :list_tenants, :set_tenant, :get_limits, :list_volumes, :create_volume, :get_volume_details, :delete_volume, :attach_volume, :detach_volume, :get_server_volumes, :create_volume_snapshot, :list_snapshots, :get_snapshot_details, :delete_snapshot, :list_usages, :get_usage, :get_quota, :get_quota_defaults, :update_quota, :list_hosts, :get_host_details
84
+
85
+
86
+ #### Example Request
87
+
88
+ To request a list of flavors:
89
+
90
+ response = service.list_flavors
91
+
92
+ This returns in the following `Excon::Response`:
93
+
94
+ #<Excon::Response:0x007f88a12d0268 @data={:body=>{"flavors"=>[{"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}], "name"=>"m1.tiny"}, {"id"=>"2", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}], "name"=>"m1.small"}, {"id"=>"3", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"bookmark"}], "name"=>"m1.medium"}, {"id"=>"4", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"bookmark"}], "name"=>"m1.large"}, {"id"=>"42", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"bookmark"}], "name"=>"m1.nano"}, {"id"=>"5", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"bookmark"}], "name"=>"m1.xlarge"}, {"id"=>"84", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"bookmark"}], "name"=>"m1.micro"}]}, :headers=>{"Content-Type"=>"application/json", "Content-Length"=>"1748", "X-Compute-Request-Id"=>"req-ae3bcf11-deab-493b-a2d8-1432dead3f7a", "Date"=>"Thu, 09 Jan 2014 17:01:15 GMT"}, :status=>200, :remote_ip=>"localhost"}, @body="{\"flavors\": [{\"id\": \"1\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1\", \"rel\": \"bookmark\"}], \"name\": \"m1.tiny\"}, {\"id\": \"2\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2\", \"rel\": \"bookmark\"}], \"name\": \"m1.small\"}, {\"id\": \"3\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3\", \"rel\": \"bookmark\"}], \"name\": \"m1.medium\"}, {\"id\": \"4\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4\", \"rel\": \"bookmark\"}], \"name\": \"m1.large\"}, {\"id\": \"42\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42\", \"rel\": \"bookmark\"}], \"name\": \"m1.nano\"}, {\"id\": \"5\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5\", \"rel\": \"bookmark\"}], \"name\": \"m1.xlarge\"}, {\"id\": \"84\", \"links\": [{\"href\": \"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84\", \"rel\": \"self\"}, {\"href\": \"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84\", \"rel\": \"bookmark\"}], \"name\": \"m1.micro\"}]}", @headers={"Content-Type"=>"application/json", "Content-Length"=>"1748", "X-Compute-Request-Id"=>"req-ae3bcf11-deab-493b-a2d8-1432dead3f7a", "Date"=>"Thu, 09 Jan 2014 17:01:15 GMT"}, @status=200, @remote_ip="localhost">
95
+
96
+ To view the status of the response:
97
+
98
+ response.status
99
+
100
+ **Note**: Fog is aware of valid HTTP response statuses for each request type. If an unexpected HTTP response status occurs, Fog will raise an exception.
101
+
102
+ To view response body:
103
+
104
+ response.body
105
+
106
+ This will return:
107
+
108
+ {"flavors"=>[{"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}], "name"=>"m1.tiny"}, {"id"=>"2", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}], "name"=>"m1.small"}, {"id"=>"3", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/3", "rel"=>"bookmark"}], "name"=>"m1.medium"}, {"id"=>"4", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/4", "rel"=>"bookmark"}], "name"=>"m1.large"}, {"id"=>"42", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/42", "rel"=>"bookmark"}], "name"=>"m1.nano"}, {"id"=>"5", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/5", "rel"=>"bookmark"}], "name"=>"m1.xlarge"}, {"id"=>"84", "links"=>[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/84", "rel"=>"bookmark"}], "name"=>"m1.micro"}]}
109
+
110
+
111
+ To learn more about Compute request methods refer to [rdoc](http://rubydoc.info/gems/fog/Fog/Compute/Openstack/Real). To learn more about Excon refer to [Excon GitHub repo](https://github.com/geemus/excon).
112
+
113
+ ### Model Layer
114
+
115
+ Fog models behave in a manner similar to `ActiveModel`. Models will generally respond to `create`, `save`, `persisted?`, `destroy`, `reload` and `attributes` methods. Additionally, fog will automatically create attribute accessors.
116
+
117
+ Here is a summary of common model methods:
118
+
119
+ <table>
120
+ <tr>
121
+ <th>Method</th>
122
+ <th>Description</th>
123
+ </tr>
124
+ <tr>
125
+ <td>create</td>
126
+ <td>
127
+ Accepts hash of attributes and creates object.<br>
128
+ Note: creation is a non-blocking call and you will be required to wait for a valid state before using resulting object.
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td>save</td>
133
+ <td>Saves object.<br>
134
+ Note: not all objects support updating object.</td>
135
+ </tr>
136
+ <tr>
137
+ <td>persisted?</td>
138
+ <td>Returns true if the object has been persisted.</td>
139
+ </tr>
140
+ <tr>
141
+ <td>destroy</td>
142
+ <td>
143
+ Destroys object.<br>
144
+ Note: this is a non-blocking call and object deletion might not be instantaneous.
145
+ </td>
146
+ <tr>
147
+ <td>reload</td>
148
+ <td>Updates object with latest state from service.</td>
149
+ <tr>
150
+ <td>ready?</td>
151
+ <td>Returns true if object is in a ready state and able to perform actions. This method will raise an exception if object is in an error state.</td>
152
+ </tr>
153
+ <tr>
154
+ <td>attributes</td>
155
+ <td>Returns a hash containing the list of model attributes and values.</td>
156
+ </tr>
157
+ <td>identity</td>
158
+ <td>
159
+ Returns the identity of the object.<br>
160
+ Note: This might not always be equal to object.id.
161
+ </td>
162
+ </tr>
163
+ <tr>
164
+ <td>wait_for</td>
165
+ <td>This method periodically reloads model and then yields to specified block until block returns true or a timeout occurs.</td>
166
+ </tr>
167
+ </table>
168
+
169
+ The remainder of this document details the model abstraction.
170
+
171
+ ## List Images
172
+
173
+ To retrieve a list of available images:
174
+
175
+ service.images
176
+
177
+ This returns a collection of `Fog::Compute::OpenStack::Image` models:
178
+
179
+ <Fog::Compute::OpenStack::Images
180
+ filters={},
181
+ server=nil
182
+ [
183
+ <Fog::Compute::OpenStack::Image
184
+ id="821e2b73-5aed-4f9d-aaa7-2f4f297779f3",
185
+ name="cirros-0.3.1-x86_64-uec",
186
+ created_at="2013-07-11T19:59:19Z",
187
+ updated_at="2013-07-11T19:59:20Z",
188
+ progress=100,
189
+ status="ACTIVE",
190
+ minDisk=0,
191
+ minRam=0,
192
+ server=nil,
193
+ metadata= <Fog::Compute::OpenStack::Metadata
194
+ [
195
+ <Fog::Compute::OpenStack::Metadatum
196
+ key="kernel_id",
197
+ value="f443896b-089c-40e7-8712-bb48a676a8de"
198
+ >,
199
+ <Fog::Compute::OpenStack::Metadatum
200
+ key="ramdisk_id",
201
+ value="e21af7e2-a181-403a-84a4-fd9df36cb963"
202
+ >
203
+ ]
204
+ >,
205
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
206
+ >,
207
+ <Fog::Compute::OpenStack::Image
208
+ id="e21af7e2-a181-403a-84a4-fd9df36cb963",
209
+ name="cirros-0.3.1-x86_64-uec-ramdisk",
210
+ created_at="2013-07-11T19:59:18Z",
211
+ updated_at="2013-07-11T19:59:18Z",
212
+ progress=100,
213
+ status="ACTIVE",
214
+ minDisk=0,
215
+ minRam=0,
216
+ server=nil,
217
+ metadata= <Fog::Compute::OpenStack::Metadata
218
+ []
219
+ >,
220
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/e21af7e2-a181-403a-84a4-fd9df36cb963", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
221
+ >,
222
+
223
+
224
+ ## Get Image
225
+
226
+ To retrieve individual image:
227
+
228
+ service.images.get "821e2b73-5aed-4f9d-aaa7-2f4f297779f3"
229
+
230
+ This returns an `Fog::Compute::OpenStack::Image` instance:
231
+
232
+ <Fog::Compute::OpenStack::Image
233
+ id="821e2b73-5aed-4f9d-aaa7-2f4f297779f3",
234
+ name="cirros-0.3.1-x86_64-uec",
235
+ created_at="2013-07-11T19:59:19Z",
236
+ updated_at="2013-07-11T19:59:20Z",
237
+ progress=100,
238
+ status="ACTIVE",
239
+ minDisk=0,
240
+ minRam=0,
241
+ server=nil,
242
+ metadata= <Fog::Compute::OpenStack::Metadata
243
+ [
244
+ <Fog::Compute::OpenStack::Metadatum
245
+ key="kernel_id",
246
+ value="f443896b-089c-40e7-8712-bb48a676a8de"
247
+ >,
248
+ <Fog::Compute::OpenStack::Metadatum
249
+ key="ramdisk_id",
250
+ value="e21af7e2-a181-403a-84a4-fd9df36cb963"
251
+ >
252
+ ]
253
+ >,
254
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}, {"href"=>"http://localhost:9292/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "type"=>"application/vnd.openstack.image", "rel"=>"alternate"}]
255
+ >
256
+
257
+ ## List Flavors
258
+
259
+ To retrieve a list of available flavors:
260
+
261
+ service.flavors
262
+
263
+ This returns a collection of `Fog::Compute::OpenStack::Flavor` models:
264
+
265
+ <Fog::Compute::OpenStack::Flavors
266
+ [
267
+ <Fog::Compute::OpenStack::Flavor
268
+ id="1",
269
+ name="m1.tiny",
270
+ ram=512,
271
+ disk=1,
272
+ vcpus=1,
273
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}],
274
+ swap="",
275
+ rxtx_factor=1.0,
276
+ ephemeral=0,
277
+ is_public=true,
278
+ disabled=false
279
+ >,
280
+ <Fog::Compute::OpenStack::Flavor
281
+ id="2",
282
+ name="m1.small",
283
+ ram=2048,
284
+ disk=20,
285
+ vcpus=1,
286
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/2", "rel"=>"bookmark"}],
287
+ swap="",
288
+ rxtx_factor=1.0,
289
+ ephemeral=0,
290
+ is_public=true,
291
+ disabled=false
292
+ >,
293
+
294
+
295
+
296
+ ## Get Flavor
297
+
298
+ To retrieve individual flavor:
299
+
300
+ service.flavor.get 1
301
+
302
+ This returns a `Fog::Compute::OpenStack::Flavor` instance:
303
+
304
+ <Fog::Compute::OpenStack::Flavor
305
+ id="1",
306
+ name="m1.tiny",
307
+ ram=512,
308
+ disk=1,
309
+ vcpus=1,
310
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}],
311
+ swap="",
312
+ rxtx_factor=1.0,
313
+ ephemeral=0,
314
+ is_public=true,
315
+ disabled=false
316
+ >
317
+
318
+ ## List Servers
319
+
320
+ To retrieve a list of available servers:
321
+
322
+ service.servers
323
+
324
+ This returns a collection of `Fog::Compute::OpenStack::Servers` models:
325
+
326
+ <Fog::Compute::OpenStack::Servers
327
+ filters={}
328
+ [
329
+ <Fog::Compute::OpenStack::Server
330
+ id="4572529c-0cfc-433e-8dbf-7cc383ed5b7c",
331
+ instance_name=nil,
332
+ addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:14:34:b8", "version"=>4, "addr"=>"10.0.0.5", "OS-EXT-IPS:type"=>"fixed"}]},
333
+ flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
334
+ host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
335
+ image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
336
+ metadata= <Fog::Compute::OpenStack::Metadata
337
+ []
338
+ >,
339
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"bookmark"}],
340
+ name="doc-test",
341
+ personality=nil,
342
+ progress=0,
343
+ accessIPv4="",
344
+ accessIPv6="",
345
+ availability_zone="nova",
346
+ user_data_encoded=nil,
347
+ state="ACTIVE",
348
+ created=2013-10-10 18:17:46 UTC,
349
+ updated=2013-10-10 18:17:56 UTC,
350
+ tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
351
+ user_id="dbee88bc901b4593867c105b2b1ad15b",
352
+ key_name=nil,
353
+ fault=nil,
354
+ config_drive="",
355
+ os_dcf_disk_config="MANUAL",
356
+ os_ext_srv_attr_host="devstack",
357
+ os_ext_srv_attr_hypervisor_hostname="devstack",
358
+ os_ext_srv_attr_instance_name="instance-00000016",
359
+ os_ext_sts_power_state=1,
360
+ os_ext_sts_task_state=nil,
361
+ os_ext_sts_vm_state="active"
362
+ >,
363
+
364
+
365
+ ## Get Server
366
+
367
+ To return an individual server:
368
+
369
+ service.servers.get "4572529c-0cfc-433e-8dbf-7cc383ed5b7c"
370
+
371
+ This returns a `Fog::Compute::OpenStack::Server` instance:
372
+
373
+ <Fog::Compute::OpenStack::Server
374
+ id="4572529c-0cfc-433e-8dbf-7cc383ed5b7c",
375
+ instance_name=nil,
376
+ addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:14:34:b8", "version"=>4, "addr"=>"10.0.0.5", "OS-EXT-IPS:type"=>"fixed"}]},
377
+ flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
378
+ host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
379
+ image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
380
+ metadata= <Fog::Compute::OpenStack::Metadata
381
+ []
382
+ >,
383
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/4572529c-0cfc-433e-8dbf-7cc383ed5b7c", "rel"=>"bookmark"}],
384
+ name="doc-test",
385
+ personality=nil,
386
+ progress=0,
387
+ accessIPv4="",
388
+ accessIPv6="",
389
+ availability_zone="nova",
390
+ user_data_encoded=nil,
391
+ state="ACTIVE",
392
+ created=2013-10-10 18:17:46 UTC,
393
+ updated=2013-10-10 18:17:56 UTC,
394
+ tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
395
+ user_id="dbee88bc901b4593867c105b2b1ad15b",
396
+ key_name=nil,
397
+ fault=nil,
398
+ config_drive="",
399
+ os_dcf_disk_config="MANUAL",
400
+ os_ext_srv_attr_host="devstack",
401
+ os_ext_srv_attr_hypervisor_hostname="devstack",
402
+ os_ext_srv_attr_instance_name="instance-00000016",
403
+ os_ext_sts_power_state=1,
404
+ os_ext_sts_task_state=nil,
405
+ os_ext_sts_vm_state="active"
406
+ >
407
+
408
+ ## Create Server
409
+
410
+ If you are interested in creating a server utilizing ssh key authentication, you are recommended to use [bootstrap](#bootstrap) method.
411
+
412
+ To create a server:
413
+
414
+ flavor = service.flavors.first
415
+ image = service.images.first
416
+ server = service.servers.create(:name => 'fog-doc', :flavor_ref => flavor.id, :image_ref => image.id)
417
+
418
+ **Note**: The `:name`, `:flavor_ref`, and `image_ref` attributes are required for server creation.
419
+
420
+ This will return a `Fog::Compute::OpenStack::Server` instance:
421
+
422
+ <Fog::Compute::OpenStack::Server
423
+ id="81746324-94ab-44fb-9aa9-ee0b4d95fa34",
424
+ instance_name=nil,
425
+ addresses=nil,
426
+ flavor=nil,
427
+ host_id=nil,
428
+ image=nil,
429
+ metadata= <Fog::Compute::OpenStack::Metadata
430
+ []
431
+ >,
432
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/81746324-94ab-44fb-9aa9-ee0b4d95fa34", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/81746324-94ab-44fb-9aa9-ee0b4d95fa34", "rel"=>"bookmark"}],
433
+ name="fog-doc",
434
+ personality=nil,
435
+ progress=nil,
436
+ accessIPv4=nil,
437
+ accessIPv6=nil,
438
+ availability_zone=nil,
439
+ user_data_encoded=nil,
440
+ state=nil,
441
+ created=nil,
442
+ updated=nil,
443
+ tenant_id=nil,
444
+ user_id=nil,
445
+ key_name=nil,
446
+ fault=nil,
447
+ config_drive=nil,
448
+ os_dcf_disk_config="MANUAL",
449
+ os_ext_srv_attr_host=nil,
450
+ os_ext_srv_attr_hypervisor_hostname=nil,
451
+ os_ext_srv_attr_instance_name=nil,
452
+ os_ext_sts_power_state=nil,
453
+ os_ext_sts_task_state=nil,
454
+ os_ext_sts_vm_state=nil
455
+ >
456
+
457
+ Notice that your server contains several `nil` attributes. To see the latest status, reload the instance as follows:
458
+
459
+ server.reload
460
+
461
+ You can see that the server is currently being built:
462
+
463
+ <Fog::Compute::OpenStack::Server
464
+ id="5f50aeff-a745-4cbc-9f8b-0356142e6f95",
465
+ instance_name=nil,
466
+ addresses={"private"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:71:0d:c4", "version"=>4, "addr"=>"10.0.0.2", "OS-EXT-IPS:type"=>"fixed"}]},
467
+ flavor={"id"=>"1", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/flavors/1", "rel"=>"bookmark"}]},
468
+ host_id="bb705edc279c520d97ad6fbd0b8e75a5c716388616f58e527d0ff633",
469
+ image={"id"=>"821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "links"=>[{"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/images/821e2b73-5aed-4f9d-aaa7-2f4f297779f3", "rel"=>"bookmark"}]},
470
+ metadata= <Fog::Compute::OpenStack::Metadata
471
+ []
472
+ >,
473
+ links=[{"href"=>"http://localhost:8774/v2/b5bf8e689bc64844b1d08094a2f2bdd5/servers/5f50aeff-a745-4cbc-9f8b-0356142e6f95", "rel"=>"self"}, {"href"=>"http://localhost:8774/b5bf8e689bc64844b1d08094a2f2bdd5/servers/5f50aeff-a745-4cbc-9f8b-0356142e6f95", "rel"=>"bookmark"}],
474
+ name="fog-doc",
475
+ personality=nil,
476
+ progress=0,
477
+ accessIPv4="",
478
+ accessIPv6="",
479
+ availability_zone="nova",
480
+ user_data_encoded=nil,
481
+ state="BUILD",
482
+ created=2014-01-09 19:43:52 UTC,
483
+ updated=2014-01-09 19:43:58 UTC,
484
+ tenant_id="b5bf8e689bc64844b1d08094a2f2bdd5",
485
+ user_id="dbee88bc901b4593867c105b2b1ad15b",
486
+ key_name=nil,
487
+ fault=nil,
488
+ config_drive="",
489
+ os_dcf_disk_config="MANUAL",
490
+ os_ext_srv_attr_host="devstack",
491
+ os_ext_srv_attr_hypervisor_hostname="devstack",
492
+ os_ext_srv_attr_instance_name="instance-00000018",
493
+ os_ext_sts_power_state=0,
494
+ os_ext_sts_task_state="spawning",
495
+ os_ext_sts_vm_state="building"
496
+ >
497
+
498
+ You will be unable to perform any actions to this server until it reaches an `ACTIVE` state. Since this is true for most server actions, Fog provides the convenience method `wait_for`.
499
+
500
+ Fog can wait for the server to become ready as follows:
501
+
502
+ server.wait_for { ready? }
503
+
504
+ **Note**: The `Fog::Compute::OpenStack::Server` instance returned from the create method contains a `password` attribute. The `password` attribute will NOT be present in subsequent retrievals either through `service.servers` or `service.servers.get my_server_id`.
505
+
506
+ ### Additional Parameters
507
+
508
+ The `create` method also supports the following key values:
509
+
510
+ <table>
511
+ <tr>
512
+ <th>Key</th>
513
+ <th>Description</th>
514
+ </tr>
515
+ <tr>
516
+ <td>:metadata</td>
517
+ <td>Hash containing server metadata.</td>
518
+ </tr>
519
+ <tr>
520
+ <td>:personality</td>
521
+ <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/OpenStack/Server:personality">personality </a> API documentation for further information.</td>
522
+ </tr>
523
+ </table>
524
+
525
+ ## Bootstrap
526
+
527
+ In addition to the `create` method, Fog provides a `bootstrap` method which creates a server and then performs the following actions via ssh:
528
+
529
+ 1. Create `ROOT_USER/.ssh/authorized_keys` file using the ssh key specified in `:public_key_path`.
530
+ 2. Lock password for root user using `passwd -l root`.
531
+ 3. Create `ROOT_USER/attributes.json` file with the contents of `server.attributes`.
532
+ 4. Create `ROOT_USER/metadata.json` file with the contents of `server.metadata`.
533
+
534
+ **Note**: Unlike the `create` method, `bootstrap` is blocking method call. If non-blocking behavior is desired, developers should use the `:personality` parameter on the `create` method.
535
+
536
+ The following example demonstrates bootstraping a server:
537
+
538
+ service.servers.bootstrap :name => 'bootstrap-server',
539
+ :flavor_id => service.flavors.first.id,
540
+ :image_id => service.images.find {|img| img.name =~ /Ubuntu/}.id,
541
+ :public_key_path => '~/.ssh/fog_rsa.pub',
542
+ :private_key_path => '~/.ssh/fog_rsa'
543
+
544
+ **Note**: The `:name`, `:flavor_ref`, `:image_ref`, `:public_key_path`, `:private_key_path` are required for the `bootstrap` method.
545
+
546
+ The `bootstrap` method uses the same additional parameters as the `create` method. Refer to the [Additional Parameters](#additional-parameters) section for more information.
547
+
548
+ ## SSH
549
+
550
+ Once a server has been created and set up for ssh key authentication, fog can execute remote commands as follows:
551
+
552
+ result = server.ssh ['pwd']
553
+
554
+ This will return the following:
555
+
556
+ [#<Fog::SSH::Result:0x1108241d0 @stderr="", @status=0, @stdout="/root\r\n", @command="pwd">]
557
+
558
+ **Note**: SSH key authentication can be set up using `bootstrap` method or by using the `:personality` attribute on the `:create` method. See [Bootstrap](#bootstrap) or [Create Server](#create-server) for more information.
559
+
560
+ ## Delete Server
561
+
562
+ To delete a server:
563
+
564
+ server.destroy
565
+
566
+ **Note**: The server is not immediately destroyed, but it does occur shortly there after.
567
+
568
+ ## Change Admin Password
569
+
570
+ To change the administrator password:
571
+
572
+ server.change_password "superSecure"
573
+
574
+ ## Reboot
575
+
576
+ To perform a soft reboot:
577
+
578
+ server.reboot
579
+
580
+ To perform a hard reboot:
581
+
582
+ server.reboot 'HARD'
583
+
584
+ ## Rebuild
585
+
586
+ Rebuild removes all data on the server and replaces it with the specified image. The id and all IP addresses remain the same.
587
+
588
+ The rebuild method has the following method signature:
589
+
590
+ def rebuild(image_ref, name, admin_pass=nil, metadata=nil, personality=nil)
591
+
592
+ A basic server build is as follows:
593
+
594
+ image = service.images.first
595
+ server.rebuild(image.id, name)
596
+
597
+ ## Resize
598
+
599
+ Resizing a server allows you to change the resources dedicated to the server.
600
+
601
+ To resize a server:
602
+
603
+ flavor = service.flavor[2]
604
+ server.resize flavor.id
605
+
606
+ During the resize process the server will have a state of `RESIZE`. Once a server has completed resizing it will be in a `VERIFY_RESIZE` state.
607
+
608
+ You can use Fog's `wait_for` method to wait for this state as follows:
609
+
610
+ server.wait_for { server.status == 'VERIFY_RESIZE' }
611
+
612
+
613
+ In this case, `wait_for` is waiting for the server to become `VERIFY_READY` and will raise an exception if we enter an `ACTIVE` or `ERROR` state.
614
+
615
+ Once a server enters the `VERIFY_RESIZE` we will need to call `confirm_resize` to confirm the server was properly resized or `revert_resize` to rollback to the old size/flavor.
616
+
617
+ **Note:** A server will automatically confirm resize after 24 hours.
618
+
619
+ To confirm resize:
620
+
621
+ server.confirm_resize
622
+
623
+ To revert to previous size/flavor:
624
+
625
+ server.revert_resize
626
+
627
+ ## Create Image
628
+
629
+ To create an image of your server:
630
+
631
+ response = server.create_image "back-image-#{server.name}", :metadata => { :environment => 'development' }
632
+
633
+ You can use the second parameter to specify image metadata. This is an optional parameter.`
634
+
635
+ During the imaging process, the image state will be `SAVING`. The image is ready for use when when state `ACTIVE` is reached. Fog can use `wait_for` to wait for an active state as follows:
636
+
637
+ image_id = response.body["image"]["id"]
638
+ image = service.images.get image_id
639
+ image.wait_for { ready? }
640
+
641
+ ## List Attached Volumes
642
+
643
+ To list Cloud Block Volumes attached to server:
644
+
645
+ server.volume_attachments
646
+
647
+ ## Attach Volume
648
+
649
+ To attach volume using the volume id:
650
+
651
+ server.attach_volume "0e7a706c-340d-48b3-802d-192850387f93", "/dev/xvdb"
652
+
653
+ If the volume id is unknown you can look it up as follows:
654
+
655
+ volume = service.volumes.first
656
+ server.attach_volume volume.id, "/dev/xvdb"
657
+
658
+ **Note** Valid device names are `/dev/xvd[a-p]`.
659
+
660
+ ## Detach Volume
661
+
662
+ To detach a volume:
663
+
664
+ server.detach_volume volume.id
665
+
666
+ ## Examples
667
+
668
+ Example code using Compute can be found [here](https://github.com/fog/fog/tree/master/lib/fog/openstack/examples/compute).
669
+
670
+ ## Additional Resources
671
+
672
+ * [fog.io](http://fog.io/)
673
+ * [Fog rdoc](http://rubydoc.info/gems/fog/)
674
+ * [Fog Github repo](https://github.com/fog/fog)
675
+ * [Fog Github Issues](https://github.com/fog/fog/issues)
676
+ * [Excon Github repo](https://github.com/geemus/excon)
677
+ * [OpenStack Compute API](http://docs.openstack.org/api/openstack-compute/2/content/)
678
+
679
+ ## Support and Feedback
680
+
681
+ Your feedback is appreciated! If you have specific issues with the **fog** SDK, you should file an [issue via Github](https://github.com/fog/fog/issues).