cloudprovider: aws InstanceID implementation

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
pull/6/head
Federico Simoncelli 2015-05-18 10:43:08 -04:00
parent 466a7daaa8
commit 185d0e19d5
1 changed files with 7 additions and 1 deletions

View File

@ -438,7 +438,13 @@ func (aws *AWSCloud) ExternalID(name string) (string, error) {
// InstanceID returns the cloud provider ID of the specified instance.
func (aws *AWSCloud) InstanceID(name string) (string, error) {
return "", nil
inst, err := aws.getInstancesByDnsName(name)
if err != nil {
return "", err
}
// In the future it is possible to also return an endpoint as:
// <endpoint>/<zone>/<instanceid>
return "/" + *inst.Placement.AvailabilityZone + "/" + *inst.InstanceID, nil
}
// Return the instances matching the relevant private dns name.