fog 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. data/.gitignore +2 -2
  2. data/README.md +9 -10
  3. data/Rakefile +15 -299
  4. data/changelog.txt +153 -0
  5. data/docs/about/contributing.markdown +1 -0
  6. data/docs/dns/index.markdown +1 -1
  7. data/docs/index.markdown +8 -3
  8. data/fog.gemspec +3 -3
  9. data/lib/fog.rb +0 -5
  10. data/lib/fog/aws/auto_scaling.rb +1 -1
  11. data/lib/fog/aws/cloud_watch.rb +1 -1
  12. data/lib/fog/aws/compute.rb +2 -1
  13. data/lib/fog/aws/dynamodb.rb +30 -64
  14. data/lib/fog/aws/elb.rb +1 -1
  15. data/lib/fog/aws/glacier.rb +1 -1
  16. data/lib/fog/aws/iam.rb +1 -0
  17. data/lib/fog/aws/models/auto_scaling/group.rb +1 -1
  18. data/lib/fog/aws/models/compute/server.rb +2 -0
  19. data/lib/fog/aws/models/compute/volume.rb +0 -1
  20. data/lib/fog/aws/models/iam/user.rb +1 -1
  21. data/lib/fog/aws/parsers/compute/describe_instances.rb +3 -1
  22. data/lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb +1 -1
  23. data/lib/fog/aws/parsers/storage/delete_multiple_objects.rb +50 -0
  24. data/lib/fog/aws/rds.rb +2 -2
  25. data/lib/fog/aws/requests/compute/describe_availability_zones.rb +3 -0
  26. data/lib/fog/aws/requests/compute/describe_reserved_instances_offerings.rb +11 -8
  27. data/lib/fog/aws/requests/compute/modify_volume_attribute.rb +51 -0
  28. data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +1 -0
  29. data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +172 -0
  30. data/lib/fog/aws/signaturev4.rb +1 -1
  31. data/lib/fog/aws/sqs.rb +1 -1
  32. data/lib/fog/aws/storage.rb +2 -0
  33. data/lib/fog/bluebox/requests/compute/create_block.rb +1 -3
  34. data/lib/fog/brightbox/compute.rb +239 -84
  35. data/lib/fog/brightbox/models/compute/account.rb +9 -3
  36. data/lib/fog/brightbox/models/compute/server.rb +2 -1
  37. data/lib/fog/brightbox/models/compute/servers.rb +33 -1
  38. data/lib/fog/brightbox/oauth2.rb +164 -0
  39. data/lib/fog/brightbox/requests/compute/activate_console_server.rb +9 -2
  40. data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +11 -2
  41. data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +11 -2
  42. data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +9 -11
  43. data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +11 -2
  44. data/lib/fog/brightbox/requests/compute/create_api_client.rb +11 -2
  45. data/lib/fog/brightbox/requests/compute/create_application.rb +11 -2
  46. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +11 -1
  47. data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +13 -2
  48. data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +17 -2
  49. data/lib/fog/brightbox/requests/compute/create_image.rb +18 -2
  50. data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +14 -2
  51. data/lib/fog/brightbox/requests/compute/create_server.rb +17 -2
  52. data/lib/fog/brightbox/requests/compute/create_server_group.rb +11 -2
  53. data/lib/fog/brightbox/requests/compute/destroy_api_client.rb +9 -2
  54. data/lib/fog/brightbox/requests/compute/destroy_application.rb +9 -2
  55. data/lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb +9 -2
  56. data/lib/fog/brightbox/requests/compute/destroy_firewall_policy.rb +9 -2
  57. data/lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb +9 -2
  58. data/lib/fog/brightbox/requests/compute/destroy_image.rb +9 -2
  59. data/lib/fog/brightbox/requests/compute/destroy_load_balancer.rb +9 -2
  60. data/lib/fog/brightbox/requests/compute/destroy_server.rb +9 -2
  61. data/lib/fog/brightbox/requests/compute/destroy_server_group.rb +9 -2
  62. data/lib/fog/brightbox/requests/compute/get_account.rb +7 -15
  63. data/lib/fog/brightbox/requests/compute/get_api_client.rb +9 -2
  64. data/lib/fog/brightbox/requests/compute/get_application.rb +9 -2
  65. data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +1 -3
  66. data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +9 -2
  67. data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +9 -2
  68. data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +9 -2
  69. data/lib/fog/brightbox/requests/compute/get_image.rb +9 -2
  70. data/lib/fog/brightbox/requests/compute/get_interface.rb +9 -2
  71. data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +9 -2
  72. data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +1 -5
  73. data/lib/fog/brightbox/requests/compute/get_server.rb +9 -2
  74. data/lib/fog/brightbox/requests/compute/get_server_group.rb +9 -2
  75. data/lib/fog/brightbox/requests/compute/get_server_type.rb +9 -2
  76. data/lib/fog/brightbox/requests/compute/get_user.rb +7 -15
  77. data/lib/fog/brightbox/requests/compute/get_zone.rb +9 -2
  78. data/lib/fog/brightbox/requests/compute/list_accounts.rb +6 -2
  79. data/lib/fog/brightbox/requests/compute/list_api_clients.rb +8 -2
  80. data/lib/fog/brightbox/requests/compute/list_applications.rb +8 -2
  81. data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +8 -2
  82. data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +8 -2
  83. data/lib/fog/brightbox/requests/compute/list_images.rb +8 -2
  84. data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +8 -2
  85. data/lib/fog/brightbox/requests/compute/list_server_groups.rb +8 -2
  86. data/lib/fog/brightbox/requests/compute/list_server_types.rb +8 -2
  87. data/lib/fog/brightbox/requests/compute/list_servers.rb +8 -2
  88. data/lib/fog/brightbox/requests/compute/list_users.rb +8 -2
  89. data/lib/fog/brightbox/requests/compute/list_zones.rb +8 -2
  90. data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +11 -2
  91. data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +10 -12
  92. data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +11 -2
  93. data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +11 -2
  94. data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +11 -2
  95. data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +9 -10
  96. data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +22 -3
  97. data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +18 -0
  98. data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +13 -1
  99. data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +9 -2
  100. data/lib/fog/brightbox/requests/compute/shutdown_server.rb +9 -2
  101. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +9 -2
  102. data/lib/fog/brightbox/requests/compute/start_server.rb +9 -2
  103. data/lib/fog/brightbox/requests/compute/stop_server.rb +9 -2
  104. data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +9 -2
  105. data/lib/fog/brightbox/requests/compute/update_account.rb +32 -34
  106. data/lib/fog/brightbox/requests/compute/update_api_client.rb +12 -2
  107. data/lib/fog/brightbox/requests/compute/update_application.rb +12 -2
  108. data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +13 -2
  109. data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +16 -1
  110. data/lib/fog/brightbox/requests/compute/update_image.rb +17 -2
  111. data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +15 -2
  112. data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +12 -19
  113. data/lib/fog/brightbox/requests/compute/update_server.rb +12 -2
  114. data/lib/fog/brightbox/requests/compute/update_server_group.rb +12 -2
  115. data/lib/fog/brightbox/requests/compute/update_user.rb +15 -2
  116. data/lib/fog/cloudstack/models/compute/server.rb +3 -1
  117. data/lib/fog/core.rb +1 -0
  118. data/lib/fog/core/connection.rb +1 -0
  119. data/lib/fog/google/storage.rb +13 -2
  120. data/lib/fog/libvirt/models/compute/server.rb +1 -0
  121. data/lib/fog/libvirt/requests/compute/list_domains.rb +2 -2
  122. data/lib/fog/openstack.rb +57 -58
  123. data/lib/fog/openstack/compute.rb +15 -14
  124. data/lib/fog/openstack/identity.rb +10 -2
  125. data/lib/fog/openstack/image.rb +1 -1
  126. data/lib/fog/openstack/models/compute/flavor.rb +5 -1
  127. data/lib/fog/openstack/models/compute/security_group.rb +1 -1
  128. data/lib/fog/openstack/models/compute/server.rb +5 -0
  129. data/lib/fog/openstack/models/identity/users.rb +1 -2
  130. data/lib/fog/openstack/requests/compute/create_flavor.rb +4 -1
  131. data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
  132. data/lib/fog/openstack/requests/compute/get_limits.rb +93 -0
  133. data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -0
  134. data/lib/fog/openstack/requests/compute/release_address.rb +13 -1
  135. data/lib/fog/openstack/requests/compute/reset_server_state.rb +24 -0
  136. data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
  137. data/lib/fog/openstack/requests/identity/set_tenant.rb +21 -0
  138. data/lib/fog/openstack/volume.rb +2 -1
  139. data/lib/fog/rackspace/models/compute_v2/server.rb +27 -0
  140. data/lib/fog/rackspace/models/compute_v2/servers.rb +8 -0
  141. data/lib/fog/rackspace/models/dns/record.rb +14 -1
  142. data/lib/fog/rackspace/models/storage/file.rb +68 -2
  143. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +3 -0
  144. data/lib/fog/version.rb +5 -0
  145. data/lib/fog/vsphere/compute.rb +74 -8
  146. data/lib/fog/vsphere/models/compute/cluster.rb +31 -0
  147. data/lib/fog/vsphere/models/compute/clusters.rb +26 -0
  148. data/lib/fog/vsphere/models/compute/datacenter.rb +35 -0
  149. data/lib/fog/vsphere/models/compute/datacenters.rb +23 -0
  150. data/lib/fog/vsphere/models/compute/datastore.rb +24 -0
  151. data/lib/fog/vsphere/models/compute/datastores.rb +25 -0
  152. data/lib/fog/vsphere/models/compute/folder.rb +28 -0
  153. data/lib/fog/vsphere/models/compute/folders.rb +27 -0
  154. data/lib/fog/vsphere/models/compute/interface.rb +39 -0
  155. data/lib/fog/vsphere/models/compute/interfaces.rb +33 -0
  156. data/lib/fog/vsphere/models/compute/network.rb +21 -0
  157. data/lib/fog/vsphere/models/compute/networks.rb +25 -0
  158. data/lib/fog/vsphere/models/compute/resource_pool.rb +23 -0
  159. data/lib/fog/vsphere/models/compute/resource_pools.rb +26 -0
  160. data/lib/fog/vsphere/models/compute/server.rb +78 -12
  161. data/lib/fog/vsphere/models/compute/servers.rb +16 -20
  162. data/lib/fog/vsphere/models/compute/template.rb +13 -0
  163. data/lib/fog/vsphere/models/compute/templates.rb +23 -0
  164. data/lib/fog/vsphere/models/compute/volume.rb +45 -0
  165. data/lib/fog/vsphere/models/compute/volumes.rb +33 -0
  166. data/lib/fog/vsphere/requests/compute/create_vm.rb +114 -0
  167. data/lib/fog/vsphere/requests/compute/get_cluster.rb +25 -0
  168. data/lib/fog/vsphere/requests/compute/get_datacenter.rb +29 -0
  169. data/lib/fog/vsphere/requests/compute/get_datastore.rb +25 -0
  170. data/lib/fog/vsphere/requests/compute/get_folder.rb +73 -0
  171. data/lib/fog/vsphere/requests/compute/get_network.rb +25 -0
  172. data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +26 -0
  173. data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +62 -0
  174. data/lib/fog/vsphere/requests/compute/list_clusters.rb +37 -0
  175. data/lib/fog/vsphere/requests/compute/list_datacenters.rb +34 -0
  176. data/lib/fog/vsphere/requests/compute/list_datastores.rb +40 -0
  177. data/lib/fog/vsphere/requests/compute/list_folders.rb +45 -0
  178. data/lib/fog/vsphere/requests/compute/list_networks.rb +38 -0
  179. data/lib/fog/vsphere/requests/compute/list_resource_pools.rb +39 -0
  180. data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +132 -166
  181. data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +52 -0
  182. data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +51 -0
  183. data/lib/fog/vsphere/requests/compute/vm_clone.rb +6 -8
  184. data/lib/fog/vsphere/requests/compute/vm_destroy.rb +1 -8
  185. data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +1 -2
  186. data/lib/tasks/changelog_task.rb +98 -0
  187. data/lib/tasks/documentation_task.rb +155 -0
  188. data/lib/tasks/test_task.rb +46 -0
  189. data/tests/aws/models/iam/users_tests.rb +16 -2
  190. data/tests/aws/requests/auto_scaling/notification_configuration_tests.rb +1 -0
  191. data/tests/aws/requests/auto_scaling/tag_tests.rb +1 -0
  192. data/tests/aws/requests/compute/instance_tests.rb +2 -0
  193. data/tests/aws/requests/compute/volume_tests.rb +8 -0
  194. data/tests/aws/requests/storage/object_tests.rb +18 -1
  195. data/tests/aws/requests/storage/versioning_tests.rb +70 -0
  196. data/tests/brightbox/compute_tests.rb +96 -4
  197. data/tests/brightbox/models/compute/account_tests.rb +15 -0
  198. data/tests/brightbox/oauth2_tests.rb +103 -0
  199. data/tests/brightbox/requests/compute/account_tests.rb +9 -2
  200. data/tests/brightbox/requests/compute/interface_tests.rb +18 -4
  201. data/tests/dns/models/record_tests.rb +17 -3
  202. data/tests/openstack/requests/compute/address_tests.rb +22 -19
  203. data/tests/openstack/requests/compute/flavor_tests.rb +4 -2
  204. data/tests/openstack/requests/compute/limit_tests.rb +60 -0
  205. data/tests/openstack/requests/compute/quota_tests.rb +16 -3
  206. data/tests/openstack/requests/compute/security_group_tests.rb +1 -1
  207. data/tests/rackspace/models/compute_v2/servers_tests.rb +6 -0
  208. data/tests/rackspace/models/storage/file_tests.rb +172 -0
  209. data/tests/rackspace/requests/dns/helper.rb +12 -26
  210. data/tests/vsphere/compute_tests.rb +3 -3
  211. data/tests/vsphere/models/compute/server_tests.rb +1 -2
  212. data/tests/vsphere/requests/compute/list_virtual_machines_tests.rb +5 -13
  213. data/tests/vsphere/requests/compute/vm_clone_tests.rb +2 -2
  214. metadata +59 -11
  215. data/lib/fog/vsphere/requests/compute/datacenters.rb +0 -34
  216. data/lib/fog/vsphere/requests/compute/find_vm_by_ref.rb +0 -41
  217. data/lib/fog/vsphere/requests/compute/vm_create.rb +0 -97
  218. data/tests/vsphere/requests/compute/find_vm_by_ref_tests.rb +0 -26
  219. data/tests/vsphere/requests/compute/vm_create_tests.rb +0 -20
@@ -2,40 +2,38 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
6
- # Requests an update to the currently scoped account
7
- #
8
- # === Parameters:
9
- #
10
- # <tt>identifier <String></tt>:: The identifier to request (Default is +nil+)
11
- # <tt>options <Hash></tt>:: Hash of options for update
12
- #
13
- # === Options:
14
- #
15
- # <tt>name</tt>:: Account name
16
- # <tt>address_1</tt>:: First line of address
17
- # <tt>address_2</tt>:: Second line of address
18
- # <tt>city</tt>:: City part of address
19
- # <tt>county</tt>:: County part of address
20
- # <tt>postcode</tt>:: Postal code
21
- # <tt>country_code</tt>:: ISO 3166-1 two letter code (example: +GB+)
22
- # <tt>vat_registration_number</tt>:: Valid EU VAT Number or +nil+
23
- # <tt>telephone_number</tt>:: Valid International telephone number in E.164 format prefixed with ’+’
24
- #
25
- # === Returns:
26
- #
27
- # <tt>Hash</tt>:: The JSON response parsed to a Hash
28
- # <tt>nil</tt>:: If no options were passed to update
29
- #
30
- # === Notes:
31
- #
32
- # This also supports a deprecated form where if an identifier is not
33
- # passed then the scoping account is updated instead. This should not
34
- # be used in new code. Use #update_scoped_account instead.
35
- #
36
- # === Reference:
37
- #
38
- # https://api.gb1.brightbox.com/1.0/#account_update_account
5
+ # Update some details of the account.
6
+ #
7
+ # @overload update_account(identifier, options)
8
+ # @param [String] identifier Unique reference to identify the resource
9
+ # @param [Hash] options
10
+ # @option options [String] :name Account name
11
+ # @option options [String] :address_1 First line of address
12
+ # @option options [String] :address_2 Second line of address
13
+ # @option options [String] :city City part of address
14
+ # @option options [String] :county County part of address
15
+ # @option options [String] :postcode Postcode or Zipcode
16
+ # @option options [String] :country_code ISO 3166-1 two letter code (example: `GB`)
17
+ # @option options [String] :vat_registration_number Must be a valid EU VAT number or `nil`
18
+ # @option options [String] :telephone_number Valid International telephone number in E.164 format prefixed with `+`
19
+ #
20
+ # @overload update_account(options)
21
+ # @deprecated Use {Fog::Compute::Brightbox::Real#update_scoped_account} instead
22
+ #
23
+ # @param [Hash] options
24
+ # @option options [String] :name Account name
25
+ # @option options [String] :address_1 First line of address
26
+ # @option options [String] :address_2 Second line of address
27
+ # @option options [String] :city City part of address
28
+ # @option options [String] :county County part of address
29
+ # @option options [String] :postcode Postcode or Zipcode
30
+ # @option options [String] :country_code ISO 3166-1 two letter code (example: `GB`)
31
+ # @option options [String] :vat_registration_number Must be a valid EU VAT number or `nil`
32
+ # @option options [String] :telephone_number Valid International telephone number in E.164 format prefixed with `+`
33
+ #
34
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
35
+ #
36
+ # @see https://api.gb1.brightbox.com/1.0/#account_update_account
39
37
  #
40
38
  def update_account(*args)
41
39
  if args.size == 2
@@ -2,7 +2,17 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the API client.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name
10
+ # @option options [String] :description
11
+ #
12
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
13
+ #
14
+ # @see https://api.gb1.brightbox.com/1.0/#api_client_update_api_client
15
+ #
6
16
  def update_api_client(identifier, options)
7
17
  return nil if identifier.nil? || identifier == ""
8
18
  return nil if options.empty? || options.nil?
@@ -12,4 +22,4 @@ module Fog
12
22
  end
13
23
  end
14
24
  end
15
- end
25
+ end
@@ -2,7 +2,17 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the application.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name
10
+ # @option options [String] :description
11
+ #
12
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
13
+ #
14
+ # @see https://api.gb1.brightbox.com/1.0/#application_update_application
15
+ #
6
16
  def update_application(identifier, options)
7
17
  return nil if identifier.nil? || identifier == ""
8
18
  return nil if options.empty? || options.nil?
@@ -12,4 +22,4 @@ module Fog
12
22
  end
13
23
  end
14
24
  end
15
- end
25
+ end
@@ -2,7 +2,18 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the cloud IP address.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :reverse_dns Reverse DNS hostname
10
+ # @option options [String] :name Name for Cloud IP
11
+ # @option options [Array] :port_translators Port on which external clients connect and port on which your service is listening.
12
+ #
13
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
14
+ #
15
+ # @see https://api.gb1.brightbox.com/1.0/#cloud_ip_update_cloud_ip
16
+ #
6
17
  def update_cloud_ip(identifier, options)
7
18
  return nil if identifier.nil? || identifier == ""
8
19
  return nil if options.empty? || options.nil?
@@ -12,4 +23,4 @@ module Fog
12
23
  end
13
24
  end
14
25
  end
15
- end
26
+ end
@@ -2,7 +2,22 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some settings of the firewall rule.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :protocol
10
+ # @option options [String] :source Required unless destination is set.
11
+ # @option options [String] :source_port
12
+ # @option options [String] :destination Required unless source is set
13
+ # @option options [String] :destination_port
14
+ # @option options [String] :icmp_type_name
15
+ # @option options [String] :description
16
+ #
17
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
18
+ #
19
+ # @see https://api.gb1.brightbox.com/1.0/#firewall_rule_update_firewall_rule
20
+ #
6
21
  def update_firewall_rule(identifier, options)
7
22
  return nil if identifier.nil? || identifier == ""
8
23
  return nil if options.empty? || options.nil?
@@ -2,7 +2,22 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the image.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name
10
+ # @option options [String] :username
11
+ # @option options [String] :arch
12
+ # @option options [String] :status
13
+ # @option options [Boolean] :public
14
+ # @option options [Boolean] :compatibility_mode
15
+ # @option options [String] :description
16
+ #
17
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
18
+ #
19
+ # @see https://api.gb1.brightbox.com/1.0/#image_update_image
20
+ #
6
21
  def update_image(identifier, options)
7
22
  return nil if identifier.nil? || identifier == ""
8
23
  return nil if options.empty? || options.nil?
@@ -12,4 +27,4 @@ module Fog
12
27
  end
13
28
  end
14
29
  end
15
- end
30
+ end
@@ -2,7 +2,20 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the load balancer.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name Editable label
10
+ # @option options [Array] :nodes Array of Node parameters
11
+ # @option options [String] :policy Method of Load balancing to use
12
+ # @option options [Array] :listeners What port to listen on, port to pass through to and protocol (tcp, http or http+ws) of listener. Timeout is optional and specified in milliseconds (default is 50000).
13
+ # @option options [String] :healthcheck Healthcheck options - only "port" and "type" required
14
+ #
15
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
16
+ #
17
+ # @see https://api.gb1.brightbox.com/1.0/#load_balancer_update_load_balancer
18
+ #
6
19
  def update_load_balancer(identifier, options)
7
20
  return nil if identifier.nil? || identifier == ""
8
21
  return nil if options.empty? || options.nil?
@@ -12,4 +25,4 @@ module Fog
12
25
  end
13
26
  end
14
27
  end
15
- end
28
+ end
@@ -2,29 +2,22 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
6
5
  # Requests an update to the currently scoped account
7
6
  #
8
- # === Parameters:
9
- #
10
- # <tt>options</tt>:: Hash of options for update
11
- #
12
- # === Options:
13
- #
14
- # <tt>name</tt>:: Account name
15
- # <tt>address_1</tt>:: First line of address
16
- # <tt>address_2</tt>:: Second line of address
17
- # <tt>city</tt>:: City part of address
18
- # <tt>county</tt>:: County part of address
19
- # <tt>postcode</tt>:: Postal code
20
- # <tt>country_code</tt>:: ISO 3166-1 two letter code (example: +GB+)
21
- # <tt>vat_registration_number</tt>:: Valid EU VAT Number or +nil+
22
- # <tt>telephone_number</tt>:: Valid International telephone number in E.164 format prefixed with ’+’
7
+ # @param [Hash] options
8
+ # @option options [String] :name Account name
9
+ # @option options [String] :address_1 First line of address
10
+ # @option options [String] :address_2 Second line of address
11
+ # @option options [String] :city City part of address
12
+ # @option options [String] :county County part of address
13
+ # @option options [String] :postcode Postcode or Zipcode
14
+ # @option options [String] :country_code ISO 3166-1 two letter code (example: `GB`)
15
+ # @option options [String] :vat_registration_number Must be a valid EU VAT number or `nil`
16
+ # @option options [String] :telephone_number Valid International telephone number in E.164 format prefixed with `+`
23
17
  #
24
- # === Returns:
18
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
25
19
  #
26
- # <tt>Hash</tt>:: The JSON response parsed to a Hash
27
- # <tt>nil</tt>:: If no options were passed to update
20
+ # @see https://api.gb1.brightbox.com/1.0/#account_update_account
28
21
  #
29
22
  def update_scoped_account(options)
30
23
  return nil if options.empty? || options.nil?
@@ -2,7 +2,17 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the server.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name Editable label
10
+ # @option options [String] :user_data User defined metadata
11
+ #
12
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
13
+ #
14
+ # @see https://api.gb1.brightbox.com/1.0/#server_update_server
15
+ #
6
16
  def update_server(identifier, options)
7
17
  return nil if identifier.nil? || identifier == ""
8
18
  return nil if options.empty? || options.nil?
@@ -12,4 +22,4 @@ module Fog
12
22
  end
13
23
  end
14
24
  end
15
- end
25
+ end
@@ -2,7 +2,17 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of the server group.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name Editable user label
10
+ # @option options [String] :description Editable user description
11
+ #
12
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
13
+ #
14
+ # @see https://api.gb1.brightbox.com/1.0/#server_group_update_server_group
15
+ #
6
16
  def update_server_group(identifier, options)
7
17
  return nil if identifier.nil? || identifier == ""
8
18
  return nil if options.empty? || options.nil?
@@ -12,4 +22,4 @@ module Fog
12
22
  end
13
23
  end
14
24
  end
15
- end
25
+ end
@@ -2,7 +2,20 @@ module Fog
2
2
  module Compute
3
3
  class Brightbox
4
4
  class Real
5
-
5
+ # Update some details of your user profile.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [String] :name
10
+ # @option options [String] :email_address
11
+ # @option options [String] :ssh_key
12
+ # @option options [String] :password A password string that conforms to the minimum requirements
13
+ # @option options [String] :password_confirmation A password string that conforms to the minimum requirements
14
+ #
15
+ # @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
16
+ #
17
+ # @see https://api.gb1.brightbox.com/1.0/#user_update_user
18
+ #
6
19
  def update_user(identifier, options)
7
20
  return nil if identifier.nil? || identifier == ""
8
21
  return nil if options.empty? || options.nil?
@@ -12,4 +25,4 @@ module Fog
12
25
  end
13
26
  end
14
27
  end
15
- end
28
+ end
@@ -33,6 +33,7 @@ module Fog
33
33
  attribute :guest_os_id, :aliases => 'guestosid'
34
34
  attribute :root_device_id, :aliases => 'rootdeviceid'
35
35
  attribute :root_device_type, :aliases => 'rootdevicetype'
36
+ attribute :group
36
37
  attribute :security_group_list, :type => :array, :aliases => 'securitygroup'
37
38
  attribute :nics, :type => :array, :aliases => 'nic'
38
39
 
@@ -85,6 +86,7 @@ module Fog
85
86
  'networkids' => network_ids,
86
87
  'diskofferingid' => disk_offering_id,
87
88
  'displayname' => display_name,
89
+ 'group' => group,
88
90
  'domainid' => domain_id,
89
91
  'hostid' => host_id,
90
92
  'ipaddress' => ip_address,
@@ -93,7 +95,7 @@ module Fog
93
95
  }
94
96
 
95
97
  options.merge!('networkids' => network_ids) if network_ids
96
- options.merge!('securitygroupids' => security_group_ids) if security_group_ids
98
+ options.merge!('securitygroupids' => security_group_ids) unless security_group_ids.empty?
97
99
 
98
100
  data = connection.deploy_virtual_machine(options)
99
101
  merge_attributes(data['deployvirtualmachineresponse'])
@@ -15,6 +15,7 @@ require 'time'
15
15
  require 'timeout'
16
16
 
17
17
  # internal core dependencies
18
+ require "fog/version"
18
19
  require 'fog/core/attributes'
19
20
  require 'fog/core/collection'
20
21
  require 'fog/core/connection'
@@ -2,6 +2,7 @@ module Fog
2
2
  class Connection
3
3
 
4
4
  def initialize(url, persistent=false, params={})
5
+ Excon.defaults[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
5
6
  @excon = Excon.new(url, params)
6
7
  @persistent = persistent
7
8
  end
@@ -225,8 +225,19 @@ DATA
225
225
  string_to_sign << "#{canonical_google_headers}"
226
226
 
227
227
  subdomain = params[:host].split(".#{@host}").first
228
- unless subdomain =~ /^(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
229
- Fog::Logger.warning("fog: the specified google storage bucket name(#{subdomain}) is not a valid dns name. See: http://code.google.com/apis/storage/docs/developer-guide.html#naming")
228
+ unless subdomain =~ /^(?!goog)(?:[a-z]|\d(?!\d{0,2}(?:\.\d{1,3}){3}$))(?:[a-z0-9]|\.(?![\.\-])|\-(?![\.])){1,61}[a-z0-9]$/
229
+ if subdomain =~ /_/
230
+ # https://github.com/fog/fog/pull/1258#issuecomment-10248620.
231
+ Fog::Logger.warning("fog: the specified google storage bucket name (#{subdomain}) is not DNS compliant (only characters a through z, digits 0 through 9, and the hyphen).")
232
+ else
233
+ # - Bucket names must contain only lowercase letters, numbers, dashes (-), underscores (_), and dots (.). Names containing dots require verification.
234
+ # - Bucket names must start and end with a number or letter.
235
+ # - Bucket names must contain 3 to 63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
236
+ # - Bucket names cannot be represented as an IP address in dotted-decimal notation (for example, 192.168.5.4).
237
+ # - Bucket names cannot begin with the "goog" prefix.
238
+ # - Also, for DNS compliance, you should not have a period adjacent to another period or dash. For example, ".." or "-." or ".-" are not acceptable.
239
+ Fog::Logger.warning("fog: the specified google storage bucket name (#{subdomain}) is not a valid dns name. See: https://developers.google.com/storage/docs/bucketnaming")
240
+ end
230
241
  params[:host] = params[:host].split("#{subdomain}.")[-1]
231
242
  if params[:path]
232
243
  params[:path] = "#{subdomain}/#{params[:path]}"
@@ -335,6 +335,7 @@ module Fog
335
335
  end
336
336
  else
337
337
  # If no template volume was given, let's create our own volume
338
+ options[:pool_name] = volume_pool_name if volume_pool_name
338
339
  options[:format_type] = volume_format_type if volume_format_type
339
340
  options[:capacity] = volume_capacity if volume_capacity
340
341
  options[:allocation] = volume_allocation if volume_allocation
@@ -58,7 +58,7 @@ module Fog
58
58
  :max_memory_size => dom.info.max_mem,
59
59
  :cputime => dom.info.cpu_time,
60
60
  :memory_size => dom.info.memory,
61
- :vcpus => dom.info.nr_virt_cpu,
61
+ :cpus => dom.info.nr_virt_cpu,
62
62
  :autostart => dom.autostart?,
63
63
  :os_type => dom.os_type,
64
64
  :active => dom.active?,
@@ -89,7 +89,7 @@ module Fog
89
89
  :max_memory_size => 8,
90
90
  :cputime => 7,
91
91
  :memory_size => 6,
92
- :vcpus => 5,
92
+ :cpus => 5,
93
93
  :autostart => false,
94
94
  :os_type => "RHEL6",
95
95
  :active => false,
@@ -72,48 +72,27 @@ module Fog
72
72
 
73
73
  # Keystone Style Auth
74
74
  def self.authenticate_v2(options, connection_options = {})
75
- uri = options[:openstack_auth_uri]
76
- connection = Fog::Connection.new(uri.to_s, false, connection_options)
77
- @openstack_api_key = options[:openstack_api_key]
78
- @openstack_username = options[:openstack_username]
79
- @openstack_tenant = options[:openstack_tenant]
80
- @openstack_auth_token = options[:openstack_auth_token]
81
- @service_name = options[:openstack_service_name]
82
- @identity_service_name = options[:openstack_identity_service_name]
83
- @endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
84
- @openstack_region = options[:openstack_region]
85
-
86
- if @openstack_auth_token
87
- req_body = {
88
- 'auth' => {
89
- 'token' => {
90
- 'id' => @openstack_auth_token
91
- }
92
- }
93
- }
94
- else
95
- req_body = {
96
- 'auth' => {
97
- 'passwordCredentials' => {
98
- 'username' => @openstack_username.to_s,
99
- 'password' => @openstack_api_key.to_s
100
- }
101
- }
102
- }
103
- end
104
- req_body['auth']['tenantName'] = @openstack_tenant if @openstack_tenant
75
+ uri = options[:openstack_auth_uri]
76
+ tenant_name = options[:openstack_tenant]
77
+ service_name = options[:openstack_service_name]
78
+ identity_service_name = options[:openstack_identity_service_name]
79
+ endpoint_type = (options[:openstack_endpoint_type] || 'publicURL').to_s
80
+ openstack_region = options[:openstack_region]
105
81
 
106
- body = retrieve_tokens_v2(connection, req_body, uri)
107
82
 
108
- svc = body['access']['serviceCatalog'].
109
- detect{|x| @service_name.include?(x['type']) }
83
+ body = retrieve_tokens_v2(options, connection_options)
84
+ service = body['access']['serviceCatalog'].
85
+ detect {|s| service_name.include?(s['type']) }
110
86
 
111
- unless svc
112
- unless @openstack_tenant
87
+ options[:unscoped_token] = body['access']['token']['id']
88
+
89
+ unless service
90
+ unless tenant_name
113
91
  response = Fog::Connection.new(
114
92
  "#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
115
93
  :expects => [200, 204],
116
94
  :headers => {'Content-Type' => 'application/json',
95
+ 'Accept' => 'application/json',
117
96
  'X-Auth-Token' => body['access']['token']['id']},
118
97
  :host => uri.host,
119
98
  :method => 'GET'
@@ -123,53 +102,73 @@ module Fog
123
102
  if body['tenants'].empty?
124
103
  raise Errors::NotFound.new('No Tenant Found')
125
104
  else
126
- req_body['auth']['tenantName'] = body['tenants'].first['name']
105
+ options[:openstack_tenant] = body['tenants'].first['name']
127
106
  end
128
107
  end
129
108
 
130
- body = retrieve_tokens_v2(connection, req_body, uri)
131
- if body['access']['token']['tenant'].nil?
132
- raise Errors::NotFound.new("Invalid Tenant '#{@openstack_tenant}'")
133
- end
134
- svc = body['access']['serviceCatalog'].
135
- detect{|x| @service_name.include?(x['type']) }
109
+ body = retrieve_tokens_v2(options, connection_options)
110
+ service = body['access']['serviceCatalog'].
111
+ detect{|s| service_name.include?(s['type']) }
136
112
  end
137
113
 
138
- svc['endpoints'] = svc['endpoints'].select{ |x| x['region'] == @openstack_region } if @openstack_region
139
- if svc['endpoints'].count > 1
140
- regions = svc["endpoints"].map { |x| x['region'] }.uniq.join(',')
141
- raise Errors::NotFound.new("Multiple regions available choose one of these '#{regions}'")
114
+ service['endpoints'] = service['endpoints'].select do |endpoint|
115
+ endpoint['region'] == openstack_region
116
+ end if openstack_region
117
+
118
+ if service['endpoints'].count > 1
119
+ regions = service["endpoints"].map{ |e| e['region'] }.uniq.join(',')
120
+ raise Errors::NotFound.new("Multiple regions available choose one of these '#{regions}'")
142
121
  end
143
122
 
144
- identity_svc = body['access']['serviceCatalog'].
145
- detect{|x| @identity_service_name.include?(x['type']) } if @identity_service_name
123
+ identity_service = body['access']['serviceCatalog'].
124
+ detect{|x| identity_service_name.include?(x['type']) } if identity_service_name
146
125
  tenant = body['access']['token']['tenant']
147
126
  user = body['access']['user']
148
127
 
149
- mgmt_url = svc['endpoints'].detect{|x| x[@endpoint_type]}[@endpoint_type]
150
- identity_url = identity_svc['endpoints'].detect{|x| x['publicURL']}['publicURL'] if identity_svc
151
- token = body['access']['token']['id']
152
- expires = body['access']['token']['expires']
128
+ management_url = service['endpoints'].detect{|s| s[endpoint_type]}[endpoint_type]
129
+ identity_url = identity_service['endpoints'].detect{|s| s['publicURL']}['publicURL'] if identity_service
153
130
 
154
131
  {
155
132
  :user => user,
156
133
  :tenant => tenant,
157
- :token => token,
158
- :expires => expires,
159
- :server_management_url => mgmt_url,
160
134
  :identity_public_endpoint => identity_url,
161
- :current_user_id => body['access']['user']['id']
135
+ :server_management_url => management_url,
136
+ :token => body['access']['token']['id'],
137
+ :expires => body['access']['token']['expires'],
138
+ :current_user_id => body['access']['user']['id'],
139
+ :unscoped_token => options[:unscoped_token]
162
140
  }
163
141
  end
164
142
 
165
- def self.retrieve_tokens_v2(connection, request_body, uri)
143
+ def self.retrieve_tokens_v2(options, connection_options = {})
144
+ api_key = options[:openstack_api_key].to_s
145
+ username = options[:openstack_username].to_s
146
+ tenant_name = options[:openstack_tenant].to_s
147
+ auth_token = options[:openstack_auth_token] || options[:unscoped_token]
148
+ uri = options[:openstack_auth_uri]
149
+
150
+ connection = Fog::Connection.new(uri.to_s, false, connection_options)
151
+ request_body = {:auth => Hash.new}
152
+
153
+ if auth_token
154
+ request_body[:auth][:token] = {
155
+ :id => auth_token
156
+ }
157
+ else
158
+ request_body[:auth][:passwordCredentials] = {
159
+ :username => username,
160
+ :password => api_key
161
+ }
162
+ end
163
+ request_body[:auth][:tenantName] = tenant_name if tenant_name
164
+
166
165
  response = connection.request({
167
166
  :expects => [200, 204],
168
167
  :headers => {'Content-Type' => 'application/json'},
169
168
  :body => Fog::JSON.encode(request_body),
170
169
  :host => uri.host,
171
170
  :method => 'POST',
172
- :path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
171
+ :path => (uri.path and not uri.path.empty?) ? uri.path : 'v2.0'
173
172
  })
174
173
 
175
174
  Fog::JSON.decode(response.body)