[bluebox|blb] clean up, define types returned

This commit is contained in:
Josh Yotty 2013-02-18 11:54:47 -08:00
parent 129945dcb5
commit 16eba31509
6 changed files with 64 additions and 28 deletions

View File

@ -6,12 +6,17 @@ module Fog
# Get details of a lb_application.
#
# ==== Parameters
# * lb_application_id<~Integer> - Id of block to lookup
# * lb_application_id<~Integer> - ID of application
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# TODO
# * 'id'<~String> - UUID of application
# * 'ip_v4'<~Array> - IPv4 addresses
# * 'ip_v6'<~String> - IPv6 address
# * 'name'<~String> - The hostname
# * 'lb_services'<~Array> - Listening services
# * 'source_ip_v4'<~String> - address that application connects to pool members from (v1 only)
def get_lb_application(lb_application_id)
request(
:expects => 200,
@ -19,11 +24,11 @@ module Fog
:path => "api/lb_applications/#{lb_application_id}.json"
)
end
end
class Mock
end
end
end
end

View File

@ -2,17 +2,18 @@ module Fog
module Bluebox
class BLB
class Real
# Get list of blocks
# Get list of applications
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * 'ip-v4'<~Array> - Ip addresses
# * 'ip-v6'<~String> - IP v6 address
# * 'name'<~String> - The hostname
# * 'source-ip-v4'<~String> - Where traffic comes from
# * 'services'<~Array> - Listening services
# * 'application'<~Hash>:
# * 'id'<~String> - UUID of application
# * 'ip_v4'<~Array> - IPv4 addresses
# * 'ip_v6'<~String> - IPv6 address
# * 'name'<~String> - The hostname
# * 'lb_services'<~Array> - Listening services
# * 'source_ip_v4'<~String> - address that application connects to pool members from (v1 only)
def get_lb_applications
request(
:expects => 200,
@ -20,10 +21,11 @@ module Fog
:path => 'api/lb_applications.json'
)
end
end
class Mock
end
end
end
end

View File

@ -3,16 +3,23 @@ module Fog
class BLB
class Real
# Get details of a lb_backend.
# Get details of an lb_backend.
#
# ==== Parameters
# * lb_service_id - service backend belongs to
# * lb_backend_id<~Integer> - backend to look up
# * lb_service_id<~String> - service backend belongs to
# * lb_backend_id<~String> - backend to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# TODO
# * id<~String> - backend ID
# * backend_name<~String>
# * lb_machines<~Array> - array of backend members
# * acl_name<~String> - name of ACL for this backend
# * acl_rule<~String>
# * monitoring_url_hostname<~String> - HTTP host header for health check
# * monitoring_url<~String> - URL for health check
# * check_interval<~Integer> - time between checks, in milliseconds
def get_lb_backend(lb_service_id, lb_backend_id)
request(
:expects => 200,
@ -20,11 +27,11 @@ module Fog
:path => "api/lb_services/#{lb_service_id}/lb_backends/#{lb_backend_id}.json"
)
end
end
class Mock
end
end
end
end

View File

@ -6,16 +6,20 @@ module Fog
# Get list of backends
#
# ==== Parameters
# * lb_service_id - service containing backends
# * lb_service_id<~String> - service containing backends
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * 'ip-v4'<~Array> - Ip addresses
# * 'ip-v6'<~String> - IP v6 address
# * 'name'<~String> - The hostname
# * 'source-ip-v4'<~String> - Where traffic comes from
# * 'services'<~Array> - Listening services
# * backend<~Hash>:
# * id<~String> - backend ID
# * backend_name<~String>
# * lb_machines<~Array> - array of backend members
# * acl_name<~String> - name of ACL for this backend
# * acl_rule<~String>
# * monitoring_url_hostname<~String> - HTTP host header for health check
# * monitoring_url<~String> - URL for health check
# * check_interval<~Integer> - time between checks, in milliseconds
def get_lb_backends(lb_service_id)
request(
:expects => 200,
@ -23,10 +27,11 @@ module Fog
:path => "api/lb_services/#{lb_service_id}/lb_backends.json"
)
end
end
class Mock
end
end
end
end

View File

@ -6,13 +6,20 @@ module Fog
# Get details of a lb_service.
#
# ==== Parameters
# * lb_application_id<~String> - Id of application the service is in
# * lb_service_id<~String> - Id of service to lookup
# * lb_application_id<~String> - ID of application the service belongs to
# * lb_service_id<~String> - ID of service to look up
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# TODO
# * name<~String> - service name
# * port<~Integer> - port of load balanced service
# * private<~Boolean> - whether service is only available internally
# * status_username<~String> - HTTP basic auth username
# * status_password<~String> - HTTP basic auth password
# * status_url<~String> - URL of stats page
# * service_type<~String> - proto being load balanced (e.g. 'http', 'tcp')
# * created<~DateTime> - when service was created
def get_lb_service(lb_application_id, lb_service_id)
request(
:expects => 200,
@ -20,11 +27,11 @@ module Fog
:path => "api/lb_applications/#{lb_application_id}/lb_services/#{lb_service_id}.json"
)
end
end
class Mock
end
end
end
end

View File

@ -11,6 +11,15 @@ module Fog
# ==== Returns
# * response<~Excon::Response>:
# * body<~Array>:
# * backend<~Hash>:
# * name<~String> - service name
# * port<~Integer> - port of load balanced service
# * private<~Boolean> - whether service is only available internally
# * status_username<~String> - HTTP basic auth username
# * status_password<~String> - HTTP basic auth password
# * status_url<~String> - URL of stats page
# * service_type<~String> - proto being load balanced (e.g. 'http', 'tcp')
# * created<~DateTime> - when service was created
def get_lb_services(lb_application_id)
request(
:expects => 200,
@ -18,10 +27,11 @@ module Fog
:path => "api/lb_applications/#{lb_application_id}/lb_services.json"
)
end
end
class Mock
end
end
end
end