fog-brightbox 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/fog-brightbox.gemspec +28 -0
  3. data/lib/fog/brightbox/compute/image_selector.rb +45 -0
  4. data/lib/fog/brightbox/compute/shared.rb +230 -0
  5. data/lib/fog/brightbox/compute.rb +305 -0
  6. data/lib/fog/brightbox/core.rb +11 -0
  7. data/lib/fog/brightbox/models/compute/account.rb +69 -0
  8. data/lib/fog/brightbox/models/compute/accounts.rb +29 -0
  9. data/lib/fog/brightbox/models/compute/api_client.rb +37 -0
  10. data/lib/fog/brightbox/models/compute/api_clients.rb +24 -0
  11. data/lib/fog/brightbox/models/compute/application.rb +24 -0
  12. data/lib/fog/brightbox/models/compute/applications.rb +28 -0
  13. data/lib/fog/brightbox/models/compute/cloud_ip.rb +68 -0
  14. data/lib/fog/brightbox/models/compute/cloud_ips.rb +34 -0
  15. data/lib/fog/brightbox/models/compute/collaboration.rb +49 -0
  16. data/lib/fog/brightbox/models/compute/collaborations.rb +47 -0
  17. data/lib/fog/brightbox/models/compute/database_server.rb +97 -0
  18. data/lib/fog/brightbox/models/compute/database_servers.rb +28 -0
  19. data/lib/fog/brightbox/models/compute/database_snapshot.rb +52 -0
  20. data/lib/fog/brightbox/models/compute/database_snapshots.rb +24 -0
  21. data/lib/fog/brightbox/models/compute/database_type.rb +19 -0
  22. data/lib/fog/brightbox/models/compute/database_types.rb +26 -0
  23. data/lib/fog/brightbox/models/compute/firewall_policies.rb +29 -0
  24. data/lib/fog/brightbox/models/compute/firewall_policy.rb +63 -0
  25. data/lib/fog/brightbox/models/compute/firewall_rule.rb +54 -0
  26. data/lib/fog/brightbox/models/compute/firewall_rules.rb +24 -0
  27. data/lib/fog/brightbox/models/compute/flavor.rb +32 -0
  28. data/lib/fog/brightbox/models/compute/flavors.rb +28 -0
  29. data/lib/fog/brightbox/models/compute/image.rb +64 -0
  30. data/lib/fog/brightbox/models/compute/images.rb +28 -0
  31. data/lib/fog/brightbox/models/compute/load_balancer.rb +107 -0
  32. data/lib/fog/brightbox/models/compute/load_balancers.rb +28 -0
  33. data/lib/fog/brightbox/models/compute/server.rb +217 -0
  34. data/lib/fog/brightbox/models/compute/server_group.rb +94 -0
  35. data/lib/fog/brightbox/models/compute/server_groups.rb +29 -0
  36. data/lib/fog/brightbox/models/compute/servers.rb +61 -0
  37. data/lib/fog/brightbox/models/compute/user.rb +43 -0
  38. data/lib/fog/brightbox/models/compute/user_collaboration.rb +44 -0
  39. data/lib/fog/brightbox/models/compute/user_collaborations.rb +31 -0
  40. data/lib/fog/brightbox/models/compute/users.rb +27 -0
  41. data/lib/fog/brightbox/models/compute/zone.rb +22 -0
  42. data/lib/fog/brightbox/models/compute/zones.rb +29 -0
  43. data/lib/fog/brightbox/oauth2.rb +166 -0
  44. data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +21 -0
  45. data/lib/fog/brightbox/requests/compute/activate_console_server.rb +21 -0
  46. data/lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb +24 -0
  47. data/lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb +24 -0
  48. data/lib/fog/brightbox/requests/compute/add_servers_server_group.rb +34 -0
  49. data/lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb +24 -0
  50. data/lib/fog/brightbox/requests/compute/create_api_client.rb +23 -0
  51. data/lib/fog/brightbox/requests/compute/create_application.rb +23 -0
  52. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +24 -0
  53. data/lib/fog/brightbox/requests/compute/create_collaboration.rb +23 -0
  54. data/lib/fog/brightbox/requests/compute/create_database_server.rb +25 -0
  55. data/lib/fog/brightbox/requests/compute/create_firewall_policy.rb +26 -0
  56. data/lib/fog/brightbox/requests/compute/create_firewall_rule.rb +29 -0
  57. data/lib/fog/brightbox/requests/compute/create_image.rb +30 -0
  58. data/lib/fog/brightbox/requests/compute/create_load_balancer.rb +26 -0
  59. data/lib/fog/brightbox/requests/compute/create_server.rb +29 -0
  60. data/lib/fog/brightbox/requests/compute/create_server_group.rb +23 -0
  61. data/lib/fog/brightbox/requests/compute/delete_api_client.rb +28 -0
  62. data/lib/fog/brightbox/requests/compute/delete_application.rb +28 -0
  63. data/lib/fog/brightbox/requests/compute/delete_cloud_ip.rb +28 -0
  64. data/lib/fog/brightbox/requests/compute/delete_collaboration.rb +28 -0
  65. data/lib/fog/brightbox/requests/compute/delete_database_server.rb +26 -0
  66. data/lib/fog/brightbox/requests/compute/delete_database_snapshot.rb +26 -0
  67. data/lib/fog/brightbox/requests/compute/delete_firewall_policy.rb +28 -0
  68. data/lib/fog/brightbox/requests/compute/delete_firewall_rule.rb +28 -0
  69. data/lib/fog/brightbox/requests/compute/delete_image.rb +28 -0
  70. data/lib/fog/brightbox/requests/compute/delete_load_balancer.rb +28 -0
  71. data/lib/fog/brightbox/requests/compute/delete_server.rb +28 -0
  72. data/lib/fog/brightbox/requests/compute/delete_server_group.rb +28 -0
  73. data/lib/fog/brightbox/requests/compute/delete_user_collaboration.rb +28 -0
  74. data/lib/fog/brightbox/requests/compute/get_account.rb +29 -0
  75. data/lib/fog/brightbox/requests/compute/get_api_client.rb +21 -0
  76. data/lib/fog/brightbox/requests/compute/get_application.rb +21 -0
  77. data/lib/fog/brightbox/requests/compute/get_authenticated_user.rb +17 -0
  78. data/lib/fog/brightbox/requests/compute/get_cloud_ip.rb +21 -0
  79. data/lib/fog/brightbox/requests/compute/get_collaboration.rb +21 -0
  80. data/lib/fog/brightbox/requests/compute/get_database_server.rb +19 -0
  81. data/lib/fog/brightbox/requests/compute/get_database_snapshot.rb +19 -0
  82. data/lib/fog/brightbox/requests/compute/get_database_type.rb +21 -0
  83. data/lib/fog/brightbox/requests/compute/get_firewall_policy.rb +21 -0
  84. data/lib/fog/brightbox/requests/compute/get_firewall_rule.rb +21 -0
  85. data/lib/fog/brightbox/requests/compute/get_image.rb +21 -0
  86. data/lib/fog/brightbox/requests/compute/get_interface.rb +21 -0
  87. data/lib/fog/brightbox/requests/compute/get_load_balancer.rb +21 -0
  88. data/lib/fog/brightbox/requests/compute/get_scoped_account.rb +15 -0
  89. data/lib/fog/brightbox/requests/compute/get_server.rb +21 -0
  90. data/lib/fog/brightbox/requests/compute/get_server_group.rb +21 -0
  91. data/lib/fog/brightbox/requests/compute/get_server_type.rb +21 -0
  92. data/lib/fog/brightbox/requests/compute/get_user.rb +29 -0
  93. data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +21 -0
  94. data/lib/fog/brightbox/requests/compute/get_zone.rb +21 -0
  95. data/lib/fog/brightbox/requests/compute/list_accounts.rb +17 -0
  96. data/lib/fog/brightbox/requests/compute/list_api_clients.rb +19 -0
  97. data/lib/fog/brightbox/requests/compute/list_applications.rb +19 -0
  98. data/lib/fog/brightbox/requests/compute/list_cloud_ips.rb +19 -0
  99. data/lib/fog/brightbox/requests/compute/list_collaborations.rb +19 -0
  100. data/lib/fog/brightbox/requests/compute/list_database_servers.rb +17 -0
  101. data/lib/fog/brightbox/requests/compute/list_database_snapshots.rb +17 -0
  102. data/lib/fog/brightbox/requests/compute/list_database_types.rb +19 -0
  103. data/lib/fog/brightbox/requests/compute/list_firewall_policies.rb +19 -0
  104. data/lib/fog/brightbox/requests/compute/list_images.rb +19 -0
  105. data/lib/fog/brightbox/requests/compute/list_load_balancers.rb +19 -0
  106. data/lib/fog/brightbox/requests/compute/list_server_groups.rb +19 -0
  107. data/lib/fog/brightbox/requests/compute/list_server_types.rb +19 -0
  108. data/lib/fog/brightbox/requests/compute/list_servers.rb +19 -0
  109. data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +19 -0
  110. data/lib/fog/brightbox/requests/compute/list_users.rb +19 -0
  111. data/lib/fog/brightbox/requests/compute/list_zones.rb +19 -0
  112. data/lib/fog/brightbox/requests/compute/map_cloud_ip.rb +24 -0
  113. data/lib/fog/brightbox/requests/compute/move_servers_server_group.rb +36 -0
  114. data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +21 -0
  115. data/lib/fog/brightbox/requests/compute/remove_firewall_policy.rb +24 -0
  116. data/lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb +24 -0
  117. data/lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb +24 -0
  118. data/lib/fog/brightbox/requests/compute/remove_servers_server_group.rb +34 -0
  119. data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +21 -0
  120. data/lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb +32 -0
  121. data/lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb +18 -0
  122. data/lib/fog/brightbox/requests/compute/reset_password_database_server.rb +19 -0
  123. data/lib/fog/brightbox/requests/compute/reset_secret_api_client.rb +25 -0
  124. data/lib/fog/brightbox/requests/compute/reset_secret_application.rb +21 -0
  125. data/lib/fog/brightbox/requests/compute/shutdown_server.rb +21 -0
  126. data/lib/fog/brightbox/requests/compute/snapshot_database_server.rb +19 -0
  127. data/lib/fog/brightbox/requests/compute/snapshot_server.rb +21 -0
  128. data/lib/fog/brightbox/requests/compute/start_server.rb +21 -0
  129. data/lib/fog/brightbox/requests/compute/stop_server.rb +21 -0
  130. data/lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb +21 -0
  131. data/lib/fog/brightbox/requests/compute/update_account.rb +61 -0
  132. data/lib/fog/brightbox/requests/compute/update_api_client.rb +26 -0
  133. data/lib/fog/brightbox/requests/compute/update_application.rb +26 -0
  134. data/lib/fog/brightbox/requests/compute/update_cloud_ip.rb +27 -0
  135. data/lib/fog/brightbox/requests/compute/update_database_server.rb +25 -0
  136. data/lib/fog/brightbox/requests/compute/update_database_snapshot.rb +26 -0
  137. data/lib/fog/brightbox/requests/compute/update_firewall_policy.rb +26 -0
  138. data/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +31 -0
  139. data/lib/fog/brightbox/requests/compute/update_image.rb +31 -0
  140. data/lib/fog/brightbox/requests/compute/update_load_balancer.rb +29 -0
  141. data/lib/fog/brightbox/requests/compute/update_scoped_account.rb +31 -0
  142. data/lib/fog/brightbox/requests/compute/update_server.rb +28 -0
  143. data/lib/fog/brightbox/requests/compute/update_server_group.rb +26 -0
  144. data/lib/fog/brightbox/requests/compute/update_user.rb +29 -0
  145. data/lib/fog/brightbox/version.rb +5 -0
  146. data/lib/fog/brightbox.rb +1 -0
  147. metadata +261 -0
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Remove a number of nodes from the load balancer
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [Array] :nodes Array of Node parameters
10
+ #
11
+ # @return [Hash] if successful Hash version of JSON object
12
+ # @return [NilClass] if no options were passed
13
+ #
14
+ # @see https://api.gb1.brightbox.com/1.0/#load_balancer_remove_nodes_load_balancer
15
+ #
16
+ def remove_nodes_load_balancer(identifier, options)
17
+ return nil if identifier.nil? || identifier == ""
18
+ wrapped_request("post", "/1.0/load_balancers/#{identifier}/remove_nodes", [202], options)
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,34 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Remove a number of servers from the server group.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ # @param [Hash] options
9
+ # @option options [Array<Hash>] :servers Array of Hashes containing
10
+ # +{"server" => server_id}+ for each server
11
+ #
12
+ # @return [Hash] if successful Hash version of JSON object
13
+ # @return [NilClass] if no options were passed
14
+ #
15
+ # @see https://api.gb1.brightbox.com/1.0/#server_group_remove_servers_server_group
16
+ #
17
+ # @example
18
+ # options = {
19
+ # :servers => [
20
+ # {"server" => "srv-abcde"},
21
+ # {"server" => "srv-fghij"}
22
+ # ]
23
+ # }
24
+ # Compute[:brightbox].remove_servers_server_group "grp-12345", options
25
+ #
26
+ def remove_servers_server_group(identifier, options)
27
+ return nil if identifier.nil? || identifier == ""
28
+ wrapped_request("post", "/1.0/server_groups/#{identifier}/remove_servers", [202], options)
29
+ end
30
+
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Resends the invitation email to the collaborator
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#collaboration_resend_collaboration
12
+ #
13
+ def resend_collaboration(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/collaborations/#{identifier}/resend", [200])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,32 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+
6
+ # Reset the image library ftp password for the account.
7
+ #
8
+ # @note The response is the only time the new password is available in plaintext.
9
+ #
10
+ # @overload reset_ftp_password_account(identifier)
11
+ # @param [String] identifier Unique reference to identify the resource
12
+ #
13
+ # @overload reset_ftp_password_account()
14
+ # @deprecated Use {Fog::Compute::Brightbox::Real#reset_ftp_password_scoped_account} instead
15
+ #
16
+ # @return [Hash] if successful Hash version of JSON object
17
+ #
18
+ # @see https://api.gb1.brightbox.com/1.0/#account_reset_ftp_password_account
19
+ #
20
+ def reset_ftp_password_account(identifier = nil)
21
+ if identifier.nil? || identifier.empty?
22
+ Fog::Logger.deprecation("reset_ftp_password_account() without a parameter is deprecated, use reset_ftp_password_scoped_account instead [light_black](#{caller.first})[/]")
23
+ reset_ftp_password_scoped_account
24
+ else
25
+ wrapped_request("post", "/1.0/accounts/#{identifier}/reset_ftp_password", [200])
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,18 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Resets the image library ftp password for the scoped account
6
+ #
7
+ # @note The response is the only time the new password is available in plaintext.
8
+ #
9
+ # @return [Hash] The JSON response parsed to a Hash
10
+ #
11
+ def reset_ftp_password_scoped_account
12
+ wrapped_request("post", "/1.0/account/reset_ftp_password", [200])
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # @param [String] identifier Unique reference to identify the resource
6
+ #
7
+ # @return [Hash] if successful Hash version of JSON object
8
+ #
9
+ # @see https://api.gb1.brightbox.com/1.0/#database_server_reset_password_database_server
10
+ #
11
+ def reset_password_database_server(identifier)
12
+ return nil if identifier.nil? || identifier == ""
13
+ wrapped_request("post", "/1.0/database_servers/#{identifier}/reset_password", [202])
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Resets the secret used by the API client to a new generated value.
6
+ #
7
+ # The response is the only time the new secret is available in plaintext.
8
+ #
9
+ # Already authenticated tokens will still continue to be valid until expiry.
10
+ #
11
+ # @param [String] identifier Unique reference to identify the resource
12
+ #
13
+ # @return [Hash] if successful Hash version of JSON object
14
+ #
15
+ # @see https://api.gb1.brightbox.com/1.0/#api_client_reset_secret_api_client
16
+ #
17
+ def reset_secret_api_client(identifier)
18
+ return nil if identifier.nil? || identifier == ""
19
+ wrapped_request("post", "/1.0/api_clients/#{identifier}/reset_secret", [200])
20
+ end
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Resets the secret used by the application to a new generated value.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#application_reset_secret_application
12
+ #
13
+ def reset_secret_application(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/applications/#{identifier}/reset_secret", [200])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Will issue a safe shutdown request for the server.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#server_shutdown_server
12
+ #
13
+ def shutdown_server(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/servers/#{identifier}/shutdown", [202])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # @param [String] identifier Unique reference to identify the resource
6
+ #
7
+ # @return [Hash] if successful Hash version of JSON object
8
+ #
9
+ # @see https://api.gb1.brightbox.com/1.0/#database_server_snapshot_database_server
10
+ #
11
+ def snapshot_database_server(identifier)
12
+ return nil if identifier.nil? || identifier == ""
13
+ wrapped_request("post", "/1.0/database_servers/#{identifier}/snapshot", [202])
14
+ end
15
+
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Will issue a request to snapshot the Server
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#server_snapshot_server
12
+ #
13
+ def snapshot_server(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/servers/#{identifier}/snapshot", [202])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Will issue a start request for the server to become active.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#server_start_server
12
+ #
13
+ def start_server(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/servers/#{identifier}/start", [202])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Will issue a stop request for the server to become inactive.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#server_stop_server
12
+ #
13
+ def stop_server(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/servers/#{identifier}/stop", [202])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
5
+ # Unmaps a cloud IP address from its current destination making it available to remap. This remains in the account's pool of addresses.
6
+ #
7
+ # @param [String] identifier Unique reference to identify the resource
8
+ #
9
+ # @return [Hash] if successful Hash version of JSON object
10
+ #
11
+ # @see https://api.gb1.brightbox.com/1.0/#cloud_ip_unmap_cloud_ip
12
+ #
13
+ def unmap_cloud_ip(identifier)
14
+ return nil if identifier.nil? || identifier == ""
15
+ wrapped_request("post", "/1.0/cloud_ips/#{identifier}/unmap", [202])
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,61 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
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] if successful Hash version of JSON object
35
+ # @return [NilClass] if no options were passed
36
+ #
37
+ # @see https://api.gb1.brightbox.com/1.0/#account_update_account
38
+ #
39
+ def update_account(*args)
40
+ if args.size == 2
41
+ identifier = args[0]
42
+ options = args[1]
43
+ elsif args.size == 1
44
+ options = args[0]
45
+ else
46
+ raise ArgumentError, "wrong number of arguments (0 for 2)"
47
+ end
48
+
49
+ return nil if options.empty? || options.nil?
50
+ if identifier.nil? || identifier.empty?
51
+ Fog::Logger.deprecation("update_account() without a parameter is deprecated, use update_scoped_account instead [light_black](#{caller.first})[/]")
52
+ update_scoped_account(options)
53
+ else
54
+ wrapped_request("put", "/1.0/accounts/#{identifier}", [200], options)
55
+ end
56
+ end
57
+
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
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] if successful Hash version of JSON object
13
+ # @return [NilClass] if no options were passed
14
+ #
15
+ # @see https://api.gb1.brightbox.com/1.0/#api_client_update_api_client
16
+ #
17
+ def update_api_client(identifier, options)
18
+ return nil if identifier.nil? || identifier == ""
19
+ return nil if options.empty? || options.nil?
20
+ wrapped_request("put", "/1.0/api_clients/#{identifier}", [200], options)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ module Fog
2
+ module Compute
3
+ class Brightbox
4
+ class Real
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] if successful Hash version of JSON object
13
+ # @return [NilClass] if no options were passed
14
+ #
15
+ # @see https://api.gb1.brightbox.com/1.0/#application_update_application
16
+ #
17
+ def update_application(identifier, options)
18
+ return nil if identifier.nil? || identifier == ""
19
+ return nil if options.empty? || options.nil?
20
+ wrapped_request("put", "/1.0/applications/#{identifier}", [200], options)
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end