Sha256: 5b0c1351578229b88d4ed7954c1e7c16215e5f4b28295795dbe264ff7eb63170
Contents?: true
Size: 1.58 KB
Versions: 39
Compression:
Stored size: 1.58 KB
Contents
module Fog module Compute class Rackspace class Real # List all servers details # # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: # * 'servers'<~Array>: # * 'id'<~Integer> - Id of server # * 'name<~String> - Name of server # * 'imageId'<~Integer> - Id of image used to boot server # * 'flavorId'<~Integer> - Id of servers current flavor # * 'hostId'<~String> # * 'status'<~String> - Current server status # * 'progress'<~Integer> - Progress through current status # * 'addresses'<~Hash>: # * 'public'<~Array> - public address strings # * 'private'<~Array> - private address strings # * 'metadata'<~Hash> - metadata def list_servers_detail request( :expects => [200, 203], :method => 'GET', :path => 'servers/detail.json' ) end end class Mock def list_servers_detail response = Excon::Response.new servers = self.data[:servers].values for server in servers case server['status'] when 'BUILD' if Time.now - self.data[:last_modified][:servers][server['id']] > Fog::Mock.delay * 2 server['status'] = 'ACTIVE' end end end response.status = [200, 203][rand(1)] response.body = { 'servers' => servers } response end end end end end
Version data entries
39 entries across 37 versions & 6 rubygems