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

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Real

Returns a new instance of Real.



118
119
120
121
122
123
124
125
126
127
128
# File 'lib/fog/brightbox/compute.rb', line 118

def initialize(options)
  require 'multi_json'
  # Currently authentication and api endpoints are the same but may change
  @auth_url             = options[:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL
  @api_url              = options[:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL
  @connection_options   = options[:connection_options] || {}
  @brightbox_client_id  = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
  @brightbox_secret     = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
  @persistent           = options[:persistent] || false
  @connection = Fog::Connection.new(@api_url, @persistent, @connection_options)
end

Instance Method Details

#accountObject



140
141
142
# File 'lib/fog/brightbox/compute.rb', line 140

def 
  Fog::Compute::Brightbox::Account.new()
end

#activate_console_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/activate_console_server.rb', line 6

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

#add_listeners_load_balancer(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/add_listeners_load_balancer.rb', line 6

def add_listeners_load_balancer(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/load_balancers/#{identifier}/add_listeners", [202], options)
end

#add_nodes_load_balancer(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/add_nodes_load_balancer.rb', line 6

def add_nodes_load_balancer(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/load_balancers/#{identifier}/add_nodes", [202], options)
end

#add_servers_server_group(identifier, options) ⇒ Object

Add a number of servers to a server group

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

Parameters:

  • identifier (String) - The identifier of the server group to add to

  • options

    • servers (Array) - An Array of Hashes containing => server_id for each server to add

    [=> “srv-abcde”, => “srv-fghij”]

Returns:

A Ruby hash of the server response



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

def add_servers_server_group(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/server_groups/#{identifier}/add_servers", [202], options)
end

#apply_to_firewall_policy(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/apply_to_firewall_policy.rb', line 6

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

#create_api_client(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_api_client.rb', line 6

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

#create_cloud_ipObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_cloud_ip.rb', line 6

def create_cloud_ip
  request("post", "/1.0/cloud_ips", [201])
end

#create_firewall_policy(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_firewall_policy.rb', line 6

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

#create_firewall_rule(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_firewall_rule.rb', line 6

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

#create_image(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_image.rb', line 6

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

#create_load_balancer(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_load_balancer.rb', line 6

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

#create_server(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_server.rb', line 6

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

#create_server_group(options) ⇒ Object



6
7
8
# File 'lib/fog/brightbox/requests/compute/create_server_group.rb', line 6

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

#destroy_api_client(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_api_client.rb', line 6

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

#destroy_cloud_ip(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_cloud_ip.rb', line 6

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

#destroy_firewall_policy(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_firewall_policy.rb', line 6

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

#destroy_firewall_rule(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb', line 6

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

#destroy_image(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_image.rb', line 6

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

#destroy_load_balancer(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_load_balancer.rb', line 6

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

#destroy_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_server.rb', line 6

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

#destroy_server_group(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/destroy_server_group.rb', line 6

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

#get_accountObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/get_account.rb', line 6

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

#get_api_client(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_api_client.rb', line 6

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

#get_cloud_ip(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_cloud_ip.rb', line 6

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

#get_firewall_policy(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_firewall_policy.rb', line 6

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

#get_firewall_rule(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_firewall_rule.rb', line 6

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

#get_image(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_image.rb', line 6

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

#get_interface(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_interface.rb', line 6

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

#get_load_balancer(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_load_balancer.rb', line 6

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

#get_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_server.rb', line 6

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

#get_server_group(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_server_group.rb', line 6

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

#get_server_type(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_server_type.rb', line 6

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

#get_user(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_user.rb', line 6

def get_user(identifier)
  return nil if identifier.nil? || identifier == ""
  request("get", "/1.0/users/#{identifier}", [200])
end

#get_zone(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/get_zone.rb', line 6

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

#list_api_clientsObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_api_clients.rb', line 6

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

#list_cloud_ipsObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_cloud_ips.rb', line 6

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

#list_firewall_policiesObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_firewall_policies.rb', line 6

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

#list_imagesObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_images.rb', line 6

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

#list_load_balancersObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_load_balancers.rb', line 6

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

#list_server_groupsObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_server_groups.rb', line 6

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

#list_server_typesObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_server_types.rb', line 6

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

#list_serversObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_servers.rb', line 6

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

#list_usersObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_users.rb', line 6

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

#list_zonesObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/list_zones.rb', line 6

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

#map_cloud_ip(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/map_cloud_ip.rb', line 6

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

#move_servers_server_group(identifier, options) ⇒ Object

Moves a number of servers between two server groups

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

Parameters:

  • identifier - The identifier (String) of the server group to remove from

  • options (Hash)

    • destination (String)- The identifier of the server group to move to

    • servers (Array) - Array of Hashes containing => server_id for each server to remove

    [=> “srv-abcde”, => “srv-fghij”]

Returns:

A Ruby hash of the server response



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

def move_servers_server_group(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/server_groups/#{identifier}/move_servers", [202], options)
end

#remove_firewall_policy(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/remove_firewall_policy.rb', line 6

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

#remove_listeners_load_balancer(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/remove_listeners_load_balancer.rb', line 6

def remove_listeners_load_balancer(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/load_balancers/#{identifier}/remove_listeners", [202], options)
end

#remove_nodes_load_balancer(identifier, options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/remove_nodes_load_balancer.rb', line 6

def remove_nodes_load_balancer(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/load_balancers/#{identifier}/remove_nodes", [202], options)
end

#remove_servers_server_group(identifier, options) ⇒ Object

Remove a number of servers from a server group

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

Parameters:

  • identifier (String) - The identifier of the server group to remove from

  • options (Array) - An Array of Hashes containing => server_id for each server to remove

    [=> “srv-abcde”, => “srv-fghij”]

Returns:

A Ruby hash of the server response



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

def remove_servers_server_group(identifier, options)
  return nil if identifier.nil? || identifier == ""
  request("post", "/1.0/server_groups/#{identifier}/remove_servers", [202], options)
end

#request(method, url, expected_responses, options = nil) ⇒ Object



130
131
132
133
134
135
136
137
138
# File 'lib/fog/brightbox/compute.rb', line 130

def request(method, url, expected_responses, options = nil)
  request_options = {
    :method   => method.to_s.upcase,
    :path     => url,
    :expects  => expected_responses
  }
  request_options[:body] = MultiJson.encode(options) unless options.nil?
  make_request(request_options)
end

#reset_ftp_password_accountObject



6
7
8
# File 'lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb', line 6

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

#reset_secret_api_client(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/reset_secret_api_client.rb', line 6

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

#resize_server(identifier, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/fog/brightbox/requests/compute/resize_server.rb', line 6

def resize_server(identifier, options = {})
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/servers/#{identifier}/resize",
    :headers  => {"Content-Type" => "application/json"},
    :body     => MultiJson.encode(options)
  )
end

#shutdown_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/shutdown_server.rb', line 6

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

#snapshot_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/snapshot_server.rb', line 6

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

#start_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/start_server.rb', line 6

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

#stop_server(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/stop_server.rb', line 6

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

#unmap_cloud_ip(identifier) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/unmap_cloud_ip.rb', line 6

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

#update_account(options) ⇒ Object



6
7
8
9
# File 'lib/fog/brightbox/requests/compute/update_account.rb', line 6

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

#update_api_client(identifier, options) ⇒ Object



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

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

#update_cloud_ip(identifier, options) ⇒ Object



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

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

#update_image(identifier, options) ⇒ Object



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

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

#update_load_balancer(identifier, options) ⇒ Object



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

def update_load_balancer(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  request("put", "/1.0/load_balancers/#{identifier}", [202], options)
end

#update_server(identifier, options) ⇒ Object



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

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

#update_server_group(identifier, options) ⇒ Object



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

def update_server_group(identifier, options)
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  request("put", "/1.0/server_groups/#{identifier}", [202], options)
end

#update_user(identifier, options) ⇒ Object



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

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