cloudprovider: openstack InstanceID implementation

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli 2015-05-27 03:53:13 -04:00
parent afcda70190
commit 154eccefe2

View File

@ -368,7 +368,13 @@ func (i *Instances) ExternalID(name string) (string, error) {
// InstanceID returns the cloud provider ID of the specified instance.
func (i *Instances) InstanceID(name string) (string, error) {
return "", nil
srv, err := getServerByName(i.compute, name)
if err != nil {
return "", err
}
// In the future it is possible to also return an endpoint as:
// <endpoint>/<instanceid>
return "/" + srv.ID, nil
}
func (i *Instances) GetNodeResources(name string) (*api.NodeResources, error) {