class Fog::Brightbox::Compute::Real
The Real
Service actually makes real connections to the Brightbox
service.
Public Instance Methods
Accepts the collaboration giving access to the account
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_collaboration_accept_user_collaboration
# File lib/fog/brightbox/requests/compute/accept_user_collaboration.rb, line 15 def accept_user_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/user/collaborations/#{identifier}/accept", [200], options) end
Enable console access via VNC to the server for 15 minutes.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_activate_console_server
# File lib/fog/brightbox/requests/compute/activate_console_server.rb, line 15 def activate_console_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/activate_console", [202], options) end
Adds a number of listeners to the load balancer to enable balancing across nodes for those settings.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array] :listeners Array of Listener parameters. Timeout is optional and specified in milliseconds. @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_add_listeners_load_balancer
# File lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb, line 17 def add_listeners_load_balancer(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/load_balancers/#{identifier}/add_listeners", [202], options) end
Add a number of nodes to the load balancer
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array] :nodes Array of Node parameters @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_add_nodes_load_balancer
# File lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb, line 17 def add_nodes_load_balancer(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/load_balancers/#{identifier}/add_nodes", [202], options) end
Add a number of servers to the server group.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array<Hash>] :servers Array of Hashes containing
+{"server" => server_id}+ for each server to add
@option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_group_add_servers_server_group
@example
options = { :servers => [ {"server" => "srv-abcde"}, {"server" => "srv-fghij"} ] } Compute[:brightbox].add_servers_server_group "grp-12345", options
# File lib/fog/brightbox/requests/compute/add_servers_server_group.rb, line 27 def add_servers_server_group(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/server_groups/#{identifier}/add_servers", [202], options) end
Applies firewall policy to given server group
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :server_group Server
Group to apply to @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_policy_apply_to_firewall_policy
# File lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb, line 17 def apply_to_firewall_policy(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/firewall_policies/#{identifier}/apply_to", [202], options) end
Create a new API client for the account.
@param [Hash] options @option options [String] :name @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#api_client_create_api_client
# File lib/fog/brightbox/requests/compute/create_api_client.rb, line 17 def create_api_client(options) wrapped_request("post", "/1.0/api_clients", [201], options) end
Create a new application for the user.
@param [Hash] options @option options [String] :name @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#application_create_application
# File lib/fog/brightbox/requests/compute/create_application.rb, line 17 def create_application(options) wrapped_request("post", "/1.0/applications", [201], options) end
Requests a new cloud IP address for the account.
@param [Hash] options @option options [String] :reverse_dns Reverse DNS hostname @option options [String] :name Name for Cloud IP @option options [Array] :port_translators Port on which external clients connect and port on which your service is listening. @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#cloud_ip_create_cloud_ip
# File lib/fog/brightbox/requests/compute/create_cloud_ip.rb, line 18 def create_cloud_ip(options = {}) wrapped_request("post", "/1.0/cloud_ips", [201], options) end
Invites the given email address to collaborate with the specified account. Existing users will be able to accept the collaboration whilst those without a Brightbox
account will be invited to create one.
@param [Hash] options @option options [String] :email Email address of user to invite @option options [String] :role Role to grant to the user. Currently only `admin` @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#collaboration_create_collaboration
# File lib/fog/brightbox/requests/compute/create_collaboration.rb, line 19 def create_collaboration(options) wrapped_request("post", "/1.0/collaborations", [201], options) end
@param [Hash] options @option options [String] :name @option options [String] :description @option options [String] :engine Database engine to request @option options [String] :version Database version to request @option options [Array] :allow_access … @option options [String] :maintenance_weekday Numerical index of weekday (0 is Sunday, 1 is Monday…) to set when automatic updates may be performed @option options [String] :maintenance_hour Number representing 24hr time start of maintenance window hour for x:00-x:59 (0-23) @option options [String] :snapshots_schedule Crontab pattern for scheduled snapshots. Must be at least hourly @option options [String] :snapshot @option options [String] :zone @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#database_server_create_database_server
# File lib/fog/brightbox/requests/compute/create_database_server.rb, line 23 def create_database_server(options) wrapped_request("post", "/1.0/database_servers", [202], options) end
Create a new firewall policy for the account.
Optionally applying to a server group at creation time.
@param [Hash] options @option options [String] :server_group @option options [String] :name Editable label @option options [String] :description Longer editable description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_policy_create_firewall_policy
# File lib/fog/brightbox/requests/compute/create_firewall_policy.rb, line 20 def create_firewall_policy(options) wrapped_request("post", "/1.0/firewall_policies", [201], options) end
Create a new firewall rule for a firewall policy.
@param [Hash] options @option options [String] :firewall_policy @option options [String] :protocol @option options [String] :source Required unless destination is set. @option options [String] :source_port @option options [String] :destination Required unless source is set @option options [String] :destination_port @option options [String] :icmp_type_name @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_rule_create_firewall_rule
# File lib/fog/brightbox/requests/compute/create_firewall_rule.rb, line 23 def create_firewall_rule(options) wrapped_request("post", "/1.0/firewall_rules", [202], options) end
Create a new image for the account by registering it against an image stored within the Brightbox
cloud image library.
The disk image must be in place before you can attempt to create a reference in the API.
@param [Hash] options @option options [String] :source Filename of the image uploaded to /images within Orbit. Can consist of letters, numbers or '-_+.~^' @option options [String] :arch OS architecture this image is built for @option options [String] :name Name for this image. If no name is specified, a name will be autogenerated based on the source filename & current time. Can be modified later. @option options [String] :username Username for the image @option options [Boolean] :public @option options [Boolean] :compatibility_mode @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#image_create_image
# File lib/fog/brightbox/requests/compute/create_image.rb, line 24 def create_image(options) wrapped_request("post", "/1.0/images", [201], options) end
Create a new load balancer for the account.
@param [Hash] options @option options [String] :name Editable label @option options [Array] :nodes Array of Node parameters @option options [String] :policy Method of Load balancing to use @option options [String] :certificate_pem A X509 SSL certificate in PEM format. Must be included along with 'certificate_key'. If intermediate certificates are required they should be concatenated after the main certificate @option options [String] :certificate_key The RSA private key used to sign the certificate in PEM format. Must be included along with 'certificate_pem' @option options [Boolean] :sslv3 Allow SSL v3 to be used (default: false) @option options [Array] :listeners What port to listen on, port to pass through to and protocol (tcp, http, https, http+ws, https+wss) of listener. Timeout is optional and specified in milliseconds (default is 50000). @option options [String] :healthcheck Healthcheck options - only “port” and “type” required @option options [String] :buffer_size Buffer size in bytes @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_create_load_balancer
# File lib/fog/brightbox/requests/compute/create_load_balancer.rb, line 24 def create_load_balancer(options) wrapped_request("post", "/1.0/load_balancers", [202], options) end
Create a new server for the account based on the required disk image.
Optionally can setup the type of server, zone to locate it, groups to join and custom metadata.
@param [Hash] options @option options [String] :image @option options [String] :name Editable label @option options [String] :server_type @option options [String] :zone Zone
in which to create new Server
@option options [String] :user_data @option options [Array] :server_groups Array of server groups to add server to @option options [String] :cloud_ip A Cloud IP that should be mapped as soon as the server is built. Either `true` to allocate a new Cloud IP or the identifier of an unmapped Cloud IP to reserve @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_create_server
# File lib/fog/brightbox/requests/compute/create_server.rb, line 24 def create_server(options) wrapped_request("post", "/1.0/servers", [202], options) end
Create a new server group for the account.
@param [Hash] options @option options [String] :name Editable user label @option options [String] :description Editable user description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_group_create_server_group
# File lib/fog/brightbox/requests/compute/create_server_group.rb, line 17 def create_server_group(options) wrapped_request("post", "/1.0/server_groups", [202], options) end
Destroy the API client.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#api_client_delete_api_client
# File lib/fog/brightbox/requests/compute/delete_api_client.rb, line 15 def delete_api_client(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/api_clients/#{identifier}", [200], options) end
Destroy the application.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#application_delete_application
# File lib/fog/brightbox/requests/compute/delete_application.rb, line 15 def delete_application(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/applications/#{identifier}", [200], options) end
Release the cloud IP address from the account's ownership.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#cloud_ip_delete_cloud_ip
# File lib/fog/brightbox/requests/compute/delete_cloud_ip.rb, line 15 def delete_cloud_ip(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/cloud_ips/#{identifier}", [200], options) end
Cancels or completes the collaboration
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#collaboration_delete_collaboration
# File lib/fog/brightbox/requests/compute/delete_collaboration.rb, line 15 def delete_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/collaborations/#{identifier}", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_delete_database_server
# File lib/fog/brightbox/requests/compute/delete_database_server.rb, line 13 def delete_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/database_servers/#{identifier}", [202], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_snapshot_delete_database_snapshot
# File lib/fog/brightbox/requests/compute/delete_database_snapshot.rb, line 13 def delete_database_snapshot(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/database_snapshots/#{identifier}", [202], options) end
Destroy the firewall policy if not in use.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#firewall_policy_delete_firewall_policy
# File lib/fog/brightbox/requests/compute/delete_firewall_policy.rb, line 15 def delete_firewall_policy(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/firewall_policies/#{identifier}", [202], options) end
Destroy the firewall rule.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#firewall_rule_delete_firewall_rule
# File lib/fog/brightbox/requests/compute/delete_firewall_rule.rb, line 15 def delete_firewall_rule(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/firewall_rules/#{identifier}", [202], options) end
Destroy the image.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#image_delete_image
# File lib/fog/brightbox/requests/compute/delete_image.rb, line 15 def delete_image(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/images/#{identifier}", [202], options) end
Destroy the LoadBalancer
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#load_balancer_delete_load_balancer
# File lib/fog/brightbox/requests/compute/delete_load_balancer.rb, line 15 def delete_load_balancer(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/load_balancers/#{identifier}", [202], options) end
Destroy the server and free up the resources.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_delete_server
# File lib/fog/brightbox/requests/compute/delete_server.rb, line 15 def delete_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/servers/#{identifier}", [202], options) end
Destroy the server group if not in use.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_group_delete_server_group
# File lib/fog/brightbox/requests/compute/delete_server_group.rb, line 15 def delete_server_group(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/server_groups/#{identifier}", [202], options) end
Ends an existing 'accepted' collaboration
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_collaboration_delete_user_collaboration
# File lib/fog/brightbox/requests/compute/delete_user_collaboration.rb, line 15 def delete_user_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("delete", "/1.0/user/collaborations/#{identifier}", [200], options) end
Get full details of the account.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#account_get_account
# File lib/fog/brightbox/requests/compute/get_account.rb, line 15 def get_account(identifier = nil, options = {}) wrapped_request("get", "/1.0/accounts/#{identifier}", [200], options) end
Get full details of the API client.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#api_client_get_api_client
# File lib/fog/brightbox/requests/compute/get_api_client.rb, line 15 def get_api_client(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/api_clients/#{identifier}", [200], options) end
Get full details of the application.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#application_get_application
# File lib/fog/brightbox/requests/compute/get_application.rb, line 15 def get_application(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/applications/#{identifier}", [200], options) end
Requests details about authenticated user from the API
@return [Hash] The JSON response parsed to a Hash
# File lib/fog/brightbox/requests/compute/get_authenticated_user.rb, line 9 def get_authenticated_user(options = {}) wrapped_request("get", "/1.0/user", [200], options) end
Get full details of the cloud IP address.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#cloud_ip_get_cloud_ip
# File lib/fog/brightbox/requests/compute/get_cloud_ip.rb, line 15 def get_cloud_ip(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/cloud_ips/#{identifier}", [200], options) end
Shows details of the collaboration
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#collaboration_get_collaboration
# File lib/fog/brightbox/requests/compute/get_collaboration.rb, line 15 def get_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/collaborations/#{identifier}", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_get_database_server
# File lib/fog/brightbox/requests/compute/get_database_server.rb, line 13 def get_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/database_servers/#{identifier}", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_snapshot_get_database_snapshot
# File lib/fog/brightbox/requests/compute/get_database_snapshot.rb, line 13 def get_database_snapshot(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/database_snapshots/#{identifier}", [200], options) end
Get details of the database server type.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_type_get_database_type
# File lib/fog/brightbox/requests/compute/get_database_type.rb, line 15 def get_database_type(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/database_types/#{identifier}", [200], options) end
Get details of the firewall policy
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#firewall_policy_get_firewall_policy
# File lib/fog/brightbox/requests/compute/get_firewall_policy.rb, line 15 def get_firewall_policy(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/firewall_policies/#{identifier}", [200], options) end
Get full details of the firewall rule.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#firewall_rule_get_firewall_rule
# File lib/fog/brightbox/requests/compute/get_firewall_rule.rb, line 15 def get_firewall_rule(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/firewall_rules/#{identifier}", [200], options) end
Get full details of the image.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#image_get_image
# File lib/fog/brightbox/requests/compute/get_image.rb, line 15 def get_image(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/images/#{identifier}", [200], options) end
Get full details of the interface.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#interface_get_interface
# File lib/fog/brightbox/requests/compute/get_interface.rb, line 15 def get_interface(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/interfaces/#{identifier}", [200], options) end
Get full details of the load balancer.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#load_balancer_get_load_balancer
# File lib/fog/brightbox/requests/compute/get_load_balancer.rb, line 15 def get_load_balancer(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/load_balancers/#{identifier}", [200], options) end
Requests details about currently scoped account
@return [Hash] The JSON response parsed to a Hash
# File lib/fog/brightbox/requests/compute/get_scoped_account.rb, line 8 def get_scoped_account(options = {}) wrapped_request("get", "/1.0/account", [200], options) end
Get full details of the server.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_get_server
# File lib/fog/brightbox/requests/compute/get_server.rb, line 15 def get_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/servers/#{identifier}", [200], options) end
Get details of the server group.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_group_get_server_group
# File lib/fog/brightbox/requests/compute/get_server_group.rb, line 15 def get_server_group(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/server_groups/#{identifier}", [200], options) end
Get full details of the server type.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_type_get_server_type
# File lib/fog/brightbox/requests/compute/get_server_type.rb, line 15 def get_server_type(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/server_types/#{identifier}", [200], options) end
Get full details of the user.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_get_user
# File lib/fog/brightbox/requests/compute/get_user.rb, line 15 def get_user(identifier, options = {}) wrapped_request("get", "/1.0/users/#{identifier}", [200], options) end
Shows details of the specified collaboration
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_collaboration_get_user_collaboration
# File lib/fog/brightbox/requests/compute/get_user_collaboration.rb, line 15 def get_user_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/user/collaborations/#{identifier}", [200], options) end
Get full details of the zone.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#zone_get_zone
# File lib/fog/brightbox/requests/compute/get_zone.rb, line 15 def get_zone(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("get", "/1.0/zones/#{identifier}", [200], options) end
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#account_list_accounts
# File lib/fog/brightbox/requests/compute/list_accounts.rb, line 12 def list_accounts(options = {}) options.merge!(:nested => "false") unless options.key?(:nested) wrapped_request("get", "/1.0/accounts", [200], options) end
Lists summary details of API clients owned by the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#api_client_list_api_clients
# File lib/fog/brightbox/requests/compute/list_api_clients.rb, line 14 def list_api_clients(options = {}) wrapped_request("get", "/1.0/api_clients", [200], options) end
Lists summary details of applications available to the user
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#application_list_applications
# File lib/fog/brightbox/requests/compute/list_applications.rb, line 14 def list_applications(options = {}) wrapped_request("get", "/1.0/applications", [200], options) end
Lists summary details of cloud IP addresses owned by the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#cloud_ip_list_cloud_ips
# File lib/fog/brightbox/requests/compute/list_cloud_ips.rb, line 14 def list_cloud_ips(options = {}) wrapped_request("get", "/1.0/cloud_ips", [200], options) end
Lists all the collaborations for the given account
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#collaboration_list_collaborations
# File lib/fog/brightbox/requests/compute/list_collaborations.rb, line 14 def list_collaborations(options = {}) wrapped_request("get", "/1.0/collaborations", [200], options) end
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_list_database_servers
# File lib/fog/brightbox/requests/compute/list_database_servers.rb, line 12 def list_database_servers(options = {}) wrapped_request("get", "/1.0/database_servers", [200], options) end
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_snapshot_list_database_snapshots
# File lib/fog/brightbox/requests/compute/list_database_snapshots.rb, line 12 def list_database_snapshots(options = {}) wrapped_request("get", "/1.0/database_snapshots", [200], options) end
List database server types.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_type_list_database_types
# File lib/fog/brightbox/requests/compute/list_database_types.rb, line 14 def list_database_types(options = {}) wrapped_request("get", "/1.0/database_types", [200], options) end
Lists events related to the account.
@api private
@param [Hash] options @option options [String] :limit Limit of pagination @option options [String] :offset Offset of pagination @option options [String] :resource_id Filter events for given resource_id @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#event_list_events
# File lib/fog/brightbox/requests/compute/list_events.rb, line 20 def list_events(options = {}) wrapped_request("get", "/1.0/events", [200], options) end
Lists summary details of firewall policies
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#firewall_policy_list_firewall_policies
# File lib/fog/brightbox/requests/compute/list_firewall_policies.rb, line 14 def list_firewall_policies(options = {}) wrapped_request("get", "/1.0/firewall_policies", [200], options) end
Lists summary details of images available for use by the Account
. It includes those available to all customers
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#image_list_images
# File lib/fog/brightbox/requests/compute/list_images.rb, line 14 def list_images(options = {}) wrapped_request("get", "/1.0/images", [200], options) end
Lists summary details of load balancers owned by the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#load_balancer_list_load_balancers
# File lib/fog/brightbox/requests/compute/list_load_balancers.rb, line 14 def list_load_balancers(options = {}) wrapped_request("get", "/1.0/load_balancers", [200], options) end
Lists summary details of server groups owned by the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_group_list_server_groups
# File lib/fog/brightbox/requests/compute/list_server_groups.rb, line 14 def list_server_groups(options = {}) wrapped_request("get", "/1.0/server_groups", [200], options) end
Lists summary details of server types available to the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_type_list_server_types
# File lib/fog/brightbox/requests/compute/list_server_types.rb, line 14 def list_server_types(options = {}) wrapped_request("get", "/1.0/server_types", [200], options) end
Lists summary details of servers owned by the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_list_servers
# File lib/fog/brightbox/requests/compute/list_servers.rb, line 14 def list_servers(options = {}) wrapped_request("get", "/1.0/servers", [200], options) end
Lists all collaborations the user is involved with
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_collaboration_list_user_collaborations
# File lib/fog/brightbox/requests/compute/list_user_collaborations.rb, line 14 def list_user_collaborations(options = {}) wrapped_request("get", "/1.0/user/collaborations", [200], options) end
Lists summary details of user.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_list_users
# File lib/fog/brightbox/requests/compute/list_users.rb, line 14 def list_users(options = {}) wrapped_request("get", "/1.0/users", [200], options) end
Lists summary details of zones available to the account.
@param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#zone_list_zones
# File lib/fog/brightbox/requests/compute/list_zones.rb, line 14 def list_zones(options = {}) wrapped_request("get", "/1.0/zones", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_lock_resource_database_server
# File lib/fog/brightbox/requests/compute/lock_resource_database_server.rb, line 13 def lock_resource_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/database_servers/#{identifier}/lock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_snapshot_lock_resource_database_snapshot
# File lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb, line 13 def lock_resource_database_snapshot(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/database_snapshots/#{identifier}/lock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#image_lock_resource_image
# File lib/fog/brightbox/requests/compute/lock_resource_image.rb, line 13 def lock_resource_image(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/images/#{identifier}/lock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#load_balancer_lock_resource_load_balancer
# File lib/fog/brightbox/requests/compute/lock_resource_load_balancer.rb, line 13 def lock_resource_load_balancer(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/load_balancers/#{identifier}/lock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_lock_resource_server
# File lib/fog/brightbox/requests/compute/lock_resource_server.rb, line 13 def lock_resource_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/servers/#{identifier}/lock_resource", [200], options) end
Maps (or points) a cloud IP address at a server's interface or a load balancer to allow them to respond to public requests.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :destination The ID of an Interface or LoadBalancer
to map the Cloud IP against @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#cloud_ip_map_cloud_ip
# File lib/fog/brightbox/requests/compute/map_cloud_ip.rb, line 17 def map_cloud_ip(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/cloud_ips/#{identifier}/map", [202], options) end
Removes a number of server from the server group and adds them to another server group given in parameters.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array<Hash>] :servers Array of Hashes containing
+{"server" => server_id}+ for each server to remove
@option options [String] :destination ServerGroup
to move servers to @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_group_move_servers_server_group
@example
options = { :destination => "grp-67890", :servers => [ {"server" => "srv-abcde"}, {"server" => "srv-fghij"} ] } Compute[:brightbox].remove_servers_server_group "grp-12345", options
# File lib/fog/brightbox/requests/compute/move_servers_server_group.rb, line 29 def move_servers_server_group(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/server_groups/#{identifier}/move_servers", [202], options) end
Issues a 'soft' reboot to the server however the OS may ignore it. The console remains connected.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_reboot_server
# File lib/fog/brightbox/requests/compute/reboot_server.rb, line 15 def reboot_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/reboot", [202], options) end
Rejects the collaboration
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#user_collaboration_reject_user_collaboration
# File lib/fog/brightbox/requests/compute/reject_user_collaboration.rb, line 15 def reject_user_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/user/collaborations/#{identifier}/reject", [200], options) end
Removes firewall policy from given server group
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :server_group Server
Group to remove @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_policy_remove_firewall_policy
# File lib/fog/brightbox/requests/compute/remove_firewall_policy.rb, line 17 def remove_firewall_policy(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/firewall_policies/#{identifier}/remove", [202], options) end
Removes a number of listeners from a load balancer to cease balancing across nodes for those settings.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array] :listeners Array of Listener parameters @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_remove_listeners_load_balancer
# File lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb, line 17 def remove_listeners_load_balancer(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/load_balancers/#{identifier}/remove_listeners", [202], options) end
Remove a number of nodes from the load balancer
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array] :nodes Array of Node parameters @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_remove_nodes_load_balancer
# File lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb, line 17 def remove_nodes_load_balancer(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/load_balancers/#{identifier}/remove_nodes", [202], options) end
Remove a number of servers from the server group.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Array<Hash>] :servers Array of Hashes containing
+{"server" => server_id}+ for each server
@option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_group_remove_servers_server_group
@example
options = { :servers => [ {"server" => "srv-abcde"}, {"server" => "srv-fghij"} ] } Compute[:brightbox].remove_servers_server_group "grp-12345", options
# File lib/fog/brightbox/requests/compute/remove_servers_server_group.rb, line 27 def remove_servers_server_group(identifier, options) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/server_groups/#{identifier}/remove_servers", [202], options) end
Makes an API request to the given path using passed options or those set with the service setup
@param [Hash] params Excon compatible options @option params [String] :body text to be sent over a socket @option params [Hash<Symbol, String>] :headers The default headers to supply in a request @option params [String] :host The destination host's reachable DNS name or IP, in the form of a String @option params [String] :path appears after 'scheme://host:port/' @option params [Fixnum] :port The port on which to connect, to the destination host @option params [Hash] :query appended to the 'scheme://host:port/path/' in the form of '?key=value' @option params [String] :scheme The protocol; 'https' causes OpenSSL to be used @return [Excon::Response] @see github.com/geemus/excon/blob/master/lib/excon/connection.rb
# File lib/fog/brightbox/compute.rb, line 233 def request(*args) authenticated_request(*args) end
Resends the invitation email to the collaborator
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#collaboration_resend_collaboration
# File lib/fog/brightbox/requests/compute/resend_collaboration.rb, line 15 def resend_collaboration(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/collaborations/#{identifier}/resend", [200], options) end
Reset the image library ftp password for the account.
@note The response is the only time the new password is available in plaintext.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#account_reset_ftp_password_account
# File lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb, line 17 def reset_ftp_password_account(identifier = nil, options = {}) wrapped_request("post", "/1.0/accounts/#{identifier}/reset_ftp_password", [200], options) end
Resets the image library ftp password for the scoped account
@note The response is the only time the new password is available in plaintext.
@return [Hash] The JSON response parsed to a Hash
# File lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb, line 11 def reset_ftp_password_scoped_account wrapped_request("post", "/1.0/account/reset_ftp_password", [200]) end
This requests the admin password for the database server is reset. The new `admin_password` is only returned in the JSON response to this request.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_reset_password_database_server
# File lib/fog/brightbox/requests/compute/reset_password_database_server.rb, line 15 def reset_password_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/database_servers/#{identifier}/reset_password", [202], options) end
Resets the secret used by the API client to a new generated value.
The response is the only time the new secret is available in plaintext.
Already authenticated tokens will still continue to be valid until expiry.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#api_client_reset_secret_api_client
# File lib/fog/brightbox/requests/compute/reset_secret_api_client.rb, line 19 def reset_secret_api_client(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/api_clients/#{identifier}/reset_secret", [200], options) end
Resets the secret used by the application to a new generated value.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#application_reset_secret_application
# File lib/fog/brightbox/requests/compute/reset_secret_application.rb, line 15 def reset_secret_application(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/applications/#{identifier}/reset_secret", [200], options) end
Issues a 'hard' reboot request to the server which can not be ignored by the OS. The console remains connected.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_reset_server
# File lib/fog/brightbox/requests/compute/reset_server.rb, line 15 def reset_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/reset", [202], options) end
Will issue a safe shutdown request for the server.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_shutdown_server
# File lib/fog/brightbox/requests/compute/shutdown_server.rb, line 15 def shutdown_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/shutdown", [202], options) end
Requests a snapshot of the database server to be made for restoring back to when it was made. The identifier of the new snapshot is returned by the response in a Link header
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :return_link Return the Link header as a second return value @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_snapshot_database_server
# File lib/fog/brightbox/requests/compute/snapshot_database_server.rb, line 16 def snapshot_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" method = "POST" path = "/1.0/database_servers/#{identifier}/snapshot" expected = [202] if options[:return_link] request_parameters = { :method => method, :path => path, :expects => expected } response = request(request_parameters) data = Fog::JSON.decode(response.body) image_id = Fog::Brightbox::LinkHelper.new(response.headers["Link"]).identifier return data, image_id else wrapped_request(method, path, expected) end end
Will issue a request to snapshot the Server
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :return_link Return the Link header as a second return value @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_snapshot_server
# File lib/fog/brightbox/requests/compute/snapshot_server.rb, line 16 def snapshot_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" method = "POST" path = "/1.0/servers/#{identifier}/snapshot" expected = [202] if options[:return_link] request_parameters = { :method => method, :path => path, :expects => expected } response = request(request_parameters) data = Fog::JSON.decode(response.body) image_id = Fog::Brightbox::LinkHelper.new(response.headers["Link"]).identifier return data, image_id else wrapped_request(method, path, expected) end end
Will issue a start request for the server to become active.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_start_server
# File lib/fog/brightbox/requests/compute/start_server.rb, line 15 def start_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/start", [202], options) end
Will issue a stop request for the server to become inactive.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_stop_server
# File lib/fog/brightbox/requests/compute/stop_server.rb, line 15 def stop_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/servers/#{identifier}/stop", [202], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_server_unlock_resource_database_server
# File lib/fog/brightbox/requests/compute/unlock_resource_database_server.rb, line 13 def unlock_resource_database_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/database_servers/#{identifier}/unlock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#database_snapshot_unlock_resource_database_snapshot
# File lib/fog/brightbox/requests/compute/unlock_resource_database_snapshot.rb, line 13 def unlock_resource_database_snapshot(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/database_snapshots/#{identifier}/unlock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#image_unlock_resource_image
# File lib/fog/brightbox/requests/compute/unlock_resource_image.rb, line 13 def unlock_resource_image(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/images/#{identifier}/unlock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#load_balancer_unlock_resource_load_balancer
# File lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb, line 13 def unlock_resource_load_balancer(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/load_balancers/#{identifier}/unlock_resource", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#server_unlock_resource_server
# File lib/fog/brightbox/requests/compute/unlock_resource_server.rb, line 13 def unlock_resource_server(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("put", "/1.0/servers/#{identifier}/unlock_resource", [200], options) end
Unmaps a cloud IP address from its current destination making it available to remap. This remains in the account's pool of addresses.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object
@see api.gb1.brightbox.com/1.0/#cloud_ip_unmap_cloud_ip
# File lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb, line 15 def unmap_cloud_ip(identifier, options = {}) return nil if identifier.nil? || identifier == "" wrapped_request("post", "/1.0/cloud_ips/#{identifier}/unmap", [202], options) end
Update some details of the account.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Account
name @option options [String] :address_1 First line of address @option options [String] :address_2 Second line of address @option options [String] :city City part of address @option options [String] :county County part of address @option options [String] :postcode Postcode or Zipcode @option options [String] :country_code ISO 3166-1 two letter code (example: `GB`) @option options [String] :vat_registration_number Must be a valid EU VAT number or `nil` @option options [String] :telephone_number Valid International telephone number in E.164 format prefixed with `+` @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#account_update_account
# File lib/fog/brightbox/requests/compute/update_account.rb, line 25 def update_account(*args) if args.size == 2 identifier = args[0] options = args[1] elsif args.size == 1 options = args[0] else raise ArgumentError, "wrong number of arguments (0 for 2)" end return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/accounts/#{identifier}", [200], options) end
Update some details of the API client.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name @option options [String] :description @option options [String] :permissions_group @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#api_client_update_api_client
# File lib/fog/brightbox/requests/compute/update_api_client.rb, line 19 def update_api_client(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/api_clients/#{identifier}", [200], options) end
Update some details of the application.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#application_update_application
# File lib/fog/brightbox/requests/compute/update_application.rb, line 18 def update_application(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/applications/#{identifier}", [200], options) end
Update some details of the cloud IP address.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :reverse_dns Reverse DNS hostname @option options [String] :name Name for Cloud IP @option options [Array] :port_translators Port on which external clients connect and port on which your service is listening. @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#cloud_ip_update_cloud_ip
# File lib/fog/brightbox/requests/compute/update_cloud_ip.rb, line 19 def update_cloud_ip(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/cloud_ips/#{identifier}", [200], options) end
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name @option options [String] :description @option options [Array] :allow_access … @option options [String] :maintenance_weekday Numerical index of weekday (0 is Sunday, 1 is Monday…) to set when automatic updates may be performed @option options [String] :maintenance_hour Number representing 24hr time start of maintenance window hour for x:00-x:59 (0-23) @option options [String] :snapshots_schedule Crontab pattern for scheduled snapshots. Must be at least hourly @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#database_server_update_database_server
# File lib/fog/brightbox/requests/compute/update_database_server.rb, line 20 def update_database_server(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/database_servers/#{identifier}", [200], options) end
Update some details of the server.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Editable label @option options [String] :description Editable label @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#database_snapshot_update_database_snapshot
# File lib/fog/brightbox/requests/compute/update_database_snapshot.rb, line 18 def update_database_snapshot(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/database_snapshots/#{identifier}", [200], options) end
Updates details of the firewall policy
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Editable label @option options [String] :description Longer editable description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_policy_update_firewall_policy
# File lib/fog/brightbox/requests/compute/update_firewall_policy.rb, line 18 def update_firewall_policy(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/firewall_policies/#{identifier}", [200], options) end
Update some settings of the firewall rule.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :protocol @option options [String] :source Required unless destination is set. @option options [String] :source_port @option options [String] :destination Required unless source is set @option options [String] :destination_port @option options [String] :icmp_type_name @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#firewall_rule_update_firewall_rule
# File lib/fog/brightbox/requests/compute/update_firewall_rule.rb, line 23 def update_firewall_rule(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/firewall_rules/#{identifier}", [202], options) end
Update some details of the image.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name @option options [String] :username @option options [String] :arch @option options [String] :status @option options [Boolean] :public @option options [Boolean] :compatibility_mode @option options [String] :description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#image_update_image
# File lib/fog/brightbox/requests/compute/update_image.rb, line 23 def update_image(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/images/#{identifier}", [200], options) end
Update some details of the load balancer.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Editable label @option options [Array] :nodes Array of Node parameters @option options [String] :policy Method of Load balancing to use @option options [String] :certificate_pem A X509 SSL certificate in PEM format. Must be included along with 'certificate_key'. If intermediate certificates are required they should be concatenated after the main certificate @option options [String] :certificate_key The RSA private key used to sign the certificate in PEM format. Must be included along with 'certificate_pem' @option options [Boolean] :sslv3 Allow SSL v3 to be used (default: false) @option options [Array] :listeners What port to listen on, port to pass through to and protocol (tcp, http, https, http+ws, https+wss) of listener. Timeout is optional and specified in milliseconds (default is 50000). @option options [String] :healthcheck Healthcheck options - only “port” and “type” required @option options [String] :buffer_size Buffer size in bytes @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#load_balancer_update_load_balancer
# File lib/fog/brightbox/requests/compute/update_load_balancer.rb, line 25 def update_load_balancer(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/load_balancers/#{identifier}", [202], options) end
Requests an update to the currently scoped account
@param [Hash] options @option options [String] :name Account
name @option options [String] :address_1 First line of address @option options [String] :address_2 Second line of address @option options [String] :city City part of address @option options [String] :county County part of address @option options [String] :postcode Postcode or Zipcode @option options [String] :country_code ISO 3166-1 two letter code (example: `GB`) @option options [String] :vat_registration_number Must be a valid EU VAT number or `nil` @option options [String] :telephone_number Valid International telephone number in E.164 format prefixed with `+`
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#account_update_account
# File lib/fog/brightbox/requests/compute/update_scoped_account.rb, line 23 def update_scoped_account(options) return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/account", [200], options) end
Update some details of the server.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Editable label @option options [String] :user_data User
defined metadata @option options [Array] :server_groups Array of server groups to update server to being a member of. This replaces any existing groups @option options [Boolean] :compatibility_mode Server
needs to be shutdown and restarted for changes to this to take effect @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_update_server
# File lib/fog/brightbox/requests/compute/update_server.rb, line 20 def update_server(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/servers/#{identifier}", [200], options) end
Update some details of the server group.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name Editable user label @option options [String] :description Editable user description @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#server_group_update_server_group
# File lib/fog/brightbox/requests/compute/update_server_group.rb, line 18 def update_server_group(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/server_groups/#{identifier}", [202], options) end
Update some details of your user profile.
@param [String] identifier Unique reference to identify the resource @param [Hash] options @option options [String] :name @option options [String] :email_address @option options [String] :ssh_key @option options [String] :password A password string that conforms to the minimum requirements @option options [String] :password_confirmation A password string that conforms to the minimum requirements @option options [Boolean] :nested passed through with the API request. When true nested resources are expanded.
@return [Hash] if successful Hash version of JSON object @return [NilClass] if no options were passed
@see api.gb1.brightbox.com/1.0/#user_update_user
# File lib/fog/brightbox/requests/compute/update_user.rb, line 21 def update_user(identifier, options) return nil if identifier.nil? || identifier == "" return nil if options.empty? || options.nil? wrapped_request("put", "/1.0/users/#{identifier}", [200], options) end
Makes a request but with seperated arguments and parses the response to a hash
@note wrapped_request
is the non-standard form of request introduced by mistake
@param [String] method HTTP method to use for the request @param [String] path The absolute path for the request @param [Array<Fixnum>] expected_responses HTTP response codes that have been successful @param [Hash] parameters Keys and values for JSON @option parameters [String] :account_id The scoping account if required
@return [Hash]
# File lib/fog/brightbox/compute.rb, line 248 def wrapped_request(method, path, expected_responses, parameters = {}) _wrapped_request(method, path, expected_responses, parameters) end
Private Instance Methods
Wrapped request is the non-standard form of request introduced by mistake
@param [String] method HTTP method to use for the request @param [String] path The absolute path for the request @param [Array<Fixnum>] expected_responses HTTP response codes that have been successful @param [Hash] parameters Keys and values for JSON @option parameters [String] :account_id The scoping account if required
@return [Hash]
# File lib/fog/brightbox/compute.rb, line 263 def _wrapped_request(method, path, expected_responses, parameters = {}) request_options = { :method => method.to_s.upcase, :path => path, :expects => expected_responses } query = {} # Select the account to scope for this request account = scoped_account(parameters.fetch(:account_id, nil)) query.merge!(:account_id => account) if account query.merge!(:nested => parameters.delete(:nested)) if parameters.key?(:nested) request_options[:query] = query unless query.empty? request_options[:body] = Fog::JSON.encode(parameters) unless parameters.empty? response = make_request(request_options) # FIXME: We should revert to returning the Excon::Request after a suitable # configuration option is in place to switch back to this incorrect behaviour if response.body.empty? response else Fog::JSON.decode(response.body) end end
Queries the API and tries to select the most suitable official Image
to use if the user chooses not to select their own.
@return [String] if image is found, the image's identifier @return [NilClass] if no image found or an error occured
# File lib/fog/brightbox/compute.rb, line 297 def select_default_image Fog::Brightbox::Compute::ImageSelector.new(list_images).latest_ubuntu end