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

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/compute/brightbox.rb,
lib/fog/compute/requests/brightbox/get_user.rb,
lib/fog/compute/requests/brightbox/get_zone.rb,
lib/fog/compute/requests/brightbox/get_image.rb,
lib/fog/compute/requests/brightbox/get_server.rb,
lib/fog/compute/requests/brightbox/list_users.rb,
lib/fog/compute/requests/brightbox/list_zones.rb,
lib/fog/compute/requests/brightbox/get_account.rb,
lib/fog/compute/requests/brightbox/list_images.rb,
lib/fog/compute/requests/brightbox/stop_server.rb,
lib/fog/compute/requests/brightbox/update_user.rb,
lib/fog/compute/requests/brightbox/create_image.rb,
lib/fog/compute/requests/brightbox/get_cloud_ip.rb,
lib/fog/compute/requests/brightbox/list_servers.rb,
lib/fog/compute/requests/brightbox/map_cloud_ip.rb,
lib/fog/compute/requests/brightbox/start_server.rb,
lib/fog/compute/requests/brightbox/update_image.rb,
lib/fog/compute/requests/brightbox/create_server.rb,
lib/fog/compute/requests/brightbox/destroy_image.rb,
lib/fog/compute/requests/brightbox/get_interface.rb,
lib/fog/compute/requests/brightbox/resize_server.rb,
lib/fog/compute/requests/brightbox/update_server.rb,
lib/fog/compute/requests/brightbox/destroy_server.rb,
lib/fog/compute/requests/brightbox/get_api_client.rb,
lib/fog/compute/requests/brightbox/list_cloud_ips.rb,
lib/fog/compute/requests/brightbox/unmap_cloud_ip.rb,
lib/fog/compute/requests/brightbox/update_account.rb,
lib/fog/compute/requests/brightbox/create_cloud_ip.rb,
lib/fog/compute/requests/brightbox/get_server_type.rb,
lib/fog/compute/requests/brightbox/shutdown_server.rb,
lib/fog/compute/requests/brightbox/snapshot_server.rb,
lib/fog/compute/requests/brightbox/destroy_cloud_ip.rb,
lib/fog/compute/requests/brightbox/list_api_clients.rb,
lib/fog/compute/requests/brightbox/create_api_client.rb,
lib/fog/compute/requests/brightbox/get_load_balancer.rb,
lib/fog/compute/requests/brightbox/list_server_types.rb,
lib/fog/compute/requests/brightbox/update_api_client.rb,
lib/fog/compute/requests/brightbox/destroy_api_client.rb,
lib/fog/compute/requests/brightbox/list_load_balancers.rb,
lib/fog/compute/requests/brightbox/create_load_balancer.rb,
lib/fog/compute/requests/brightbox/update_load_balancer.rb,
lib/fog/compute/requests/brightbox/destroy_load_balancer.rb,
lib/fog/compute/requests/brightbox/add_nodes_load_balancer.rb,
lib/fog/compute/requests/brightbox/remove_nodes_load_balancer.rb,
lib/fog/compute/requests/brightbox/reset_ftp_password_account.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Real

Returns a new instance of Real.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/fog/compute/brightbox.rb', line 95

def initialize(options)
  unless options.delete(:provider)
    location = caller.first
    warning = "[yellow][WARN] Fog::Brightbox::Compute.new is deprecated, use Fog::Compute.new(:provider => 'Brightbox') instead[/]"
    warning << " [light_black](" << location << ")[/] "
    Formatador.display_line(warning)
  end

  require "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
  @brightbox_client_id = options[:brightbox_client_id] || Fog.credentials[:brightbox_client_id]
  @brightbox_secret = options[:brightbox_secret] || Fog.credentials[:brightbox_secret]
  @connection = Fog::Connection.new(@api_url)
end

Instance Method Details

#accountObject



125
126
127
# File 'lib/fog/compute/brightbox.rb', line 125

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

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



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

def add_nodes_load_balancer(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/load_balancers/#{identifier}/add_nodes",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#create_api_client(options = {}) ⇒ Object



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

def create_api_client(options = {})
  request(
    :expects  => [201],
    :method   => 'POST',
    :path     => "/1.0/api_clients",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#create_cloud_ip(options = {}) ⇒ Object



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

def create_cloud_ip(options = {})
  request(
    :expects  => [201],
    :method   => 'POST',
    :path     => "/1.0/cloud_ips",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#create_image(options = {}) ⇒ Object



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

def create_image(options = {})
  request(
    :expects  => [201],
    :method   => 'POST',
    :path     => "/1.0/images",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#create_load_balancer(options = {}) ⇒ Object



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

def create_load_balancer(options = {})
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/load_balancers",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#create_server(options = {}) ⇒ Object



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

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

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



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

def destroy_api_client(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'DELETE',
    :path     => "/1.0/api_clients/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def destroy_cloud_ip(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'DELETE',
    :path     => "/1.0/cloud_ips/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def destroy_image(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'DELETE',
    :path     => "/1.0/images/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def destroy_load_balancer(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'DELETE',
    :path     => "/1.0/load_balancers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def destroy_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'DELETE',
    :path     => "/1.0/servers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#get_account(options = {}) ⇒ Object



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

def (options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/account",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_api_client(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/api_clients/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_cloud_ip(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/cloud_ips/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_image(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/images/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_interface(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/interfaces/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_load_balancer(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/load_balancers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/servers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_server_type(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/server_types/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_user(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/users/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def get_zone(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/zones/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_api_clients(options = {}) ⇒ Object



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

def list_api_clients(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/api_clients",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_cloud_ips(options = {}) ⇒ Object



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

def list_cloud_ips(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/cloud_ips",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_images(options = {}) ⇒ Object



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

def list_images(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/images",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_load_balancers(options = {}) ⇒ Object



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

def list_load_balancers(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/load_balancers",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_server_types(options = {}) ⇒ Object



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

def list_server_types(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/server_types",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_servers(options = {}) ⇒ Object



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

def list_servers(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/servers",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_users(options = {}) ⇒ Object



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

def list_users(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/users",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#list_zones(options = {}) ⇒ Object



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

def list_zones(options = {})
  request(
    :expects  => [200],
    :method   => 'GET',
    :path     => "/1.0/zones",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def map_cloud_ip(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/cloud_ips/#{identifier}/map",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def remove_nodes_load_balancer(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/load_balancers/#{identifier}/remove_nodes",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#request(params) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/fog/compute/brightbox.rb', line 112

def request(params)
  begin
    get_oauth_token if @oauth_token.nil?
    response = authenticated_request(params)
  rescue Excon::Errors::Unauthorized => e
    get_oauth_token
    response = authenticated_request(params)
  end
  unless response.body.empty?
    response = JSON.parse(response.body)
  end
end

#reset_ftp_password_account(options = {}) ⇒ Object



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

def (options = {})
  request(
    :expects  => [200],
    :method   => 'POST',
    :path     => "/1.0/account/reset_ftp_password",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



6
7
8
9
10
11
12
13
14
# File 'lib/fog/compute/requests/brightbox/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     => options.to_json
  )
end

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



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

def shutdown_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/servers/#{identifier}/shutdown",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def snapshot_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/servers/#{identifier}/snapshot",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def start_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/servers/#{identifier}/start",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def stop_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/servers/#{identifier}/stop",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def unmap_cloud_ip(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  request(
    :expects  => [202],
    :method   => 'POST',
    :path     => "/1.0/cloud_ips/#{identifier}/unmap",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

#update_account(options = {}) ⇒ Object



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

def (options = {})
  return nil if options.empty? || options.nil?
  request(
    :expects  => [200],
    :method   => 'PUT',
    :path     => "/1.0/account",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fog/compute/requests/brightbox/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(
    :expects  => [200],
    :method   => 'PUT',
    :path     => "/1.0/api_clients/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def update_image(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  request(
    :expects  => [200],
    :method   => 'PUT',
    :path     => "/1.0/images/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fog/compute/requests/brightbox/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(
    :expects  => [202],
    :method   => 'PUT',
    :path     => "/1.0/load_balancers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def update_server(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  request(
    :expects  => [200],
    :method   => 'PUT',
    :path     => "/1.0/servers/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end

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



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

def update_user(identifier, options = {})
  return nil if identifier.nil? || identifier == ""
  return nil if options.empty? || options.nil?
  request(
    :expects  => [200],
    :method   => 'PUT',
    :path     => "/1.0/users/#{identifier}",
    :headers  => {"Content-Type" => "application/json"},
    :body     => options.to_json
  )
end