Class: Fog::Compute::Brightbox::Real

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/fog/brightbox/compute.rb,
lib/fog/brightbox/requests/compute/get_user.rb,
lib/fog/brightbox/requests/compute/get_zone.rb,
lib/fog/brightbox/requests/compute/get_image.rb,
lib/fog/brightbox/requests/compute/get_server.rb,
lib/fog/brightbox/requests/compute/list_users.rb,
lib/fog/brightbox/requests/compute/list_zones.rb,
lib/fog/brightbox/requests/compute/get_account.rb,
lib/fog/brightbox/requests/compute/list_images.rb,
lib/fog/brightbox/requests/compute/stop_server.rb,
lib/fog/brightbox/requests/compute/update_user.rb,
lib/fog/brightbox/requests/compute/create_image.rb,
lib/fog/brightbox/requests/compute/get_cloud_ip.rb,
lib/fog/brightbox/requests/compute/list_servers.rb,
lib/fog/brightbox/requests/compute/map_cloud_ip.rb,
lib/fog/brightbox/requests/compute/start_server.rb,
lib/fog/brightbox/requests/compute/update_image.rb,
lib/fog/brightbox/requests/compute/create_server.rb,
lib/fog/brightbox/requests/compute/destroy_image.rb,
lib/fog/brightbox/requests/compute/get_interface.rb,
lib/fog/brightbox/requests/compute/list_accounts.rb,
lib/fog/brightbox/requests/compute/update_server.rb,
lib/fog/brightbox/requests/compute/destroy_server.rb,
lib/fog/brightbox/requests/compute/get_api_client.rb,
lib/fog/brightbox/requests/compute/list_cloud_ips.rb,
lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb,
lib/fog/brightbox/requests/compute/update_account.rb,
lib/fog/brightbox/requests/compute/create_cloud_ip.rb,
lib/fog/brightbox/requests/compute/get_application.rb,
lib/fog/brightbox/requests/compute/get_server_type.rb,
lib/fog/brightbox/requests/compute/shutdown_server.rb,
lib/fog/brightbox/requests/compute/snapshot_server.rb,
lib/fog/brightbox/requests/compute/update_cloud_ip.rb,
lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb,
lib/fog/brightbox/requests/compute/get_server_group.rb,
lib/fog/brightbox/requests/compute/list_api_clients.rb,
lib/fog/brightbox/requests/compute/create_api_client.rb,
lib/fog/brightbox/requests/compute/get_firewall_rule.rb,
lib/fog/brightbox/requests/compute/get_load_balancer.rb,
lib/fog/brightbox/requests/compute/list_applications.rb,
lib/fog/brightbox/requests/compute/list_server_types.rb,
lib/fog/brightbox/requests/compute/update_api_client.rb,
lib/fog/brightbox/requests/compute/create_application.rb,
lib/fog/brightbox/requests/compute/destroy_api_client.rb,
lib/fog/brightbox/requests/compute/get_scoped_account.rb,
lib/fog/brightbox/requests/compute/list_server_groups.rb,
lib/fog/brightbox/requests/compute/update_application.rb,
lib/fog/brightbox/requests/compute/create_server_group.rb,
lib/fog/brightbox/requests/compute/destroy_application.rb,
lib/fog/brightbox/requests/compute/get_firewall_policy.rb,
lib/fog/brightbox/requests/compute/list_load_balancers.rb,
lib/fog/brightbox/requests/compute/update_server_group.rb,
lib/fog/brightbox/requests/compute/create_firewall_rule.rb,
lib/fog/brightbox/requests/compute/create_load_balancer.rb,
lib/fog/brightbox/requests/compute/destroy_server_group.rb,
lib/fog/brightbox/requests/compute/update_firewall_rule.rb,
lib/fog/brightbox/requests/compute/update_load_balancer.rb,
lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb,
lib/fog/brightbox/requests/compute/destroy_load_balancer.rb,
lib/fog/brightbox/requests/compute/update_scoped_account.rb,
lib/fog/brightbox/requests/compute/create_firewall_policy.rb,
lib/fog/brightbox/requests/compute/get_authenticated_user.rb,
lib/fog/brightbox/requests/compute/list_firewall_policies.rb,
lib/fog/brightbox/requests/compute/remove_firewall_policy.rb,
lib/fog/brightbox/requests/compute/update_firewall_policy.rb,
lib/fog/brightbox/requests/compute/activate_console_server.rb,
lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb,
lib/fog/brightbox/requests/compute/destroy_firewall_policy.rb,
lib/fog/brightbox/requests/compute/reset_secret_api_client.rb,
lib/fog/brightbox/requests/compute/add_servers_server_group.rb,
lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb,
lib/fog/brightbox/requests/compute/reset_secret_application.rb,
lib/fog/brightbox/requests/compute/move_servers_server_group.rb,
lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb,
lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb,
lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb,
lib/fog/brightbox/requests/compute/remove_servers_server_group.rb,
lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb,
lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb

Overview

The Real Service actually makes real connections to the Brightbox service.

Instance Method Summary collapse

Methods included from Shared

#access_token, #access_token_available?, #account, #authenticating_as_user?, #default_image, #get_access_token, #get_access_token!, #initialize, #refresh_token, #scoped_account, #scoped_account=, #scoped_account_reset

Methods included from Brightbox::OAuth2

#request_access_token

Instance Method Details

#activate_console_server(identifier) ⇒ Hash

Enable console access via VNC to the server for 15 minutes.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/activate_console_server.rb', line 13

def activate_console_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/servers/#{identifier}/activate_console", [202])
end

#add_listeners_load_balancer(identifier, options) ⇒ Hash?

Adds a number of listeners to the load balancer to enable balancing across nodes for those settings.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :listeners (Array)

    Array of Listener parameters. Timeout is optional and specified in milliseconds.

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb', line 15

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_nodes_load_balancer(identifier, options) ⇒ Hash?

Add a number of nodes to the load balancer

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nodes (Array)

    Array of Node parameters

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb', line 15

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_servers_server_group(identifier, options) ⇒ Hash?

Add a number of servers to the server group.

Examples:

Compute[:brightbox].add_servers_server_group "grp-12345", :servers => [{"server" => "srv-abcde"}, {"server" => "srv-fghij"}]

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing ‘=> server_id` for each server to add

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



18
19
20
21
# File 'lib/fog/brightbox/requests/compute/add_servers_server_group.rb', line 18

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

#apply_to_firewall_policy(identifier, options) ⇒ Hash?

Applies firewall policy to given server group

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :server_group (String)

    Server Group to apply to

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb', line 15

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_api_client(options) ⇒ Hash?

Create a new API client for the account.

Parameters:

Options Hash (options):

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
# File 'lib/fog/brightbox/requests/compute/create_api_client.rb', line 15

def create_api_client(options)
  wrapped_request("post", "/1.0/api_clients", [201], options)
end

#create_application(options) ⇒ Hash?

Create a new application for the user.

Parameters:

Options Hash (options):

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
# File 'lib/fog/brightbox/requests/compute/create_application.rb', line 15

def create_application(options)
  wrapped_request("post", "/1.0/applications", [201], options)
end

#create_cloud_ip(options = {}) ⇒ Hash?

Requests a new cloud IP address for the account.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :reverse_dns (String)

    Reverse DNS hostname

  • :name (String)

    Name for Cloud IP

  • :port_translators (Array)

    Port on which external clients connect and port on which your service is listening.

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



16
17
18
# File 'lib/fog/brightbox/requests/compute/create_cloud_ip.rb', line 16

def create_cloud_ip(options = {})
  wrapped_request("post", "/1.0/cloud_ips", [201], options)
end

#create_firewall_policy(options) ⇒ Hash?

Create a new firewall policy for the account.

Optionally applying to a server group at creation time.

Parameters:

Options Hash (options):

  • :server_group (String)
  • :name (String)

    Editable label

  • :description (String)

    Longer editable description

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



18
19
20
# File 'lib/fog/brightbox/requests/compute/create_firewall_policy.rb', line 18

def create_firewall_policy(options)
  wrapped_request("post", "/1.0/firewall_policies", [201], options)
end

#create_firewall_rule(options) ⇒ Hash?

Create a new firewall rule for a firewall policy.

Parameters:

Options Hash (options):

  • :firewall_policy (String)
  • :protocol (String)
  • :source (String)

    Required unless destination is set.

  • :source_port (String)
  • :destination (String)

    Required unless source is set

  • :destination_port (String)
  • :icmp_type_name (String)
  • :description (String)

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



21
22
23
# File 'lib/fog/brightbox/requests/compute/create_firewall_rule.rb', line 21

def create_firewall_rule(options)
  wrapped_request("post", "/1.0/firewall_rules", [202], options)
end

#create_image(options) ⇒ Hash?

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.

Parameters:

Options Hash (options):

  • :source (String)

    Filename of the image file uploaded to /incoming via FTP

  • :arch (String)

    OS architecture this image is built for

  • :name (String)

    Name for this image. If no name is specified, a name will be autogenerated based on the source filename &amp; current time. Can be modified later.

  • :username (String)

    Username for the image

  • :public (Boolean)
  • :compatibility_mode (Boolean)
  • :description (String)

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



22
23
24
# File 'lib/fog/brightbox/requests/compute/create_image.rb', line 22

def create_image(options)
  wrapped_request("post", "/1.0/images", [201], options)
end

#create_load_balancer(options) ⇒ Hash?

Create a new load balancer for the account.

Parameters:

Options Hash (options):

  • :name (String)

    Editable label

  • :nodes (Array)

    Array of Node parameters

  • :policy (String)

    Method of Load balancing to use

  • :listeners (Array)

    What port to listen on, port to pass through to and protocol (tcp, http or http+ws) of listener. Timeout is optional and specified in milliseconds (default is 50000).

  • :healthcheck (String)

    Healthcheck options - only “port” and “type” required

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



18
19
20
# File 'lib/fog/brightbox/requests/compute/create_load_balancer.rb', line 18

def create_load_balancer(options)
  wrapped_request("post", "/1.0/load_balancers", [202], options)
end

#create_server(options) ⇒ Hash?

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.

Parameters:

Options Hash (options):

  • :image (String)
  • :name (String)

    Editable label

  • :server_type (String)
  • :zone (String)

    Zone in which to create new Server

  • :user_data (String)
  • :server_groups (Array)

    Array of server groups to add server to

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



21
22
23
# File 'lib/fog/brightbox/requests/compute/create_server.rb', line 21

def create_server(options)
  wrapped_request("post", "/1.0/servers", [202], options)
end

#create_server_group(options) ⇒ Hash?

Create a new server group for the account.

Parameters:

Options Hash (options):

  • :name (String)

    Editable user label

  • :description (String)

    Editable user description

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
# File 'lib/fog/brightbox/requests/compute/create_server_group.rb', line 15

def create_server_group(options)
  wrapped_request("post", "/1.0/server_groups", [202], options)
end

#destroy_api_client(identifier) ⇒ Hash

Destroy the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_api_client.rb', line 13

def destroy_api_client(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/api_clients/#{identifier}", [200])
end

#destroy_application(identifier) ⇒ Hash

Destroy the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_application.rb', line 13

def destroy_application(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/applications/#{identifier}", [200])
end

#destroy_cloud_ip(identifier) ⇒ Hash

Release the cloud IP address from the account’s ownership.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb', line 13

def destroy_cloud_ip(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/cloud_ips/#{identifier}", [200])
end

#destroy_firewall_policy(identifier) ⇒ Hash

Destroy the firewall policy if not in use.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_firewall_policy.rb', line 13

def destroy_firewall_policy(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/firewall_policies/#{identifier}", [202])
end

#destroy_firewall_rule(identifier) ⇒ Hash

Destroy the firewall rule.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb', line 13

def destroy_firewall_rule(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/firewall_rules/#{identifier}", [202])
end

#destroy_image(identifier) ⇒ Hash

Destroy the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_image.rb', line 13

def destroy_image(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/images/#{identifier}", [202])
end

#destroy_load_balancer(identifier) ⇒ Hash

Destroy the LoadBalancer

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_load_balancer.rb', line 13

def destroy_load_balancer(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/load_balancers/#{identifier}", [202])
end

#destroy_server(identifier) ⇒ Hash

Destroy the server and free up the resources.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_server.rb', line 13

def destroy_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/servers/#{identifier}", [202])
end

#destroy_server_group(identifier) ⇒ Hash

Destroy the server group if not in use.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/destroy_server_group.rb', line 13

def destroy_server_group(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("delete", "/1.0/server_groups/#{identifier}", [202])
end

#get_account(identifier) ⇒ Hash #get_accountHash

Get full details of the account.

Overloads:

  • #get_account(identifier) ⇒ Hash

    Parameters:

    • identifier (String)

      Unique reference to identify the resource

  • #get_accountHash
    Deprecated.

    Use #get_scoped_account instead

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



17
18
19
20
21
22
23
24
# File 'lib/fog/brightbox/requests/compute/get_account.rb', line 17

def (identifier = nil)
  if identifier.nil? || identifier.empty?
    Fog::Logger.deprecation("get_account() without a parameter is deprecated, use get_scoped_account instead [light_black](#{caller.first})[/]")
    
  else
    wrapped_request("get", "/1.0/accounts/#{identifier}", [200])
  end
end

#get_api_client(identifier) ⇒ Hash

Get full details of the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_api_client.rb', line 13

def get_api_client(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/api_clients/#{identifier}", [200])
end

#get_application(identifier) ⇒ Hash

Get full details of the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_application.rb', line 13

def get_application(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/applications/#{identifier}", [200])
end

#get_authenticated_userHash

Requests details about authenticated user from the API

Returns:

  • (Hash)

    The JSON response parsed to a Hash



9
10
11
# File 'lib/fog/brightbox/requests/compute/get_authenticated_user.rb', line 9

def get_authenticated_user
  wrapped_request("get", "/1.0/user", [200])
end

#get_cloud_ip(identifier) ⇒ Hash

Get full details of the cloud IP address.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_cloud_ip.rb', line 13

def get_cloud_ip(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/cloud_ips/#{identifier}", [200])
end

#get_firewall_policy(identifier) ⇒ Hash

Get details of the firewall policy

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_firewall_policy.rb', line 13

def get_firewall_policy(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/firewall_policies/#{identifier}", [200])
end

#get_firewall_rule(identifier) ⇒ Hash

Get full details of the firewall rule.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_firewall_rule.rb', line 13

def get_firewall_rule(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/firewall_rules/#{identifier}", [200])
end

#get_image(identifier) ⇒ Hash

Get full details of the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_image.rb', line 13

def get_image(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/images/#{identifier}", [200])
end

#get_interface(identifier) ⇒ Hash

Get full details of the interface.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_interface.rb', line 13

def get_interface(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/interfaces/#{identifier}", [200])
end

#get_load_balancer(identifier) ⇒ Hash

Get full details of the load balancer.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_load_balancer.rb', line 13

def get_load_balancer(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/load_balancers/#{identifier}", [200])
end

#get_scoped_accountHash

Requests details about currently scoped account

Returns:

  • (Hash)

    The JSON response parsed to a Hash



8
9
10
# File 'lib/fog/brightbox/requests/compute/get_scoped_account.rb', line 8

def 
  wrapped_request("get", "/1.0/account", [200])
end

#get_server(identifier) ⇒ Hash

Get full details of the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_server.rb', line 13

def get_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/servers/#{identifier}", [200])
end

#get_server_group(identifier) ⇒ Hash

Get details of the server group.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_server_group.rb', line 13

def get_server_group(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/server_groups/#{identifier}", [200])
end

#get_server_type(identifier) ⇒ Hash

Get full details of the server type.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_server_type.rb', line 13

def get_server_type(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/server_types/#{identifier}", [200])
end

#get_user(identifier) ⇒ Hash #get_userHash

Get full details of the user.

Overloads:

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



17
18
19
20
21
22
23
24
# File 'lib/fog/brightbox/requests/compute/get_user.rb', line 17

def get_user(identifier = nil)
  if identifier.nil? || identifier == ""
    Fog::Logger.deprecation("get_user() without a parameter is deprecated, use get_authenticated_user instead [light_black](#{caller.first})[/]")
    get_authenticated_user
  else
    wrapped_request("get", "/1.0/users/#{identifier}", [200])
  end
end

#get_zone(identifier) ⇒ Hash

Get full details of the zone.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/get_zone.rb', line 13

def get_zone(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("get", "/1.0/zones/#{identifier}", [200])
end

#list_accountsHash

Returns The JSON response parsed to a Hash.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



10
11
12
# File 'lib/fog/brightbox/requests/compute/list_accounts.rb', line 10

def list_accounts
  wrapped_request("get", "/1.0/accounts", [200])
end

#list_api_clientsHash

Lists summary details of API clients owned by the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_api_clients.rb', line 12

def list_api_clients
  wrapped_request("get", "/1.0/api_clients", [200])
end

#list_applicationsHash

Lists summary details of applications available to the user

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_applications.rb', line 12

def list_applications
  wrapped_request("get", "/1.0/applications", [200])
end

#list_cloud_ipsHash

Lists summary details of cloud IP addresses owned by the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_cloud_ips.rb', line 12

def list_cloud_ips
  wrapped_request("get", "/1.0/cloud_ips", [200])
end

#list_firewall_policiesHash

Lists summary details of firewall policies

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_firewall_policies.rb', line 12

def list_firewall_policies
  wrapped_request("get", "/1.0/firewall_policies", [200])
end

#list_imagesHash

Lists summary details of images available for use by the Account. It includes those available to all customers

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_images.rb', line 12

def list_images
  wrapped_request("get", "/1.0/images", [200])
end

#list_load_balancersHash

Lists summary details of load balancers owned by the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_load_balancers.rb', line 12

def list_load_balancers
  wrapped_request("get", "/1.0/load_balancers", [200])
end

#list_server_groupsHash

Lists summary details of server groups owned by the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_server_groups.rb', line 12

def list_server_groups
  wrapped_request("get", "/1.0/server_groups", [200])
end

#list_server_typesHash

Lists summary details of server types available to the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_server_types.rb', line 12

def list_server_types
  wrapped_request("get", "/1.0/server_types", [200])
end

#list_serversHash

Lists summary details of servers owned by the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_servers.rb', line 12

def list_servers
  wrapped_request("get", "/1.0/servers", [200])
end

#list_usersHash

Lists summary details of user.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_users.rb', line 12

def list_users
  wrapped_request("get", "/1.0/users", [200])
end

#list_zonesHash

Lists summary details of zones available to the account.

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



12
13
14
# File 'lib/fog/brightbox/requests/compute/list_zones.rb', line 12

def list_zones
  wrapped_request("get", "/1.0/zones", [200])
end

#map_cloud_ip(identifier, options) ⇒ Hash?

Maps (or points) a cloud IP address at a server’s interface or a load balancer to allow them to respond to public requests.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :destination (String)

    The ID of an Interface or LoadBalancer to map the Cloud IP against

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/map_cloud_ip.rb', line 15

def map_cloud_ip(identifier, options)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/cloud_ips/#{identifier}/map", [202], options)
end

#move_servers_server_group(identifier, options) ⇒ Hash?

Removes a number of server from the server group and adds them to another server group given in parameters.

Examples:

Compute[:brightbox].remove_servers_server_group "grp-12345", :destination => "grp-67890", :servers => [{"server" => "srv-abcde"}, {"server" => "srv-fghij"}]

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing ‘=> server_id` for each server to remove

  • :destination (String)

    ServerGroup to move servers to

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



19
20
21
22
# File 'lib/fog/brightbox/requests/compute/move_servers_server_group.rb', line 19

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

#remove_firewall_policy(identifier, options) ⇒ Hash?

Removes firewall policy from given server group

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :server_group (String)

    Server Group to remove

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/remove_firewall_policy.rb', line 15

def remove_firewall_policy(identifier, options)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/firewall_policies/#{identifier}/remove", [202], options)
end

#remove_listeners_load_balancer(identifier, options) ⇒ Hash?

Removes a number of listeners from a load balancer to cease balancing across nodes for those settings.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :listeners (Array)

    Array of Listener parameters

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb', line 15

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_nodes_load_balancer(identifier, options) ⇒ Hash?

Remove a number of nodes from the load balancer

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nodes (Array)

    Array of Node parameters

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



15
16
17
18
# File 'lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb', line 15

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_servers_server_group(identifier, options) ⇒ Hash?

Remove a number of servers from the server group.

Examples:

Compute[:brightbox].remove_servers_server_group "grp-12345", :servers => [{"server" => "srv-abcde"}, {"server" => "srv-fghij"}]

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing => server_id for each server

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



18
19
20
21
# File 'lib/fog/brightbox/requests/compute/remove_servers_server_group.rb', line 18

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

#request(params) ⇒ Excon::Response #request(method, path, expected_responses, params = {}) ⇒ Hash

TODO:

Standard Fog behaviour is to return the Excon::Response but this was unintentionally changed to be the Hash version of the data in the body. This loses access to some details and should be corrected in a backwards compatible manner

Makes an API request to the given path using passed options or those set with the service setup

Overloads:

  • #request(params) ⇒ Excon::Response

    Parameters:

    • params (Hash)

      Excon compatible options

    Options Hash (params):

    • :body (String)

      text to be sent over a socket

    • :headers (Hash<Symbol, String>)

      The default headers to supply in a request

    • :host (String)

      The destination host’s reachable DNS name or IP, in the form of a String

    • :path (String)

      appears after ‘scheme://host:port/’

    • :port (Fixnum)

      The port on which to connect, to the destination host

    • :query (Hash)

      appended to the ‘scheme://host:port/path/’ in the form of ‘?key=value’

    • :scheme (String)

      The protocol; ‘https’ causes OpenSSL to be used

    Returns:

    • (Excon::Response)

    See Also:

  • #request(method, path, expected_responses, params = {}) ⇒ Hash
    Deprecated.

    #request with multiple arguments is deprecated since it is inconsistent with original fog version.

    Parameters:

    • method (String)

      HTTP method to use for the request

    • path (String)

      The absolute path for the request

    • expected_responses (Array<Fixnum>)

      HTTP response codes that have been successful

    • params (Hash) (defaults to: {})

      Keys and values for JSON

    Options Hash (params):

    • :account_id (String)

      The scoping account if required

    Returns:



398
399
400
401
402
403
404
405
# File 'lib/fog/brightbox/compute.rb', line 398

def request(*args)
  if args.size == 1
    authenticated_request(*args)
  else
    Fog::Logger.deprecation("#request with multiple parameters is deprecated, use #wrapped_request instead [light_black](#{caller.first})[/]")
    wrapped_request(*args)
  end
end

#reset_ftp_password_account(identifier) ⇒ Hash #reset_ftp_password_accountHash

Note:

The response is the only time the new password is available in plaintext.

Reset the image library ftp password for the account.

Overloads:

  • #reset_ftp_password_account(identifier) ⇒ Hash

    Parameters:

    • identifier (String)

      Unique reference to identify the resource

  • #reset_ftp_password_accountHash
    Deprecated.

    Use #get_scoped_account instead

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



20
21
22
23
24
25
26
27
# File 'lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb', line 20

def (identifier = nil)
  if identifier.nil? || identifier.empty?
    Fog::Logger.deprecation("reset_ftp_password_account() without a parameter is deprecated, use reset_ftp_password_scoped_account instead [light_black](#{caller.first})[/]")
    
  else
    wrapped_request("post", "/1.0/accounts/#{identifier}/reset_ftp_password", [200])
  end
end

#reset_ftp_password_scoped_accountHash

Note:

The response is the only time the new password is available in plaintext.

Resets the image library ftp password for the scoped account

Returns:

  • (Hash)

    The JSON response parsed to a Hash



11
12
13
# File 'lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb', line 11

def 
  wrapped_request("post", "/1.0/account/reset_ftp_password", [200])
end

#reset_secret_api_client(identifier) ⇒ Hash

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.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



18
19
20
21
# File 'lib/fog/brightbox/requests/compute/reset_secret_api_client.rb', line 18

def reset_secret_api_client(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/api_clients/#{identifier}/reset_secret", [200])
end

#reset_secret_application(identifier) ⇒ Hash

Resets the secret used by the application to a new generated value.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/reset_secret_application.rb', line 13

def reset_secret_application(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/applications/#{identifier}/reset_secret", [200])
end

#shutdown_server(identifier) ⇒ Hash

Will issue a safe shutdown request for the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/shutdown_server.rb', line 13

def shutdown_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/servers/#{identifier}/shutdown", [202])
end

#snapshot_server(identifier) ⇒ Hash

Will issue a request to snapshot the Server

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/snapshot_server.rb', line 13

def snapshot_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/servers/#{identifier}/snapshot", [202])
end

#start_server(identifier) ⇒ Hash

Will issue a start request for the server to become active.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/start_server.rb', line 13

def start_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/servers/#{identifier}/start", [202])
end

#stop_server(identifier) ⇒ Hash

Will issue a stop request for the server to become inactive.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/stop_server.rb', line 13

def stop_server(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/servers/#{identifier}/stop", [202])
end

#unmap_cloud_ip(identifier) ⇒ Hash

Unmaps a cloud IP address from its current destination making it available to remap. This remains in the account’s pool of addresses.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

Returns:

  • (Hash)

    The JSON response parsed to a Hash

See Also:



13
14
15
16
# File 'lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb', line 13

def unmap_cloud_ip(identifier)
  return nil if identifier.nil? || identifier == ""
  wrapped_request("post", "/1.0/cloud_ips/#{identifier}/unmap", [202])
end

#update_account(identifier, options) ⇒ Hash? #update_account(options) ⇒ Hash?

Update some details of the account.

Overloads:

  • #update_account(identifier, options) ⇒ Hash?

    Parameters:

    • identifier (String)

      Unique reference to identify the resource

    • options (Hash)

    Options Hash (options):

    • :name (String)

      Account name

    • :address_1 (String)

      First line of address

    • :address_2 (String)

      Second line of address

    • :city (String)

      City part of address

    • :county (String)

      County part of address

    • :postcode (String)

      Postcode or Zipcode

    • :country_code (String)

      ISO 3166-1 two letter code (example: ‘GB`)

    • :vat_registration_number (String)

      Must be a valid EU VAT number or ‘nil`

    • :telephone_number (String)

      Valid International telephone number in E.164 format prefixed with ‘+`

  • #update_account(options) ⇒ Hash?
    Deprecated.

    Parameters:

    Options Hash (options):

    • :name (String)

      Account name

    • :address_1 (String)

      First line of address

    • :address_2 (String)

      Second line of address

    • :city (String)

      City part of address

    • :county (String)

      County part of address

    • :postcode (String)

      Postcode or Zipcode

    • :country_code (String)

      ISO 3166-1 two letter code (example: ‘GB`)

    • :vat_registration_number (String)

      Must be a valid EU VAT number or ‘nil`

    • :telephone_number (String)

      Valid International telephone number in E.164 format prefixed with ‘+`

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fog/brightbox/requests/compute/update_account.rb', line 38

def (*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?
  if identifier.nil? || identifier.empty?
    Fog::Logger.deprecation("update_account() without a parameter is deprecated, use update_scoped_account instead [light_black](#{caller.first})[/]")
    (options)
  else
    wrapped_request("put", "/1.0/accounts/#{identifier}", [200], options)
  end
end

#update_api_client(identifier, options) ⇒ Hash?

Update some details of the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



16
17
18
19
20
# File 'lib/fog/brightbox/requests/compute/update_api_client.rb', line 16

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_application(identifier, options) ⇒ Hash?

Update some details of the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



16
17
18
19
20
# File 'lib/fog/brightbox/requests/compute/update_application.rb', line 16

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_cloud_ip(identifier, options) ⇒ Hash?

Update some details of the cloud IP address.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :reverse_dns (String)

    Reverse DNS hostname

  • :name (String)

    Name for Cloud IP

  • :port_translators (Array)

    Port on which external clients connect and port on which your service is listening.

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



17
18
19
20
21
# File 'lib/fog/brightbox/requests/compute/update_cloud_ip.rb', line 17

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

#update_firewall_policy(identifier, options) ⇒ Hash?

Updates details of the firewall policy

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable label

  • :description (String)

    Longer editable description

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



16
17
18
19
20
# File 'lib/fog/brightbox/requests/compute/update_firewall_policy.rb', line 16

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_firewall_rule(identifier, options) ⇒ Hash?

Update some settings of the firewall rule.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :protocol (String)
  • :source (String)

    Required unless destination is set.

  • :source_port (String)
  • :destination (String)

    Required unless source is set

  • :destination_port (String)
  • :icmp_type_name (String)
  • :description (String)

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



21
22
23
24
25
# File 'lib/fog/brightbox/requests/compute/update_firewall_rule.rb', line 21

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_image(identifier, options) ⇒ Hash?

Update some details of the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



21
22
23
24
25
# File 'lib/fog/brightbox/requests/compute/update_image.rb', line 21

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_load_balancer(identifier, options) ⇒ Hash?

Update some details of the load balancer.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable label

  • :nodes (Array)

    Array of Node parameters

  • :policy (String)

    Method of Load balancing to use

  • :listeners (Array)

    What port to listen on, port to pass through to and protocol (tcp, http or http+ws) of listener. Timeout is optional and specified in milliseconds (default is 50000).

  • :healthcheck (String)

    Healthcheck options - only “port” and “type” required

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



19
20
21
22
23
# File 'lib/fog/brightbox/requests/compute/update_load_balancer.rb', line 19

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

#update_scoped_account(options) ⇒ Hash?

Requests an update to the currently scoped account

Parameters:

Options Hash (options):

  • :name (String)

    Account name

  • :address_1 (String)

    First line of address

  • :address_2 (String)

    Second line of address

  • :city (String)

    City part of address

  • :county (String)

    County part of address

  • :postcode (String)

    Postcode or Zipcode

  • :country_code (String)

    ISO 3166-1 two letter code (example: ‘GB`)

  • :vat_registration_number (String)

    Must be a valid EU VAT number or ‘nil`

  • :telephone_number (String)

    Valid International telephone number in E.164 format prefixed with ‘+`

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



22
23
24
25
# File 'lib/fog/brightbox/requests/compute/update_scoped_account.rb', line 22

def (options)
  return nil if options.empty? || options.nil?
  wrapped_request("put", "/1.0/account", [200], options)
end

#update_server(identifier, options) ⇒ Hash?

Update some details of the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable label

  • :user_data (String)

    User defined metadata

  • :compatibility_mode (Boolean)

    Server needs to be shutdown and restarted for changes to this to take effect

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



17
18
19
20
21
# File 'lib/fog/brightbox/requests/compute/update_server.rb', line 17

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_server_group(identifier, options) ⇒ Hash?

Update some details of the server group.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable user label

  • :description (String)

    Editable user description

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



16
17
18
19
20
# File 'lib/fog/brightbox/requests/compute/update_server_group.rb', line 16

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_user(identifier, options) ⇒ Hash?

Update some details of your user profile.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :email_address (String)
  • :ssh_key (String)
  • :password (String)

    A password string that conforms to the minimum requirements

  • :password_confirmation (String)

    A password string that conforms to the minimum requirements

Returns:

  • (Hash, nil)

    The JSON response parsed to a Hash or nil if no options passed

See Also:



19
20
21
22
23
# File 'lib/fog/brightbox/requests/compute/update_user.rb', line 19

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

#wrapped_request(method, path, expected_responses, parameters = {}) ⇒ Hash

Note:

#wrapped_request is the non-standard form of request introduced by mistake

Makes a request but with seperated arguments and parses the response to a hash

Parameters:

  • method (String)

    HTTP method to use for the request

  • path (String)

    The absolute path for the request

  • expected_responses (Array<Fixnum>)

    HTTP response codes that have been successful

  • parameters (Hash) (defaults to: {})

    Keys and values for JSON

Options Hash (parameters):

  • :account_id (String)

    The scoping account if required

Returns:



418
419
420
# File 'lib/fog/brightbox/compute.rb', line 418

def wrapped_request(method, path, expected_responses, parameters = {})
  _wrapped_request(method, path, expected_responses, parameters)
end