1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/ibm/requests/compute/list_instances.rb
2012-03-20 23:37:46 -04:00

57 lines
2 KiB
Ruby

module Fog
module Compute
class IBM
class Real
# Returns list of instances that the authenticated user manages.
#
# ==== Parameters
# No parameters
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'instances'<~Array>: list of instances
# * 'name'<~String>: instance name
# * 'location'<~String>: instance location id
# * 'keyName'<~String>: instance assigned keypair
# * 'primaryIP'<~Hash>: assigned ip address, type, and hostname
# * 'productCodes'<~Array>: associated product codes
# * 'requestId'<~String>:
# * 'imageId'<~String>:
# * 'launchTime'<~Integer>: UNIX time integer representing when the instance was launched
# * 'id'<~String>: instance id
# * 'volumes'<~Array>:
# * 'root-only'<~Boolean>: instance id
# * 'instanceType'<~String>: instance type
# * 'diskSize'<~String>: instance disk size
# * 'requestName'<~String>: instance request name
# * 'secondaryIP'<~Array>: additional IP Addresses associated with this instance
# * 'status'<~Integer>: instance status flag
# * 'software'<~Array>: Software associated with this instance
# * 'application'<~Hash>: Application name, type, and version (primarily OS information)
# * 'expirationTime'<~Integer>: UNIX timestamp representing when the instance expires
# * 'owner'<~String>: instance owner
def list_instances
request(
:method => 'GET',
:expects => 200,
:path => '/instances'
)
end
end
class Mock
def list_instances
response = Excon::Response.new
response.status = 200
response.body = { 'instances' => [] }
response
end
end
end
end
end