Class: Fog::Compute::Brightbox::Real
- Inherits:
-
Object
- Object
- Fog::Compute::Brightbox::Real
- Includes:
- Shared
- Defined in:
- lib/fog/brightbox/compute.rb,
lib/fog/brightbox/requests/compute/get_user.rb,
lib/fog/brightbox/requests/compute/get_zone.rb,
lib/fog/brightbox/requests/compute/get_image.rb,
lib/fog/brightbox/requests/compute/get_server.rb,
lib/fog/brightbox/requests/compute/list_users.rb,
lib/fog/brightbox/requests/compute/list_zones.rb,
lib/fog/brightbox/requests/compute/get_account.rb,
lib/fog/brightbox/requests/compute/list_images.rb,
lib/fog/brightbox/requests/compute/stop_server.rb,
lib/fog/brightbox/requests/compute/update_user.rb,
lib/fog/brightbox/requests/compute/create_image.rb,
lib/fog/brightbox/requests/compute/get_cloud_ip.rb,
lib/fog/brightbox/requests/compute/list_servers.rb,
lib/fog/brightbox/requests/compute/map_cloud_ip.rb,
lib/fog/brightbox/requests/compute/start_server.rb,
lib/fog/brightbox/requests/compute/update_image.rb,
lib/fog/brightbox/requests/compute/create_server.rb,
lib/fog/brightbox/requests/compute/destroy_image.rb,
lib/fog/brightbox/requests/compute/get_interface.rb,
lib/fog/brightbox/requests/compute/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_firewall_rule.rb,
lib/fog/brightbox/requests/compute/update_load_balancer.rb,
lib/fog/brightbox/requests/compute/destroy_firewall_rule.rb,
lib/fog/brightbox/requests/compute/destroy_load_balancer.rb,
lib/fog/brightbox/requests/compute/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
- #account ⇒ Object
- #activate_console_server(identifier) ⇒ Object
- #add_listeners_load_balancer(identifier, options) ⇒ Object
- #add_nodes_load_balancer(identifier, options) ⇒ Object
-
#add_servers_server_group(identifier, options) ⇒ Object
Add a number of servers to a server group.
- #apply_to_firewall_policy(identifier, options) ⇒ Object
- #create_api_client(options) ⇒ Object
- #create_cloud_ip(options = nil) ⇒ Object
- #create_firewall_policy(options) ⇒ Object
- #create_firewall_rule(options) ⇒ Object
- #create_image(options) ⇒ Object
- #create_load_balancer(options) ⇒ Object
- #create_server(options) ⇒ Object
- #create_server_group(options) ⇒ Object
- #destroy_api_client(identifier) ⇒ Object
- #destroy_cloud_ip(identifier) ⇒ Object
- #destroy_firewall_policy(identifier) ⇒ Object
- #destroy_firewall_rule(identifier) ⇒ Object
- #destroy_image(identifier) ⇒ Object
- #destroy_load_balancer(identifier) ⇒ Object
- #destroy_server(identifier) ⇒ Object
- #destroy_server_group(identifier) ⇒ Object
- #get_account ⇒ Object
- #get_api_client(identifier) ⇒ Object
- #get_cloud_ip(identifier) ⇒ Object
- #get_firewall_policy(identifier) ⇒ Object
- #get_firewall_rule(identifier) ⇒ Object
- #get_image(identifier) ⇒ Object
- #get_interface(identifier) ⇒ Object
- #get_load_balancer(identifier) ⇒ Object
- #get_server(identifier) ⇒ Object
- #get_server_group(identifier) ⇒ Object
- #get_server_type(identifier) ⇒ Object
- #get_user(identifier) ⇒ Object
- #get_zone(identifier) ⇒ Object
-
#initialize(options) ⇒ Real
constructor
A new instance of Real.
- #list_api_clients ⇒ Object
- #list_cloud_ips ⇒ Object
- #list_firewall_policies ⇒ Object
- #list_images ⇒ Object
- #list_load_balancers ⇒ Object
- #list_server_groups ⇒ Object
- #list_server_types ⇒ Object
- #list_servers ⇒ Object
- #list_users ⇒ Object
- #list_zones ⇒ Object
- #map_cloud_ip(identifier, options) ⇒ Object
-
#move_servers_server_group(identifier, options) ⇒ Object
Moves a number of servers between two server groups.
- #remove_firewall_policy(identifier, options) ⇒ Object
- #remove_listeners_load_balancer(identifier, options) ⇒ Object
- #remove_nodes_load_balancer(identifier, options) ⇒ Object
-
#remove_servers_server_group(identifier, options) ⇒ Object
Remove a number of servers from a server group.
- #request(method, url, expected_responses, options = nil) ⇒ Object
- #reset_ftp_password_account ⇒ Object
- #reset_secret_api_client(identifier) ⇒ Object
- #shutdown_server(identifier) ⇒ Object
- #snapshot_server(identifier) ⇒ Object
- #start_server(identifier) ⇒ Object
- #stop_server(identifier) ⇒ Object
- #unmap_cloud_ip(identifier) ⇒ Object
- #update_account(options) ⇒ Object
- #update_api_client(identifier, options) ⇒ Object
- #update_cloud_ip(identifier, options) ⇒ Object
- #update_firewall_rule(id, options) ⇒ Object
- #update_image(identifier, options) ⇒ Object
- #update_load_balancer(identifier, options) ⇒ Object
- #update_server(identifier, options) ⇒ Object
- #update_server_group(identifier, options) ⇒ Object
- #update_user(identifier, options) ⇒ Object
Methods included from Shared
Constructor Details
#initialize(options) ⇒ Real
Returns a new instance of Real.
141 142 143 144 145 146 147 148 149 150 |
# File 'lib/fog/brightbox/compute.rb', line 141 def initialize() # Currently authentication and api endpoints are the same but may change @auth_url = [:brightbox_auth_url] || Fog.credentials[:brightbox_auth_url] || API_URL @api_url = [:brightbox_api_url] || Fog.credentials[:brightbox_api_url] || API_URL @connection_options = [:connection_options] || {} @brightbox_client_id = [:brightbox_client_id] || Fog.credentials[:brightbox_client_id] @brightbox_secret = [:brightbox_secret] || Fog.credentials[:brightbox_secret] @persistent = [:persistent] || false @connection = Fog::Connection.new(@api_url, @persistent, @connection_options) end |
Instance Method Details
#account ⇒ Object
162 163 164 |
# File 'lib/fog/brightbox/compute.rb', line 162 def account Fog::Compute::Brightbox::Account.new(get_account) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/load_balancers/#{identifier}/add_listeners", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/load_balancers/#{identifier}/add_nodes", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/server_groups/#{identifier}/add_servers", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/firewall_policies/#{identifier}/apply_to", [202], ) 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() request("post", "/1.0/api_clients", [201], ) end |
#create_cloud_ip(options = nil) ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/create_cloud_ip.rb', line 6 def create_cloud_ip( = nil) 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() request("post", "/1.0/firewall_policies", [201], ) 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() request("post", "/1.0/firewall_rules", [202], ) end |
#create_image(options) ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/create_image.rb', line 6 def create_image() request("post", "/1.0/images", [201], ) 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() request("post", "/1.0/load_balancers", [202], ) end |
#create_server(options) ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/create_server.rb', line 6 def create_server() request("post", "/1.0/servers", [202], ) 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() request("post", "/1.0/server_groups", [202], ) 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_account ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/get_account.rb', line 6 def get_account 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_clients ⇒ Object
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_ips ⇒ Object
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_policies ⇒ Object
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_images ⇒ Object
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_balancers ⇒ Object
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_groups ⇒ Object
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_types ⇒ Object
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_servers ⇒ Object
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_users ⇒ Object
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_zones ⇒ Object
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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/cloud_ips/#{identifier}/map", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/server_groups/#{identifier}/move_servers", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/firewall_policies/#{identifier}/remove", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/load_balancers/#{identifier}/remove_listeners", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/load_balancers/#{identifier}/remove_nodes", [202], ) 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, ) return nil if identifier.nil? || identifier == "" request("post", "/1.0/server_groups/#{identifier}/remove_servers", [202], ) end |
#request(method, url, expected_responses, options = nil) ⇒ Object
152 153 154 155 156 157 158 159 160 |
# File 'lib/fog/brightbox/compute.rb', line 152 def request(method, url, expected_responses, = nil) = { :method => method.to_s.upcase, :path => url, :expects => expected_responses } [:body] = Fog::JSON.encode() unless .nil? make_request() end |
#reset_ftp_password_account ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/reset_ftp_password_account.rb', line 6 def reset_ftp_password_account 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 |
#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 update_account() return nil if .empty? || .nil? request("put", "/1.0/account", [200], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/api_clients/#{identifier}", [200], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/cloud_ips/#{identifier}", [200], ) end |
#update_firewall_rule(id, options) ⇒ Object
6 7 8 |
# File 'lib/fog/brightbox/requests/compute/update_firewall_rule.rb', line 6 def update_firewall_rule(id, ) request("put", "/1.0/firewall_rules/#{id}", [202], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/images/#{identifier}", [200], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/load_balancers/#{identifier}", [202], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/servers/#{identifier}", [200], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/server_groups/#{identifier}", [202], ) 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, ) return nil if identifier.nil? || identifier == "" return nil if .empty? || .nil? request("put", "/1.0/users/#{identifier}", [200], ) end |