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/compute/requests/aws/get_password_data.rb
Aaron Suggs 00278cf57a [compute|aws] Add get_password_data request.
This request only applies to MS Windows instances,
so use an MS Win AMI in the instance tests.

Relaxes the parser formats flexible to make tests
less brittle to other instances.

Depends on #302
2011-05-13 12:49:28 -04:00

42 lines
1.2 KiB
Ruby

module Fog
module AWS
class Compute
class Real
require 'fog/compute/parsers/aws/get_password_data'
# Retrieves the encrypted administrator password for an instance running Windows.
#
# ==== Parameters
# * instance_id<~String> - A Windows instance ID
#
# ==== Returns
# # * response<~Excon::Response>:
# * body<~Hash>:
# * 'instanceId'<~String> - Id of instance
# * 'passwordData'<~String> - The encrypted, base64-encoded password of the instance.
# * 'requestId'<~String> - Id of request
# * 'timestamp'<~Time> - Timestamp of last update to output
#
# See http://docs.amazonwebservices.com/AWSEC2/2010-08-31/APIReference/index.html?ApiReference-query-GetPasswordData.html
def get_password_data(instance_id)
request(
'Action' => 'GetPasswordData',
'InstanceId' => instance_id,
:idempotent => true,
:parser => Fog::Parsers::AWS::Compute::GetPasswordData.new
)
end
end
class Mock
def get_password_data(instance_id)
Fog::Mock.not_implemented
end
end
end
end
end