Class: Fog::Brightbox::Compute::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/get_volume.rb,
lib/fog/brightbox/requests/compute/list_users.rb,
lib/fog/brightbox/requests/compute/list_zones.rb,
lib/fog/brightbox/requests/compute/copy_volume.rb,
lib/fog/brightbox/requests/compute/get_account.rb,
lib/fog/brightbox/requests/compute/list_events.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/delete_image.rb,
lib/fog/brightbox/requests/compute/get_cloud_ip.rb,
lib/fog/brightbox/requests/compute/list_servers.rb,
lib/fog/brightbox/requests/compute/list_volumes.rb,
lib/fog/brightbox/requests/compute/map_cloud_ip.rb,
lib/fog/brightbox/requests/compute/reset_server.rb,
lib/fog/brightbox/requests/compute/start_server.rb,
lib/fog/brightbox/requests/compute/update_image.rb,
lib/fog/brightbox/requests/compute/attach_volume.rb,
lib/fog/brightbox/requests/compute/create_server.rb,
lib/fog/brightbox/requests/compute/create_volume.rb,
lib/fog/brightbox/requests/compute/delete_server.rb,
lib/fog/brightbox/requests/compute/delete_volume.rb,
lib/fog/brightbox/requests/compute/detach_volume.rb,
lib/fog/brightbox/requests/compute/get_interface.rb,
lib/fog/brightbox/requests/compute/list_accounts.rb,
lib/fog/brightbox/requests/compute/reboot_server.rb,
lib/fog/brightbox/requests/compute/resize_volume.rb,
lib/fog/brightbox/requests/compute/update_server.rb,
lib/fog/brightbox/requests/compute/update_volume.rb,
lib/fog/brightbox/requests/compute/get_api_client.rb,
lib/fog/brightbox/requests/compute/get_config_map.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/delete_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/get_server_group.rb,
lib/fog/brightbox/requests/compute/list_api_clients.rb,
lib/fog/brightbox/requests/compute/list_config_maps.rb,
lib/fog/brightbox/requests/compute/create_api_client.rb,
lib/fog/brightbox/requests/compute/create_config_map.rb,
lib/fog/brightbox/requests/compute/delete_api_client.rb,
lib/fog/brightbox/requests/compute/delete_config_map.rb,
lib/fog/brightbox/requests/compute/get_collaboration.rb,
lib/fog/brightbox/requests/compute/get_database_type.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/update_config_map.rb,
lib/fog/brightbox/requests/compute/create_application.rb,
lib/fog/brightbox/requests/compute/delete_application.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/delete_server_group.rb,
lib/fog/brightbox/requests/compute/get_database_server.rb,
lib/fog/brightbox/requests/compute/get_firewall_policy.rb,
lib/fog/brightbox/requests/compute/list_collaborations.rb,
lib/fog/brightbox/requests/compute/list_database_types.rb,
lib/fog/brightbox/requests/compute/list_load_balancers.rb,
lib/fog/brightbox/requests/compute/lock_resource_image.rb,
lib/fog/brightbox/requests/compute/update_server_group.rb,
lib/fog/brightbox/requests/compute/create_collaboration.rb,
lib/fog/brightbox/requests/compute/create_firewall_rule.rb,
lib/fog/brightbox/requests/compute/create_load_balancer.rb,
lib/fog/brightbox/requests/compute/delete_collaboration.rb,
lib/fog/brightbox/requests/compute/delete_firewall_rule.rb,
lib/fog/brightbox/requests/compute/delete_load_balancer.rb,
lib/fog/brightbox/requests/compute/lock_resource_server.rb,
lib/fog/brightbox/requests/compute/lock_resource_volume.rb,
lib/fog/brightbox/requests/compute/resend_collaboration.rb,
lib/fog/brightbox/requests/compute/update_firewall_rule.rb,
lib/fog/brightbox/requests/compute/update_load_balancer.rb,
lib/fog/brightbox/requests/compute/get_database_snapshot.rb,
lib/fog/brightbox/requests/compute/list_database_servers.rb,
lib/fog/brightbox/requests/compute/reset_database_server.rb,
lib/fog/brightbox/requests/compute/unlock_resource_image.rb,
lib/fog/brightbox/requests/compute/update_scoped_account.rb,
lib/fog/brightbox/requests/compute/create_database_server.rb,
lib/fog/brightbox/requests/compute/create_firewall_policy.rb,
lib/fog/brightbox/requests/compute/delete_database_server.rb,
lib/fog/brightbox/requests/compute/delete_firewall_policy.rb,
lib/fog/brightbox/requests/compute/get_authenticated_user.rb,
lib/fog/brightbox/requests/compute/get_user_collaboration.rb,
lib/fog/brightbox/requests/compute/list_firewall_policies.rb,
lib/fog/brightbox/requests/compute/remove_firewall_policy.rb,
lib/fog/brightbox/requests/compute/resize_database_server.rb,
lib/fog/brightbox/requests/compute/unlock_resource_server.rb,
lib/fog/brightbox/requests/compute/unlock_resource_volume.rb,
lib/fog/brightbox/requests/compute/update_database_server.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/list_database_snapshots.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/delete_database_snapshot.rb,
lib/fog/brightbox/requests/compute/list_user_collaborations.rb,
lib/fog/brightbox/requests/compute/reset_secret_application.rb,
lib/fog/brightbox/requests/compute/snapshot_database_server.rb,
lib/fog/brightbox/requests/compute/update_database_snapshot.rb,
lib/fog/brightbox/requests/compute/accept_user_collaboration.rb,
lib/fog/brightbox/requests/compute/delete_user_collaboration.rb,
lib/fog/brightbox/requests/compute/move_servers_server_group.rb,
lib/fog/brightbox/requests/compute/reject_user_collaboration.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/lock_resource_load_balancer.rb,
lib/fog/brightbox/requests/compute/remove_servers_server_group.rb,
lib/fog/brightbox/requests/compute/lock_resource_database_server.rb,
lib/fog/brightbox/requests/compute/unlock_resource_load_balancer.rb,
lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb,
lib/fog/brightbox/requests/compute/reset_password_database_server.rb,
lib/fog/brightbox/requests/compute/lock_resource_database_snapshot.rb,
lib/fog/brightbox/requests/compute/unlock_resource_database_server.rb,
lib/fog/brightbox/requests/compute/reset_ftp_password_scoped_account.rb,
lib/fog/brightbox/requests/compute/unlock_resource_database_snapshot.rb

Overview

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

Constant Summary

Constants included from Shared

Shared::API_URL

Constants included from OAuth2

OAuth2::TWO_FACTOR_HEADER

Instance Attribute Summary

Attributes included from Shared

#scoped_account

Instance Method Summary collapse

Methods included from Shared

#access_token, #access_token_available?, #account, #authenticating_as_user?, #credentials, #default_image, #expires_in, #get_access_token, #get_access_token!, #initialize, #refresh_token, #scoped_account_reset, #two_factor?

Methods included from OAuth2

#request_access_token

Instance Method Details

#accept_user_collaboration(identifier, options = {}) ⇒ Hash

Accepts the collaboration giving access to the account

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#activate_console_server(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#add_listeners_load_balancer(identifier, options) ⇒ Hash, NilClass

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.

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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_nodes_load_balancer(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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_servers_server_group(identifier, options) ⇒ Hash, NilClass

Add a number of servers to the server group.

Examples:

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing {“server” => server_id} for each server to add

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



27
28
29
30
# 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

#apply_to_firewall_policy(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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

#attach_volume(identifier, options) ⇒ Hash, NilClass

Attach a detached server to a nominated server

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :server (String)

    The identifier of the server

  • :boot (Boolean)

    Set true to attach as boot volume. Only when server is stopped

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

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

#copy_volume(identifier, options) ⇒ Hash, NilClass

Copy a volume and create a new one

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :delete_with_server (Boolean)

    Set true the volume will be removed if attached to a server that is deleted

  • :description (String)
  • :name (String)
  • :serial (String)

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

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

#create_api_client(options) ⇒ Hash, NilClass

Create a new API client for the account.

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
# 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_application(options) ⇒ Hash, NilClass

Create a new application for the user.

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



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

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

#create_cloud_ip(options = {}) ⇒ Hash, NilClass

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.

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



18
19
20
# 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

#create_collaboration(options) ⇒ Hash, NilClass

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.

Parameters:

  • options (Hash)

Options Hash (options):

  • :email (String)

    Email address of user to invite

  • :role (String)

    Role to grant to the user. Currently only ‘admin`

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



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

def create_collaboration(options)
  wrapped_request("post", "/1.0/collaborations", [201], options)
end

#create_config_map(options) ⇒ Hash, NilClass

Create a new config map

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)

    to identify this config map

  • :data (Hash)

    key/values to expose in config map

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

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

#create_database_server(options) ⇒ Hash, NilClass

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :engine (String)

    Database engine to request

  • :version (String)

    Database version to request

  • :allow_access (Array)

  • :maintenance_weekday (String)

    Numerical index of weekday (0 is Sunday, 1 is Monday…) to set when automatic updates may be performed

  • :maintenance_hour (String)

    Number representing 24hr time start of maintenance window hour for x:00-x:59 (0-23)

  • :snapshots_schedule (String)

    Crontab pattern for scheduled snapshots. Must be at least hourly

  • :snapshot (String)
  • :zone (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



23
24
25
# 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_firewall_policy(options) ⇒ Hash, NilClass

Create a new firewall policy for the account.

Optionally applying to a server group at creation time.

Parameters:

  • options (Hash)

Options Hash (options):

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

    Editable label

  • :description (String)

    Longer editable description

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



20
21
22
# 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_firewall_rule(options) ⇒ Hash, NilClass

Create a new firewall rule for a firewall policy.

Parameters:

  • options (Hash)

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)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



23
24
25
# 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_image(options) ⇒ Hash, NilClass

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 Hash (options):

  • :source (String)

    Filename of the image uploaded to /images within Orbit. Can consist of letters, numbers or ‘-_+.~^’

  • :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)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



24
25
26
# 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_load_balancer(options) ⇒ Hash, NilClass

Create a new load balancer for the account.

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable label

  • :nodes (Array)

    Array of Node parameters

  • :policy (String)

    Method of Load balancing to use

  • :certificate_pem (String)

    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

  • :certificate_key (String)

    The RSA private key used to sign the certificate in PEM format. Must be included along with ‘certificate_pem’

  • :sslv3 (Boolean)

    Allow SSL v3 to be used (default: false)

  • :listeners (Array)

    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).

  • :healthcheck (String)

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

  • :buffer_size (String)

    Buffer size in bytes

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



24
25
26
# 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_server(options) ⇒ Hash, NilClass

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 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

  • :cloud_ip (String)

    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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



24
25
26
# 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_server_group(options) ⇒ Hash, NilClass

Create a new server group for the account.

Parameters:

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable user label

  • :description (String)

    Editable user description

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
# 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

#create_volume(options) ⇒ Hash, NilClass

Create a new volume

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :delete_with_server (Boolean)

    Set true the volume will be removed if attached to a server that is deleted

  • :description (String)
  • :name (String)
  • :serial (String)

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

def create_volume(options)
  return nil if options.empty? || options.nil?
  wrapped_request("post", "/1.0/volumes", [202], options)
end

#delete_api_client(identifier, options = {}) ⇒ Hash

Destroy the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_application(identifier, options = {}) ⇒ Hash

Destroy the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_cloud_ip(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_collaboration(identifier, options = {}) ⇒ Hash

Cancels or completes the collaboration

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_config_map(identifier, options = {}) ⇒ Hash

Destroy the config map

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

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

#delete_database_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#delete_database_snapshot(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#delete_firewall_policy(identifier, options = {}) ⇒ Hash

Destroy the firewall policy if not in use.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_firewall_rule(identifier, options = {}) ⇒ Hash

Destroy the firewall rule.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_image(identifier, options = {}) ⇒ Hash

Destroy the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_load_balancer(identifier, options = {}) ⇒ Hash

Destroy the LoadBalancer

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_server(identifier, options = {}) ⇒ Hash

Destroy the server and free up the resources.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_server_group(identifier, options = {}) ⇒ Hash

Destroy the server group if not in use.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_user_collaboration(identifier, options = {}) ⇒ Hash

Ends an existing ‘accepted’ collaboration

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#delete_volume(identifier, options = {}) ⇒ Hash

Destroy the volume and free up the resources.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

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

#detach_volume(identifier, options = {}) ⇒ Hash, NilClass

Detach the volume from its server

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

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

#get_account(identifier = nil, options = {}) ⇒ Hash

Get full details of the account.

Parameters:

  • identifier (String) (defaults to: nil)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def (identifier = nil, options = {})
  wrapped_request("get", "/1.0/accounts/#{identifier}", [200], options)
end

#get_api_client(identifier, options = {}) ⇒ Hash

Get full details of the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_application(identifier, options = {}) ⇒ Hash

Get full details of the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#get_authenticated_user(options = {}) ⇒ Hash

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(options = {})
  wrapped_request("get", "/1.0/user", [200], options)
end

#get_cloud_ip(identifier, options = {}) ⇒ Hash

Get full details of the cloud IP address.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#get_collaboration(identifier, options = {}) ⇒ Hash

Shows details of the collaboration

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#get_config_map(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

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

#get_database_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#get_database_snapshot(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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_database_type(identifier, options = {}) ⇒ Hash

Get details of the database server type.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_firewall_policy(identifier, options = {}) ⇒ Hash

Get details of the firewall policy

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_firewall_rule(identifier, options = {}) ⇒ Hash

Get full details of the firewall rule.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_image(identifier, options = {}) ⇒ Hash

Get full details of the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_interface(identifier, options = {}) ⇒ Hash

Get full details of the interface.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_load_balancer(identifier, options = {}) ⇒ Hash

Get full details of the load balancer.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#get_scoped_account(options = {}) ⇒ Hash

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 (options = {})
  wrapped_request("get", "/1.0/account", [200], options)
end

#get_server(identifier, options = {}) ⇒ Hash

Get full details of the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_server_group(identifier, options = {}) ⇒ Hash

Get details of the server group.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_server_type(identifier, options = {}) ⇒ Hash

Get full details of the server type.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_user(identifier, options = {}) ⇒ Hash

Get full details of the user.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
# 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

#get_user_collaboration(identifier, options = {}) ⇒ Hash

Shows details of the specified collaboration

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_volume(identifier, options = {}) ⇒ Hash

Get full details of the volume.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

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

#get_zone(identifier, options = {}) ⇒ Hash

Get full details of the zone.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#list_accounts(options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_accounts(options = {})
  options[:nested] = "false" unless options.key?(:nested)
  wrapped_request("get", "/1.0/accounts", [200], options)
end

#list_api_clients(options = {}) ⇒ Hash

Lists summary details of API clients owned by the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_applications(options = {}) ⇒ Hash

Lists summary details of applications available to the user

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_applications(options = {})
  wrapped_request("get", "/1.0/applications", [200], options)
end

#list_cloud_ips(options = {}) ⇒ Hash

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

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_collaborations(options = {}) ⇒ Hash

Lists all the collaborations for the given account

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_collaborations(options = {})
  wrapped_request("get", "/1.0/collaborations", [200], options)
end

#list_config_maps(options = {}) ⇒ Hash

Lists summary details of config maps owned by the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

def list_config_maps(options = {})
  wrapped_request("get", "/1.0/config_maps", [200], options)
end

#list_database_servers(options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



12
13
14
# 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

#list_database_snapshots(options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



12
13
14
# 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_types(options = {}) ⇒ Hash

List database server types.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_events(options = {}) ⇒ Hash, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Lists events related to the account.

Parameters:

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

Options Hash (options):

  • :limit (String)

    Limit of pagination

  • :offset (String)

    Offset of pagination

  • :resource_id (String)

    Filter events for given resource_id

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



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

def list_events(options = {})
  wrapped_request("get", "/1.0/events", [200], options)
end

#list_firewall_policies(options = {}) ⇒ Hash

Lists summary details of firewall policies

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_images(options = {}) ⇒ Hash

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

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_images(options = {})
  wrapped_request("get", "/1.0/images", [200], options)
end

#list_load_balancers(options = {}) ⇒ Hash

Lists summary details of load balancers owned by the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_server_groups(options = {}) ⇒ Hash

Lists summary details of server groups owned by the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_server_types(options = {}) ⇒ Hash

Lists summary details of server types available to the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_servers(options = {}) ⇒ Hash

Lists summary details of servers owned by the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_servers(options = {})
  wrapped_request("get", "/1.0/servers", [200], options)
end

#list_user_collaborations(options = {}) ⇒ Hash

Lists all collaborations the user is involved with

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



14
15
16
# 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

#list_users(options = {}) ⇒ Hash

Lists summary details of user.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_users(options = {})
  wrapped_request("get", "/1.0/users", [200], options)
end

#list_volumes(options = {}) ⇒ Hash

Lists summary details of volumes available for use by the Account

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

def list_volumes(options = {})
  wrapped_request("get", "/1.0/volumes", [200], options)
end

#list_zones(options = {}) ⇒ Hash

Lists summary details of zones available to the account.

Parameters:

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def list_zones(options = {})
  wrapped_request("get", "/1.0/zones", [200], options)
end

#lock_resource_database_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#lock_resource_database_snapshot(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#lock_resource_image(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#lock_resource_load_balancer(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#lock_resource_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#lock_resource_volume(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

def lock_resource_volume(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  wrapped_request("put", "/1.0/volumes/#{identifier}/lock_resource", [200], options)
end

#map_cloud_ip(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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

#move_servers_server_group(identifier, options) ⇒ Hash, NilClass

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

Examples:

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing {“server” => server_id} for each server to remove

  • :destination (String)

    ServerGroup to move servers to

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



29
30
31
32
# 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

#reboot_server(identifier, options = {}) ⇒ Hash

Issues a ‘soft’ reboot to the server however the OS may ignore it. The console remains connected.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#reject_user_collaboration(identifier, options = {}) ⇒ Hash

Rejects the collaboration

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#remove_firewall_policy(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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

#remove_listeners_load_balancer(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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_nodes_load_balancer(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



17
18
19
20
# 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_servers_server_group(identifier, options) ⇒ Hash, NilClass

Remove a number of servers from the server group.

Examples:

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :servers (Array<Hash>)

    Array of Hashes containing {“server” => server_id} for each server

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



27
28
29
30
# 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

#request(*args) ⇒ Excon::Response

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

Parameters:

  • params (Hash)

    Excon compatible options

Returns:

  • (Excon::Response)

See Also:



256
257
258
# File 'lib/fog/brightbox/compute.rb', line 256

def request(*args)
  authenticated_request(*args)
end

#resend_collaboration(identifier, options = {}) ⇒ Hash

Resends the invitation email to the collaborator

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_database_server(identifier, options = {}) ⇒ Hash, NilClass

Reset a database server restarting the DBMS.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

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

#reset_ftp_password_account(identifier = nil, options = {}) ⇒ Hash

Note:

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

Reset the image library ftp password for the account.

Parameters:

  • identifier (String) (defaults to: nil)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



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

def (identifier = nil, options = {})
  wrapped_request("post", "/1.0/accounts/#{identifier}/reset_ftp_password", [200], options)
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_password_database_server(identifier, options = {}) ⇒ Hash

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.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#reset_secret_api_client(identifier, options = {}) ⇒ 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

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



19
20
21
22
# 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

#reset_secret_application(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#reset_server(identifier, options = {}) ⇒ Hash

Issues a ‘hard’ reboot request to the server which can not be ignored by the OS. The console remains connected.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#resize_database_server(identifier, options) ⇒ Hash, NilClass

Resize a database server, increasing resources available to the DBMS.

A ‘reset` may be required for the DBMS to pick up changes.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :new_type (String)

    New Database type to use

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

def resize_database_server(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  wrapped_request("post", "/1.0/database_servers/#{identifier}/resize", [202], options)
end

#resize_volume(identifier, options) ⇒ Hash, NilClass

Resize a volume, currently limited to expanding volumes.

Partitions will need to be expanded within the OS.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :from (Integer)

    The original size (in MiB) to act as a preflight check to prevent duplicate requests

  • :to (Integer)

    The new size in MiB to change the volume to

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

def resize_volume(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  wrapped_request("post", "/1.0/volumes/#{identifier}/resize", [202], options)
end

#shutdown_server(identifier, options = {}) ⇒ Hash

Will issue a safe shutdown request for the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#snapshot_database_server(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :return_link (Boolean)

    Return the Link header as a second return value

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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

#snapshot_server(identifier, options = {}) ⇒ Hash

Will issue a request to snapshot the Server

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :return_link (Boolean)

    Return the Link header as a second return value

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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

#start_server(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#stop_server(identifier, options = {}) ⇒ Hash

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

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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

#unlock_resource_database_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#unlock_resource_database_snapshot(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#unlock_resource_image(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#unlock_resource_load_balancer(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#unlock_resource_server(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



13
14
15
16
# 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

#unlock_resource_volume(identifier, options = {}) ⇒ Hash

Returns if successful Hash version of JSON object.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object



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

def unlock_resource_volume(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  wrapped_request("put", "/1.0/volumes/#{identifier}/unlock_resource", [200], options)
end

#unmap_cloud_ip(identifier, options = {}) ⇒ 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

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

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

See Also:



15
16
17
18
# 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_account(*args) ⇒ Hash, NilClass

Update some details of the account.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/brightbox/requests/compute/update_account.rb', line 25

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?
  wrapped_request("put", "/1.0/accounts/#{identifier}", [200], options)
end

#update_api_client(identifier, options) ⇒ Hash, NilClass

Update some details of the API client.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :permissions_group (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



19
20
21
22
23
# 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_application(identifier, options) ⇒ Hash, NilClass

Update some details of the application.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



18
19
20
21
22
# 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_cloud_ip(identifier, options) ⇒ Hash, NilClass

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.

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



19
20
21
22
23
# 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

#update_config_map(identifier, options) ⇒ Hash, NilClass

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    to identifier this config map

  • :data (Hash)

    key/values to expose in config map

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

def update_config_map(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  wrapped_request("put", "/1.0/config_maps/#{identifier}", [200], options)
end

#update_database_server(identifier, options) ⇒ Hash, NilClass

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :description (String)
  • :allow_access (Array)

  • :maintenance_weekday (String)

    Numerical index of weekday (0 is Sunday, 1 is Monday…) to set when automatic updates may be performed

  • :maintenance_hour (String)

    Number representing 24hr time start of maintenance window hour for x:00-x:59 (0-23)

  • :snapshots_schedule (String)

    Crontab pattern for scheduled snapshots. Must be at least hourly

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



20
21
22
23
24
# 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_database_snapshot(identifier, options) ⇒ Hash, NilClass

Update some details of the server.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)

    Editable label

  • :description (String)

    Editable label

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



18
19
20
21
22
# 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

#update_firewall_policy(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



18
19
20
21
22
# 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_firewall_rule(identifier, options) ⇒ Hash, NilClass

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)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



23
24
25
26
27
# 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_image(identifier, options) ⇒ Hash, NilClass

Update some details of the image.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :name (String)
  • :username (String)
  • :arch (String)
  • :status (String)
  • :public (Boolean)
  • :compatibility_mode (Boolean)
  • :description (String)
  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



23
24
25
26
27
# 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_load_balancer(identifier, options) ⇒ Hash, NilClass

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

  • :certificate_pem (String)

    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

  • :certificate_key (String)

    The RSA private key used to sign the certificate in PEM format. Must be included along with ‘certificate_pem’

  • :sslv3 (Boolean)

    Allow SSL v3 to be used (default: false)

  • :listeners (Array)

    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).

  • :healthcheck (String)

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

  • :buffer_size (String)

    Buffer size in bytes

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



25
26
27
28
29
# 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

#update_scoped_account(options) ⇒ Hash, NilClass

Requests an update to the currently scoped account

Parameters:

  • 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 ‘+`

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



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

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

#update_server(identifier, options) ⇒ Hash, NilClass

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

  • :server_groups (Array)

    Array of server groups to update server to being a member of. This replaces any existing groups

  • :compatibility_mode (Boolean)

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



20
21
22
23
24
# 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_server_group(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



18
19
20
21
22
# 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_user(identifier, options) ⇒ Hash, NilClass

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

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed

See Also:



21
22
23
24
25
# 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

#update_volume(identifier, options) ⇒ Hash, NilClass

Update some volume attributes.

Parameters:

  • identifier (String)

    Unique reference to identify the resource

  • options (Hash)

Options Hash (options):

  • :nested (Boolean)

    passed through with the API request. When true nested resources are expanded.

  • :delete_with_server (Boolean)

    Set true the volume will be removed if attached to a server that is deleted

  • :description (String)
  • :name (String)
  • :serial (String)

Returns:

  • (Hash)

    if successful Hash version of JSON object

  • (NilClass)

    if no options were passed



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

def update_volume(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  wrapped_request("put", "/1.0/volumes/#{identifier}", [202], 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:

  • (Hash)


271
272
273
# File 'lib/fog/brightbox/compute.rb', line 271

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