mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[bbg] cleanup up request docs
This commit is contained in:
parent
ea4468e73d
commit
b6dd99aaa5
7 changed files with 23 additions and 71 deletions
|
@ -1,10 +1,3 @@
|
|||
# Response formet:
|
||||
# <hash>
|
||||
# <cost type="decimal">0.15</cost>
|
||||
# <id>94fd37a7-2606-47f7-84d5-9000deda52ae</id>
|
||||
# <description>Block 1GB Virtual Server</description>
|
||||
# </hash>
|
||||
|
||||
module Fog
|
||||
module Parsers
|
||||
module Bluebox
|
||||
|
@ -17,11 +10,9 @@ module Fog
|
|||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'hash'
|
||||
# Do nothing
|
||||
when 'cost'
|
||||
@response[name] = @value.to_f
|
||||
else
|
||||
when 'description', 'id'
|
||||
@response[name] = @value
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ module Fog
|
|||
@product = {}
|
||||
when 'cost'
|
||||
@product[name] = @value.to_f
|
||||
else
|
||||
when 'description', 'id'
|
||||
@product[name] = @value
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,26 +4,18 @@ module Fog
|
|||
|
||||
require 'fog/bluebox/parsers/create_block'
|
||||
|
||||
# Get list of slices
|
||||
# Create a new block
|
||||
#
|
||||
# ==== Parameters
|
||||
# * flavor_id<~Integer> - Id of flavor to create slice with
|
||||
# * image_id<~Integer> - Id of image to create slice with
|
||||
# * name<~String> - Name of slice
|
||||
# * flavor_id<~Integer> - Id of flavor to create block with
|
||||
# * image_id<~Integer> - Id of template to create block with
|
||||
# * name<~String> - Name of block
|
||||
# * password<~String> - Password for block
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# * 'addresses'<~Array> - Ip addresses for the slice
|
||||
# * 'backup-id'<~Integer> - Id of backup slice was booted from
|
||||
# * 'bw-in'<~Integer> - Incoming bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'bw-out'<~Integer> - Outgoing bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'flavor-id'<~Integer> - Id of flavor slice was booted from
|
||||
# * 'id'<~Integer> - Id of the slice
|
||||
# * 'image-id'<~Integer> - Id of image slice was booted from
|
||||
# * 'name'<~String> - Name of the slice
|
||||
# * 'progress'<~Integer> - Progress of current action, in percentage
|
||||
# * 'root-password'<~String> - Root password of slice
|
||||
# * 'status'<~String> - Current status of the slice
|
||||
# * body<~Hash>:
|
||||
# TODO
|
||||
def create_block(flavor_id, image_id, name, password)
|
||||
data =
|
||||
<<-DATA
|
||||
|
|
|
@ -2,26 +2,15 @@ module Fog
|
|||
module Bluebox
|
||||
class Real
|
||||
|
||||
# Get list of slices
|
||||
# Destroy a block
|
||||
#
|
||||
# ==== Parameters
|
||||
# * flavor_id<~Integer> - Id of flavor to create slice with
|
||||
# * image_id<~Integer> - Id of image to create slice with
|
||||
# * name<~String> - Name of slice
|
||||
# * block_id<~Integer> - Id of block to destroy
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# * 'addresses'<~Array> - Ip addresses for the slice
|
||||
# * 'backup-id'<~Integer> - Id of backup slice was booted from
|
||||
# * 'bw-in'<~Integer> - Incoming bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'bw-out'<~Integer> - Outgoing bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'flavor-id'<~Integer> - Id of flavor slice was booted from
|
||||
# * 'id'<~Integer> - Id of the slice
|
||||
# * 'image-id'<~Integer> - Id of image slice was booted from
|
||||
# * 'name'<~String> - Name of the slice
|
||||
# * 'progress'<~Integer> - Progress of current action, in percentage
|
||||
# * 'root-password'<~String> - Root password of slice
|
||||
# * 'status'<~String> - Current status of the slice
|
||||
# * body<~Hash>:
|
||||
# TODO
|
||||
def destroy_block(block_id)
|
||||
request(
|
||||
:expects => 200,
|
||||
|
|
|
@ -4,24 +4,15 @@ module Fog
|
|||
|
||||
require 'fog/bluebox/parsers/get_block'
|
||||
|
||||
# Get details of a block. We do this by looking at the
|
||||
# Get details of a block.
|
||||
#
|
||||
# ==== Parameters
|
||||
# * slice_id<~Integer> - Id of slice to lookup
|
||||
# * block_id<~Integer> - Id of block to lookup
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'addresses'<~Array> - Ip addresses for the slice
|
||||
# * 'backup-id'<~Integer> - Id of backup slice was booted from
|
||||
# * 'bw-in'<~Float> - Incoming bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'bw-out'<~Float> - Outgoing bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'flavor_id'<~Integer> - Id of flavor slice was booted from
|
||||
# * 'id'<~Integer> - Id of the slice
|
||||
# * 'image-id'<~Integer> - Id of image slice was booted from
|
||||
# * 'name'<~String> - Name of the slice
|
||||
# * 'progress'<~Integer> - Progress of current action, in percentage
|
||||
# * 'status'<~String> - Current status of the slice
|
||||
# TODO
|
||||
def get_block(block_id)
|
||||
request(
|
||||
:expects => 200,
|
||||
|
|
|
@ -12,10 +12,7 @@ module Fog
|
|||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# * 'id'<~Integer> - Id of the flavor
|
||||
# * 'name'<~String> - Name of the flavor
|
||||
# * 'price'<~Integer> - Price in cents
|
||||
# * 'ram'<~Integer> - Amount of ram for the flavor
|
||||
# TODO
|
||||
def get_flavor(flavor_id)
|
||||
request(
|
||||
:expects => 200,
|
||||
|
|
|
@ -2,24 +2,16 @@ module Fog
|
|||
module Bluebox
|
||||
class Real
|
||||
|
||||
# Reboot slice
|
||||
# Reboot block
|
||||
#
|
||||
# ==== Parameters
|
||||
# * slice_id<~String> - Id of server to reboot
|
||||
# * block_id<~String> - Id of block to reboot
|
||||
# * type<~String> - Type of reboot, must be in ['HARD', 'SOFT']
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'addresses'<~Array> - Ip addresses for the slice
|
||||
# * 'backup-id'<~Integer> - Id of backup slice was booted from
|
||||
# * 'bw-in'<~Float> - Incoming bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'bw-out'<~Float> - Outgoing bandwidth total for current billing cycle, in Gigabytes
|
||||
# * 'flavor_id'<~Integer> - Id of flavor slice was booted from
|
||||
# * 'id'<~Integer> - Id of the slice
|
||||
# * 'image-id'<~Integer> - Id of image slice was booted from
|
||||
# * 'name'<~String> - Name of the slice
|
||||
# * 'progress'<~Integer> - Progress of current action, in percentage
|
||||
# * 'status'<~String> - Current status of the slice
|
||||
# TODO
|
||||
def reboot_block(block_id, type = 'SOFT')
|
||||
request(
|
||||
:expects => 200,
|
||||
|
|
Loading…
Add table
Reference in a new issue