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_vlans.rb

48 lines
1.2 KiB
Ruby
Raw Normal View History

2012-01-10 17:20:56 -05:00
module Fog
module Compute
class IBM
class Real
2011-04-27 01:49:05 -04:00
# Returns the vlan offerings for user
#
# ==== Parameters
# No parameters
2012-01-10 17:20:56 -05:00
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
2011-04-27 01:49:05 -04:00
# * 'addresses'<~Array>: list of addresses
# * 'location'<~String>: location of address
# * 'mode'<~Integer>:
# * 'offeringId'<~String>: offering ID
# * 'id'<~String>: id
# * 'type'<~Integer>: TODO unsure
# * 'ip'<~String>: IP address.. with space at the end
# * 'hostname'<~String>: seems to be same as ip
# * 'state'<~Integer>: state of address
def list_vlans
2012-01-10 17:20:56 -05:00
request(
:method => 'GET',
:expects => 200,
:path => '/offerings/vlan'
)
end
end
2011-12-02 13:27:44 -05:00
class Mock
def list_vlans
response = Excon::Response.new
response.status = 200
response.body = {"vlan"=>
2011-12-02 13:27:44 -05:00
[{"location"=>"101",
"id"=>"75321",
"name"=>"FOG-VLAN1"}]}
2011-12-02 13:27:44 -05:00
response
end
end
2012-01-10 17:20:56 -05:00
end
end
end