fog 1.21.0 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +3 -0
  3. data/.travis.yml +4 -2
  4. data/.yardopts +1 -0
  5. data/CHANGELOG.md +8278 -0
  6. data/CONTRIBUTORS.md +37 -0
  7. data/Gemfile +2 -0
  8. data/RELEASE.md +2 -1
  9. data/Rakefile +4 -1
  10. data/fog.gemspec +4 -5
  11. data/gemfiles/Gemfile-edge +17 -0
  12. data/{Gemfile.1.8.7 → gemfiles/Gemfile-ruby-1.8.7} +4 -1
  13. data/lib/fog/aws/core.rb +0 -9
  14. data/lib/fog/aws/dynamodb.rb +0 -1
  15. data/lib/fog/aws/iam.rb +29 -5
  16. data/lib/fog/aws/parsers/compute/describe_dhcp_options.rb +1 -2
  17. data/lib/fog/aws/parsers/iam/list_mfa_devices.rb +34 -0
  18. data/lib/fog/aws/requests/compute/run_instances.rb +8 -2
  19. data/lib/fog/aws/requests/data_pipeline/describe_objects.rb +5 -4
  20. data/lib/fog/aws/requests/iam/list_mfa_devices.rb +55 -0
  21. data/lib/fog/aws/storage.rb +0 -9
  22. data/lib/fog/cloudsigma/docs/getting_started.md +2 -2
  23. data/lib/fog/cloudstack/models/compute/servers.rb +3 -0
  24. data/lib/fog/ecloud/compute.rb +1 -1
  25. data/lib/fog/fogdocker/requests/compute/container_action.rb +1 -1
  26. data/lib/fog/fogdocker/requests/compute/container_all.rb +1 -1
  27. data/lib/fog/fogdocker/requests/compute/container_commit.rb +1 -1
  28. data/lib/fog/fogdocker/requests/compute/container_create.rb +1 -1
  29. data/lib/fog/fogdocker/requests/compute/container_get.rb +1 -1
  30. data/lib/fog/fogdocker/requests/compute/image_all.rb +1 -1
  31. data/lib/fog/fogdocker/requests/compute/image_create.rb +1 -1
  32. data/lib/fog/fogdocker/requests/compute/image_get.rb +1 -1
  33. data/lib/fog/glesys/compute.rb +6 -6
  34. data/lib/fog/google/README.md +1 -1
  35. data/lib/fog/google/compute.rb +63 -3
  36. data/lib/fog/google/examples/create.rb +1 -1
  37. data/lib/fog/google/examples/eric-fail.rb +13 -7
  38. data/lib/fog/google/examples/load-balance.rb +100 -0
  39. data/lib/fog/google/models/compute/address.rb +62 -0
  40. data/lib/fog/google/models/compute/addresses.rb +34 -0
  41. data/lib/fog/google/models/compute/disk.rb +13 -5
  42. data/lib/fog/google/models/compute/firewall.rb +48 -0
  43. data/lib/fog/google/models/compute/firewalls.rb +27 -0
  44. data/lib/fog/google/models/compute/flavor.rb +16 -5
  45. data/lib/fog/google/models/compute/flavors.rb +10 -4
  46. data/lib/fog/google/models/compute/forwarding_rule.rb +88 -0
  47. data/lib/fog/google/models/compute/forwarding_rules.rb +45 -0
  48. data/lib/fog/google/models/compute/http_health_check.rb +85 -0
  49. data/lib/fog/google/models/compute/http_health_checks.rb +26 -0
  50. data/lib/fog/google/models/compute/network.rb +45 -0
  51. data/lib/fog/google/models/compute/networks.rb +27 -0
  52. data/lib/fog/google/models/compute/operation.rb +41 -5
  53. data/lib/fog/google/models/compute/operations.rb +18 -3
  54. data/lib/fog/google/models/compute/project.rb +32 -0
  55. data/lib/fog/google/models/compute/projects.rb +22 -0
  56. data/lib/fog/google/models/compute/region.rb +34 -0
  57. data/lib/fog/google/models/compute/regions.rb +27 -0
  58. data/lib/fog/google/models/compute/route.rb +52 -0
  59. data/lib/fog/google/models/compute/routes.rb +27 -0
  60. data/lib/fog/google/models/compute/server.rb +24 -7
  61. data/lib/fog/google/models/compute/servers.rb +2 -2
  62. data/lib/fog/google/models/compute/snapshot.rb +22 -7
  63. data/lib/fog/google/models/compute/snapshots.rb +4 -2
  64. data/lib/fog/google/models/compute/target_pool.rb +112 -0
  65. data/lib/fog/google/models/compute/target_pools.rb +45 -0
  66. data/lib/fog/google/requests/compute/add_target_pool_health_checks.rb +34 -0
  67. data/lib/fog/google/requests/compute/add_target_pool_instances.rb +34 -0
  68. data/lib/fog/google/requests/compute/delete_forwarding_rule.rb +36 -0
  69. data/lib/fog/google/requests/compute/delete_http_health_check.rb +30 -0
  70. data/lib/fog/google/requests/compute/delete_region_operation.rb +33 -0
  71. data/lib/fog/google/requests/compute/delete_route.rb +26 -0
  72. data/lib/fog/google/requests/compute/delete_snapshot.rb +2 -7
  73. data/lib/fog/google/requests/compute/delete_target_pool.rb +36 -0
  74. data/lib/fog/google/requests/compute/get_forwarding_rule.rb +33 -0
  75. data/lib/fog/google/requests/compute/get_http_health_check.rb +30 -0
  76. data/lib/fog/google/requests/compute/get_project.rb +25 -0
  77. data/lib/fog/google/requests/compute/get_region.rb +26 -0
  78. data/lib/fog/google/requests/compute/get_region_operation.rb +36 -0
  79. data/lib/fog/google/requests/compute/get_route.rb +26 -0
  80. data/lib/fog/google/requests/compute/get_target_pool.rb +33 -0
  81. data/lib/fog/google/requests/compute/get_target_pool_health.rb +35 -0
  82. data/lib/fog/google/requests/compute/insert_address.rb +4 -4
  83. data/lib/fog/google/requests/compute/insert_firewall.rb +20 -6
  84. data/lib/fog/google/requests/compute/insert_forwarding_rule.rb +31 -0
  85. data/lib/fog/google/requests/compute/insert_http_health_check.rb +32 -0
  86. data/lib/fog/google/requests/compute/insert_network.rb +6 -4
  87. data/lib/fog/google/requests/compute/insert_route.rb +38 -0
  88. data/lib/fog/google/requests/compute/insert_server.rb +15 -0
  89. data/lib/fog/google/requests/compute/insert_target_pool.rb +31 -0
  90. data/lib/fog/google/requests/compute/list_aggregated_addresses.rb +25 -0
  91. data/lib/fog/google/requests/compute/list_aggregated_machine_types.rb +25 -0
  92. data/lib/fog/google/requests/compute/list_forwarding_rules.rb +36 -0
  93. data/lib/fog/google/requests/compute/list_http_health_checks.rb +29 -0
  94. data/lib/fog/google/requests/compute/list_region_operations.rb +29 -0
  95. data/lib/fog/google/requests/compute/list_regions.rb +29 -0
  96. data/lib/fog/google/requests/compute/list_routes.rb +25 -0
  97. data/lib/fog/google/requests/compute/list_target_pools.rb +30 -0
  98. data/lib/fog/google/requests/compute/remove_target_pool_health_checks.rb +34 -0
  99. data/lib/fog/google/requests/compute/remove_target_pool_instance.rb +34 -0
  100. data/lib/fog/google/requests/compute/remove_target_pool_instances.rb +34 -0
  101. data/lib/fog/google/requests/compute/set_common_instance_metadata.rb +30 -0
  102. data/lib/fog/google/requests/compute/set_forwarding_rule_target.rb +32 -0
  103. data/lib/fog/google/requests/compute/set_tags.rb +4 -1
  104. data/lib/fog/hp/examples/compute.md +3 -3
  105. data/lib/fog/hp/examples/compute_v2.md +6 -3
  106. data/lib/fog/hp/examples/networking.md +1 -1
  107. data/lib/fog/hp/models/network/router.rb +1 -1
  108. data/lib/fog/joyent/analytics.rb +2 -2
  109. data/lib/fog/joyent/compute.rb +2 -2
  110. data/lib/fog/joyent/models/compute/server.rb +2 -0
  111. data/lib/fog/ninefold/compute.rb +6 -6
  112. data/lib/fog/openstack/compute.rb +3 -3
  113. data/lib/fog/openstack/core.rb +4 -4
  114. data/lib/fog/openstack/examples/network/network_subnets_routers.rb +2 -2
  115. data/lib/fog/openstack/identity.rb +1 -1
  116. data/lib/fog/openstack/image.rb +1 -1
  117. data/lib/fog/openstack/metering.rb +1 -1
  118. data/lib/fog/openstack/models/network/router.rb +21 -4
  119. data/lib/fog/openstack/network.rb +1 -1
  120. data/lib/fog/openstack/orchestration.rb +2 -2
  121. data/lib/fog/openstack/requests/network/create_router.rb +30 -9
  122. data/lib/fog/openstack/requests/network/delete_router.rb +1 -1
  123. data/lib/fog/openstack/requests/network/update_router.rb +28 -41
  124. data/lib/fog/openstack/requests/storage/get_object_https_url.rb +12 -2
  125. data/lib/fog/openstack/storage.rb +1 -1
  126. data/lib/fog/openstack/volume.rb +1 -1
  127. data/lib/fog/rackspace/auto_scale.rb +1 -1
  128. data/lib/fog/rackspace/block_storage.rb +2 -2
  129. data/lib/fog/rackspace/cdn.rb +1 -1
  130. data/lib/fog/rackspace/compute.rb +1 -1
  131. data/lib/fog/rackspace/compute_v2.rb +2 -2
  132. data/lib/fog/rackspace/core.rb +2 -1
  133. data/lib/fog/rackspace/databases.rb +2 -2
  134. data/lib/fog/rackspace/dns.rb +1 -1
  135. data/lib/fog/rackspace/identity.rb +1 -1
  136. data/lib/fog/rackspace/load_balancers.rb +2 -2
  137. data/lib/fog/rackspace/models/compute_v2/server.rb +18 -6
  138. data/lib/fog/rackspace/models/dns/records.rb +22 -0
  139. data/lib/fog/rackspace/models/monitoring/alarm.rb +3 -1
  140. data/lib/fog/rackspace/models/queues/message.rb +2 -2
  141. data/lib/fog/rackspace/models/storage/metadata.rb +0 -5
  142. data/lib/fog/rackspace/monitoring.rb +1 -1
  143. data/lib/fog/rackspace/queues.rb +1 -1
  144. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +5 -2
  145. data/lib/fog/rackspace/service.rb +1 -1
  146. data/lib/fog/rackspace/storage.rb +1 -1
  147. data/lib/fog/rage4/models/dns/record.rb +2 -0
  148. data/lib/fog/rage4/requests/dns/create_record.rb +2 -0
  149. data/lib/fog/rage4/requests/dns/update_record.rb +2 -0
  150. data/lib/fog/serverlove/compute.rb +2 -2
  151. data/lib/fog/vcloud_director/models/compute/tasks.rb +1 -0
  152. data/lib/fog/version.rb +1 -1
  153. data/lib/fog/vsphere/core.rb +23 -0
  154. data/lib/fog/vsphere/models/compute/interface.rb +3 -3
  155. data/lib/fog/vsphere/requests/compute/create_vm.rb +2 -2
  156. data/lib/fog/vsphere/requests/compute/list_interface_types.rb +1 -2
  157. data/lib/tasks/changelog_task.rb +191 -89
  158. data/lib/tasks/github_release_task.rb +67 -0
  159. data/spec/fog/xml/connection_spec.rb +34 -0
  160. data/tests/aws/requests/iam/mfa_tests.rb +23 -0
  161. data/tests/aws/signed_params_tests.rb +9 -5
  162. data/tests/google/helpers/disk_helper.rb +1 -1
  163. data/tests/google/requests/compute/disk_tests.rb +3 -21
  164. data/tests/helper.rb +1 -1
  165. data/tests/openstack/models/network/router_tests.rb +3 -2
  166. data/tests/openstack/requests/network/router_tests.rb +10 -12
  167. data/tests/openstack/requests/storage/object_tests.rb +23 -7
  168. data/tests/rackspace/models/compute_v2/server_tests.rb +1 -1
  169. data/tests/rackspace/models/monitoring/alarm_tests.rb +3 -0
  170. data/tests/rage4/requests/dns/dns_tests.rb +32 -0
  171. metadata +66 -172
  172. data/changelog.txt +0 -8265
  173. data/providers/brightbox/.gitignore +0 -1
  174. data/providers/brightbox/Gemfile +0 -3
  175. data/providers/brightbox/LICENSE.txt +0 -22
  176. data/providers/brightbox/README.md +0 -50
  177. data/providers/brightbox/Rakefile +0 -8
  178. data/providers/brightbox/fog-brightbox.gemspec +0 -28
  179. data/providers/brightbox/lib/fog/brightbox.rb +0 -1
  180. data/providers/brightbox/lib/fog/brightbox/compute.rb +0 -305
  181. data/providers/brightbox/lib/fog/brightbox/compute/image_selector.rb +0 -45
  182. data/providers/brightbox/lib/fog/brightbox/compute/shared.rb +0 -230
  183. data/providers/brightbox/lib/fog/brightbox/core.rb +0 -11
  184. data/providers/brightbox/lib/fog/brightbox/models/compute/account.rb +0 -69
  185. data/providers/brightbox/lib/fog/brightbox/models/compute/accounts.rb +0 -29
  186. data/providers/brightbox/lib/fog/brightbox/models/compute/api_client.rb +0 -37
  187. data/providers/brightbox/lib/fog/brightbox/models/compute/api_clients.rb +0 -24
  188. data/providers/brightbox/lib/fog/brightbox/models/compute/application.rb +0 -24
  189. data/providers/brightbox/lib/fog/brightbox/models/compute/applications.rb +0 -28
  190. data/providers/brightbox/lib/fog/brightbox/models/compute/cloud_ip.rb +0 -68
  191. data/providers/brightbox/lib/fog/brightbox/models/compute/cloud_ips.rb +0 -34
  192. data/providers/brightbox/lib/fog/brightbox/models/compute/collaboration.rb +0 -49
  193. data/providers/brightbox/lib/fog/brightbox/models/compute/collaborations.rb +0 -47
  194. data/providers/brightbox/lib/fog/brightbox/models/compute/database_server.rb +0 -97
  195. data/providers/brightbox/lib/fog/brightbox/models/compute/database_servers.rb +0 -28
  196. data/providers/brightbox/lib/fog/brightbox/models/compute/database_snapshot.rb +0 -52
  197. data/providers/brightbox/lib/fog/brightbox/models/compute/database_snapshots.rb +0 -24
  198. data/providers/brightbox/lib/fog/brightbox/models/compute/database_type.rb +0 -19
  199. data/providers/brightbox/lib/fog/brightbox/models/compute/database_types.rb +0 -26
  200. data/providers/brightbox/lib/fog/brightbox/models/compute/firewall_policies.rb +0 -29
  201. data/providers/brightbox/lib/fog/brightbox/models/compute/firewall_policy.rb +0 -63
  202. data/providers/brightbox/lib/fog/brightbox/models/compute/firewall_rule.rb +0 -54
  203. data/providers/brightbox/lib/fog/brightbox/models/compute/firewall_rules.rb +0 -24
  204. data/providers/brightbox/lib/fog/brightbox/models/compute/flavor.rb +0 -32
  205. data/providers/brightbox/lib/fog/brightbox/models/compute/flavors.rb +0 -28
  206. data/providers/brightbox/lib/fog/brightbox/models/compute/image.rb +0 -64
  207. data/providers/brightbox/lib/fog/brightbox/models/compute/images.rb +0 -28
  208. data/providers/brightbox/lib/fog/brightbox/models/compute/load_balancer.rb +0 -107
  209. data/providers/brightbox/lib/fog/brightbox/models/compute/load_balancers.rb +0 -28
  210. data/providers/brightbox/lib/fog/brightbox/models/compute/server.rb +0 -217
  211. data/providers/brightbox/lib/fog/brightbox/models/compute/server_group.rb +0 -94
  212. data/providers/brightbox/lib/fog/brightbox/models/compute/server_groups.rb +0 -29
  213. data/providers/brightbox/lib/fog/brightbox/models/compute/servers.rb +0 -61
  214. data/providers/brightbox/lib/fog/brightbox/models/compute/user.rb +0 -43
  215. data/providers/brightbox/lib/fog/brightbox/models/compute/user_collaboration.rb +0 -44
  216. data/providers/brightbox/lib/fog/brightbox/models/compute/user_collaborations.rb +0 -31
  217. data/providers/brightbox/lib/fog/brightbox/models/compute/users.rb +0 -27
  218. data/providers/brightbox/lib/fog/brightbox/models/compute/zone.rb +0 -22
  219. data/providers/brightbox/lib/fog/brightbox/models/compute/zones.rb +0 -29
  220. data/providers/brightbox/lib/fog/brightbox/oauth2.rb +0 -166
  221. data/providers/brightbox/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +0 -21
  222. data/providers/brightbox/lib/fog/brightbox/requests/compute/activate_console_server.rb +0 -21
  223. data/providers/brightbox/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +0 -24
  224. data/providers/brightbox/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +0 -24
  225. data/providers/brightbox/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +0 -34
  226. data/providers/brightbox/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +0 -24
  227. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_api_client.rb +0 -23
  228. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_application.rb +0 -23
  229. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +0 -24
  230. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_collaboration.rb +0 -23
  231. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_database_server.rb +0 -25
  232. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +0 -26
  233. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +0 -29
  234. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_image.rb +0 -30
  235. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_load_balancer.rb +0 -26
  236. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_server.rb +0 -29
  237. data/providers/brightbox/lib/fog/brightbox/requests/compute/create_server_group.rb +0 -23
  238. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_api_client.rb +0 -28
  239. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_application.rb +0 -28
  240. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_cloud_ip.rb +0 -28
  241. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_collaboration.rb +0 -28
  242. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_database_server.rb +0 -26
  243. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_database_snapshot.rb +0 -26
  244. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_firewall_policy.rb +0 -28
  245. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_firewall_rule.rb +0 -28
  246. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_image.rb +0 -28
  247. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_load_balancer.rb +0 -28
  248. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_server.rb +0 -28
  249. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_server_group.rb +0 -28
  250. data/providers/brightbox/lib/fog/brightbox/requests/compute/delete_user_collaboration.rb +0 -28
  251. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_account.rb +0 -29
  252. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_api_client.rb +0 -21
  253. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_application.rb +0 -21
  254. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +0 -17
  255. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +0 -21
  256. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_collaboration.rb +0 -21
  257. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_database_server.rb +0 -19
  258. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +0 -19
  259. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_database_type.rb +0 -21
  260. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +0 -21
  261. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +0 -21
  262. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_image.rb +0 -21
  263. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_interface.rb +0 -21
  264. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_load_balancer.rb +0 -21
  265. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_scoped_account.rb +0 -15
  266. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_server.rb +0 -21
  267. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_server_group.rb +0 -21
  268. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_server_type.rb +0 -21
  269. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_user.rb +0 -29
  270. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +0 -21
  271. data/providers/brightbox/lib/fog/brightbox/requests/compute/get_zone.rb +0 -21
  272. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_accounts.rb +0 -17
  273. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_api_clients.rb +0 -19
  274. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_applications.rb +0 -19
  275. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +0 -19
  276. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_collaborations.rb +0 -19
  277. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_database_servers.rb +0 -17
  278. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +0 -17
  279. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_database_types.rb +0 -19
  280. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +0 -19
  281. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_images.rb +0 -19
  282. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_load_balancers.rb +0 -19
  283. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_server_groups.rb +0 -19
  284. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_server_types.rb +0 -19
  285. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_servers.rb +0 -19
  286. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +0 -19
  287. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_users.rb +0 -19
  288. data/providers/brightbox/lib/fog/brightbox/requests/compute/list_zones.rb +0 -19
  289. data/providers/brightbox/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +0 -24
  290. data/providers/brightbox/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +0 -36
  291. data/providers/brightbox/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +0 -21
  292. data/providers/brightbox/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +0 -24
  293. data/providers/brightbox/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +0 -24
  294. data/providers/brightbox/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +0 -24
  295. data/providers/brightbox/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +0 -34
  296. data/providers/brightbox/lib/fog/brightbox/requests/compute/resend_collaboration.rb +0 -21
  297. data/providers/brightbox/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +0 -32
  298. data/providers/brightbox/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +0 -18
  299. data/providers/brightbox/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +0 -19
  300. data/providers/brightbox/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +0 -25
  301. data/providers/brightbox/lib/fog/brightbox/requests/compute/reset_secret_application.rb +0 -21
  302. data/providers/brightbox/lib/fog/brightbox/requests/compute/shutdown_server.rb +0 -21
  303. data/providers/brightbox/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +0 -19
  304. data/providers/brightbox/lib/fog/brightbox/requests/compute/snapshot_server.rb +0 -21
  305. data/providers/brightbox/lib/fog/brightbox/requests/compute/start_server.rb +0 -21
  306. data/providers/brightbox/lib/fog/brightbox/requests/compute/stop_server.rb +0 -21
  307. data/providers/brightbox/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +0 -21
  308. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_account.rb +0 -61
  309. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_api_client.rb +0 -26
  310. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_application.rb +0 -26
  311. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +0 -27
  312. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_database_server.rb +0 -25
  313. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +0 -26
  314. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +0 -26
  315. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +0 -31
  316. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_image.rb +0 -31
  317. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_load_balancer.rb +0 -29
  318. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_scoped_account.rb +0 -31
  319. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_server.rb +0 -28
  320. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_server_group.rb +0 -26
  321. data/providers/brightbox/lib/fog/brightbox/requests/compute/update_user.rb +0 -29
  322. data/providers/brightbox/lib/fog/brightbox/version.rb +0 -5
  323. data/providers/brightbox/test/fog/compute/brightbox_test.rb +0 -37
  324. data/test/fog/xml/connection_test.rb +0 -30
@@ -1,230 +0,0 @@
1
- require "fog/brightbox/oauth2"
2
-
3
- module Fog
4
- module Brightbox
5
- module Compute
6
-
7
- # The Shared module consists of code that was duplicated between the Real
8
- # and Mock implementations.
9
- #
10
- module Shared
11
- include Fog::Brightbox::OAuth2
12
-
13
- API_URL = "https://api.gb1.brightbox.com/"
14
-
15
- # Creates a new instance of the Brightbox Compute service
16
- #
17
- # @note If you create service using just a refresh token when it
18
- # expires the service will no longer be able to authenticate.
19
- #
20
- # @param [Hash] options
21
- # @option options [String] :brightbox_api_url
22
- # Override the default (or configured) API endpoint
23
- # @option options [String] :brightbox_auth_url
24
- # Override the default (or configured) API authentication endpoint
25
- # @option options [String] :brightbox_client_id
26
- # Client identifier to authenticate with (overrides configured)
27
- # @option options [String] :brightbox_secret
28
- # Client secret to authenticate with (overrides configured)
29
- # @option options [String] :brightbox_username
30
- # Email or user identifier for user based authentication
31
- # @option options [String] :brightbox_password
32
- # Password for user based authentication
33
- # @option options [String] :brightbox_account
34
- # Account identifier to scope this connection to
35
- # @option options [String] :connection_options
36
- # Settings to pass to underlying {Fog::Core::Connection}
37
- # @option options [Boolean] :persistent
38
- # Sets a persistent HTTP {Fog::Core::Connection}
39
- # @option options [String] :brightbox_access_token
40
- # Sets the OAuth access token to use rather than requesting a new token
41
- # @option options [String] :brightbox_refresh_token
42
- # Sets the refresh token to use when requesting a newer access token
43
- # @option options [String] (true) :brightbox_token_management
44
- # Overide the existing behaviour to request access tokens if expired
45
- #
46
- def initialize(options)
47
- # Currently authentication and api endpoints are the same but may change
48
- @auth_url = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
49
- @auth_connection = Fog::Core::Connection.new(@auth_url)
50
-
51
- @api_url = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
52
- @connection_options = options[:connection_options] || {}
53
- @persistent = options[:persistent] || false
54
- @connection = Fog::Core::Connection.new(@api_url, @persistent, @connection_options)
55
-
56
- # Authentication options
57
- client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
58
- client_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
59
-
60
- username = options[:brightbox_username] || Fog.credentials[:brightbox_username]
61
- password = options[:brightbox_password] || Fog.credentials[:brightbox_password]
62
- @configured_account = options[:brightbox_account] || Fog.credentials[:brightbox_account]
63
- # Request account can be changed at anytime and changes behaviour of future requests
64
- @scoped_account = @configured_account
65
-
66
- credential_options = { :username => username, :password => password }
67
- @credentials = CredentialSet.new(client_id, client_secret, credential_options)
68
-
69
- # If existing tokens have been cached, allow continued use of them in the service
70
- @credentials.update_tokens(options[:brightbox_access_token], options[:brightbox_refresh_token])
71
-
72
- @token_management = options.fetch(:brightbox_token_management, true)
73
- end
74
-
75
- # Sets the scoped account for future requests
76
- # @param [String] scoped_account Identifier of the account to scope request to
77
- def scoped_account=(scoped_account)
78
- @scoped_account = scoped_account
79
- end
80
-
81
- # This returns the account identifier that the request should be scoped by
82
- # based on the options passed to the request and current configuration
83
- #
84
- # @param [String] options_account Any identifier passed into the request
85
- #
86
- # @return [String, nil] The account identifier to scope the request to or nil
87
- def scoped_account(options_account = nil)
88
- [options_account, @scoped_account].compact.first
89
- end
90
-
91
- # Resets the scoped account back to intially configured one
92
- def scoped_account_reset
93
- @scoped_account = @configured_account
94
- end
95
-
96
- # Returns the scoped account being used for requests
97
- #
98
- # * For API clients this is the owning account
99
- # * For User applications this is the account specified by either +account_id+
100
- # option on the service or the +brightbox_account+ setting in your configuration
101
- #
102
- # @return [Fog::Compute::Brightbox::Account]
103
- #
104
- def account
105
- account_data = get_scoped_account.merge(:service => self)
106
- Fog::Compute::Brightbox::Account.new(account_data)
107
- end
108
-
109
- # Returns true if authentication is being performed as a user
110
- # @return [Boolean]
111
- def authenticating_as_user?
112
- @credentials.user_details?
113
- end
114
-
115
- # Returns true if an access token is set
116
- # @return [Boolean]
117
- def access_token_available?
118
- !! @credentials.access_token
119
- end
120
-
121
- # Returns the current access token or nil
122
- # @return [String,nil]
123
- def access_token
124
- @credentials.access_token
125
- end
126
-
127
- # Returns the current refresh token or nil
128
- # @return [String,nil]
129
- def refresh_token
130
- @credentials.refresh_token
131
- end
132
-
133
- # Returns the current token expiry time in seconds or nil
134
- # @return [Number,nil]
135
- def expires_in
136
- @credentials.expires_in
137
- end
138
-
139
- # Requests a new access token
140
- #
141
- # @return [String] New access token
142
- def get_access_token
143
- begin
144
- get_access_token!
145
- rescue Excon::Errors::Unauthorized, Excon::Errors::BadRequest
146
- @credentials.update_tokens(nil, nil)
147
- end
148
- @credentials.access_token
149
- end
150
-
151
- # Requests a new access token and raises if there is a problem
152
- #
153
- # @return [String] New access token
154
- # @raise [Excon::Errors::BadRequest] The credentials are expired or incorrect
155
- #
156
- def get_access_token!
157
- response = request_access_token(@auth_connection, @credentials)
158
- update_credentials_from_response(@credentials, response)
159
- @credentials.access_token
160
- end
161
-
162
- # Returns an identifier for the default image for use
163
- #
164
- # Currently tries to find the latest version of Ubuntu (i686) from
165
- # Brightbox.
166
- #
167
- # Highly recommended that you actually select the image you want to run
168
- # on your servers yourself!
169
- #
170
- # @return [String] if image is found, returns the identifier
171
- # @return [NilClass] if no image is found or an error occurs
172
- #
173
- def default_image
174
- return @default_image_id unless @default_image_id.nil?
175
- @default_image_id = Fog.credentials[:brightbox_default_image] || select_default_image
176
- end
177
-
178
- private
179
-
180
- # This makes a request of the API based on the configured setting for
181
- # token management.
182
- #
183
- # @param [Hash] options Excon compatible options
184
- # @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
185
- #
186
- # @return [Hash] Data of response body
187
- #
188
- def make_request(options)
189
- if @token_management
190
- managed_token_request(options)
191
- else
192
- authenticated_request(options)
193
- end
194
- end
195
-
196
- # This request checks for access tokens and will ask for a new one if
197
- # it receives Unauthorized from the API before repeating the request
198
- #
199
- # @param [Hash] options Excon compatible options
200
- #
201
- # @return [Excon::Response]
202
- def managed_token_request(options)
203
- get_access_token unless access_token_available?
204
- authenticated_request(options)
205
- rescue Excon::Errors::Unauthorized
206
- get_access_token
207
- authenticated_request(options)
208
- end
209
-
210
- # This request makes an authenticated request of the API using currently
211
- # setup credentials.
212
- #
213
- # @param [Hash] options Excon compatible options
214
- #
215
- # @see https://github.com/geemus/excon/blob/master/lib/excon/connection.rb
216
- #
217
- # @return [Excon::Response]
218
- def authenticated_request(options)
219
- headers = options[:headers] || {}
220
- headers.merge!("Authorization" => "OAuth #{@credentials.access_token}", "Content-Type" => "application/json")
221
- options[:headers] = headers
222
- # TODO: This is just a wrapper around a call to Excon::Connection#request
223
- # so can be extracted from Compute by passing in the connection,
224
- # credentials and options
225
- @connection.request(options)
226
- end
227
- end
228
- end
229
- end
230
- end
@@ -1,11 +0,0 @@
1
- require 'fog/core'
2
- require 'fog/json'
3
-
4
- module Fog
5
- module Brightbox
6
- extend Fog::Provider
7
-
8
- service(:compute, 'Compute')
9
-
10
- end
11
- end
@@ -1,69 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Compute
5
- class Brightbox
6
-
7
- class Account < Fog::Model
8
-
9
- identity :id
10
- attribute :url
11
- attribute :resource_type
12
-
13
- attribute :name
14
- attribute :status
15
-
16
- attribute :address_1
17
- attribute :address_2
18
- attribute :city
19
- attribute :county
20
- attribute :postcode
21
- attribute :country_code
22
- attribute :country_name
23
- attribute :vat_registration_number
24
- attribute :telephone_number
25
- attribute :verified_telephone
26
- attribute :verified_ip
27
- attribute :ram_limit
28
- attribute :ram_used
29
- attribute :cloud_ips_limit
30
- attribute :cloud_ips_used
31
- attribute :load_balancers_limit
32
- attribute :load_balancers_used
33
- attribute :library_ftp_host
34
- attribute :library_ftp_user
35
- # This is always returned as nil unless after a call to reset_ftp_password
36
- attribute :library_ftp_password
37
-
38
- # Boolean flags
39
- attribute :valid_credit_card
40
- attribute :telephone_verified
41
-
42
- # Times
43
- attribute :created_at, :type => :time
44
- attribute :verified_at, :type => :time
45
-
46
- # Links - to be replaced
47
- attribute :owner_id, :aliases => "owner", :squash => "id"
48
- attribute :clients
49
- attribute :images
50
- attribute :servers
51
- attribute :users
52
- attribute :zones
53
-
54
- # Resets the account's image library FTP password returning the new value
55
- #
56
- # @return [String] Newly issue FTP password
57
- #
58
- def reset_ftp_password
59
- requires :identity
60
- data = service.reset_ftp_password_account(identity)
61
- merge_attributes(data)
62
- library_ftp_password
63
- end
64
-
65
- end
66
-
67
- end
68
- end
69
- end
@@ -1,29 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/brightbox/models/compute/account'
3
-
4
- module Fog
5
- module Compute
6
- class Brightbox
7
-
8
- class Accounts < Fog::Collection
9
-
10
- model Fog::Compute::Brightbox::Account
11
-
12
- def all
13
- data = service.list_accounts
14
- load(data)
15
- end
16
-
17
- def get(identifier)
18
- return nil if identifier.nil? || identifier == ""
19
- data = service.get_account(identifier)
20
- new(data)
21
- rescue Excon::Errors::NotFound
22
- nil
23
- end
24
-
25
- end
26
-
27
- end
28
- end
29
- end
@@ -1,37 +0,0 @@
1
- module Fog
2
- module Compute
3
- class Brightbox
4
- class ApiClient < Fog::Model
5
- identity :id
6
- attribute :name
7
- attribute :description
8
- attribute :secret
9
- attribute :revoked_at, :type => :time
10
- attribute :account_id
11
-
12
- def save
13
- raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
14
- options = {
15
- :name => name,
16
- :description => description
17
- }.delete_if { |k, v| v.nil? || v == "" }
18
- data = service.create_api_client(options)
19
- merge_attributes(data)
20
- true
21
- end
22
-
23
- def destroy
24
- requires :identity
25
- service.destroy_api_client(identity)
26
- true
27
- end
28
-
29
- def reset_secret
30
- requires :identity
31
- service.reset_secret_api_client(identity)
32
- true
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,24 +0,0 @@
1
- require "fog/core/collection"
2
- require "fog/brightbox/models/compute/api_client"
3
-
4
- module Fog
5
- module Compute
6
- class Brightbox
7
- class ApiClients < Fog::Collection
8
- model Fog::Compute::Brightbox::ApiClient
9
-
10
- def all
11
- data = service.list_api_clients
12
- load(data)
13
- end
14
-
15
- def get(identifier = nil)
16
- data = service.get_api_client(identifier)
17
- new(data)
18
- rescue Excon::Errors::NotFound
19
- nil
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- require 'fog/core/model'
2
-
3
- module Fog
4
- module Compute
5
- class Brightbox
6
- class Application < Fog::Model
7
- identity :id
8
- attribute :url
9
- attribute :name
10
- attribute :secret
11
-
12
- def save
13
- raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
14
- options = {
15
- :name => name
16
- }.delete_if { |k, v| v.nil? || v == "" }
17
- data = service.create_application(options)
18
- merge_attributes(data)
19
- true
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,28 +0,0 @@
1
- require 'fog/core/collection'
2
- require 'fog/brightbox/models/compute/application'
3
-
4
- module Fog
5
- module Compute
6
- class Brightbox
7
-
8
- class Applications < Fog::Collection
9
-
10
- model Fog::Compute::Brightbox::Application
11
-
12
- def all
13
- data = service.list_applications
14
- load(data)
15
- end
16
-
17
- def get(identifier)
18
- data = service.get_application(identifier)
19
- new(data)
20
- rescue Excon::Errors::NotFound
21
- nil
22
- end
23
-
24
- end
25
-
26
- end
27
- end
28
- end