1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

- Updated "@host" variable to "noc.newservers.com" which is the current host for API calls

- Added two calls: add_server_by_configuration.rb and list_configurations.rb
-- These calls should be used instead of add_server and list_plans, although we still support them.
- General comments were updated.
This commit is contained in:
Diego Desani 2012-08-24 00:17:43 -04:00
parent fa9dcdc2c5
commit 49150c30d2
7 changed files with 93 additions and 26 deletions

View file

@ -12,11 +12,13 @@ module Fog
request_path 'fog/bare_metal_cloud/requests/compute'
request :add_server
request :add_server_by_configuration
request :cancel_server
request :get_server
request :list_images
request :list_plans
request :list_servers
request :list_configurations
request :reboot_server
class Mock
@ -53,7 +55,7 @@ module Fog
@bare_metal_cloud_password = options[:bare_metal_cloud_password]
@bare_metal_cloud_username = options[:bare_metal_cloud_username]
@connection_options = options[:connection_options] || {}
@host = options[:host] || "noc.baremetalcloud.com"
@host = options[:host] || "noc.newservers.com"
@persistent = options[:persistent] || false
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'

View file

@ -0,0 +1,33 @@
module Fog
module Compute
class BareMetalCloud
class Real
# Boot a new server by configuration
#
# ==== Parameters
# * config<~String> - The Hardware configuration string
# * options<~Hash>: optional extra arguments
# * imageName<~String> - Optional imageName to be installed
# * name<~String> - Optional server Name
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'server'<~Hash>:
# * 'id'<~String> - Id of the image
#
def add_server_by_configuration(config, options = {})
request(
:expects => 200,
:method => 'GET',
:parser => Fog::ToHashDocument.new,
:path => 'api/addServerByConfiguration',
:query => {'configuration' => config}.merge!(options)
)
end
end
end
end
end

View file

@ -5,20 +5,25 @@ module Fog
# List servers
#
# ==== Parameters
# * serverId<~String> - Id of the server
#
# ==== Returns
# * response<~Excon::Response>:
# * server<~Hash>:
# * 'id'<~String> - Id of the server
# * 'ip'<~Hash>:
# * 'address'<~String> - Address of the ip
# * 'name'<~String> - Name of the ip
# * 'login'<~Hash>:
# * 'name'<~String> - Name of the login
# * 'password'<~String> - Password of the login
# * 'username'<~String> - Username of the login
# * 'name'<~String> - Name of the server
# * 'notes'<~String> - Notes about the server
# * 'state'<~String> - State of the server
# * body<~Has>:
# * server<~Hash>:
# * 'id'<~String> - Id of the server
# * 'mac-address'<~String> - mac-address of the server
# * 'ip'<~Hash>:
# * 'address'<~String> - Address of the ip
# * 'name'<~String> - Name of the ip
# * 'login'<~Hash>:
# * 'name'<~String> - Name of the login
# * 'password'<~String> - Password of the login
# * 'username'<~String> - Username of the login
# * 'name'<~String> - Name of the server
# * 'notes'<~String> - Notes about the server
# * 'state'<~String> - State of the server
#
def get_server(server_id)
request(

View file

@ -0,0 +1,27 @@
module Fog
module Compute
class BareMetalCloud
class Real
# List Configurations
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * available-server<~Array>:
# * 'configuration'<~String> - Hardware Configuration string
# * 'quantity'<~String>: - quantity of servers to a certain configuration
#
def list_configurations
request(
:expects => 200,
:method => 'GET',
:parser => Fog::ToHashDocument.new,
:path => 'api/listConfigurations'
)
end
end
end
end
end

View file

@ -7,10 +7,10 @@ module Fog
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * 'id'<~String> - Id of the image
# * 'name'<~String> - Name of the image
# * 'size'<~String> - Size of the image
# * body<~Hash>:
# * 'image'<~Array>
# * 'Size'<~String> - Size of the image
# * 'Name'<~String> - Name of the image
#
def list_images
request(

View file

@ -7,13 +7,13 @@ module Fog
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * 'description'<~String> - Description of the plan
# * 'id'<~String> - Id of the plan
# * 'name'<~String> - Name of the plan
# * 'rate'<~String> - Cost per hour of the plan
# * 'os'<~String> - Operating system of the plan
# * 'config'<~String> - Configuration of the plan
# * body<~Hash>:
# * 'plan'<~Array>
# * 'id'<~String> - Id of the plan
# * 'name'<~String> - Name of the plan
# * 'rate'<~String> - Cost per hour of the plan
# * 'os'<~String> - Operating system of the plan
# * 'config'<~String> - Configuration of the plan
#
def list_plans
request(

View file

@ -7,8 +7,8 @@ module Fog
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * server<~Hash>:
# * body<~Hash>:
# * server<~Array>:
# * 'id'<~String> - Id of the server
# * 'ip'<~Hash>:
# * 'address'<~String> - Address of the ip