mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
![Jeff McCune](/assets/img/avatar_default.png)
Without this patch, no actual API calls are being made through the Fog layer to the underlying rbvmobi later and ultimately to the vSphere target API. This patch adds a simple current_time request which is similar to a "ping" The layers and API are exercised fully using this simple API call to retrieve the current time on the remote system. This provides: >> Fog::Compute[:vsphere].current_time Tue Aug 30 20:46:27 UTC 2011 >> Fog::Compute[:vsphere].requests [:current_time]
21 lines
270 B
Ruby
21 lines
270 B
Ruby
module Fog
|
|
module Compute
|
|
class Vsphere
|
|
class Real
|
|
|
|
def current_time
|
|
@connection.serviceInstance.CurrentTime
|
|
end
|
|
|
|
end
|
|
|
|
class Mock
|
|
|
|
def current_time
|
|
Time.now.utc
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|