cloudprovider: add support for InstanceID method

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli
2015-05-08 11:19:17 -04:00
parent 194343267d
commit faba12951a
9 changed files with 51 additions and 8 deletions

View File

@@ -167,7 +167,7 @@ func (v *OVirtCloud) NodeAddresses(name string) ([]api.NodeAddress, error) {
return []api.NodeAddress{{Type: api.NodeLegacyHostIP, Address: address.String()}}, nil
}
// ExternalID returns the cloud provider ID of the specified instance.
// ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (v *OVirtCloud) ExternalID(name string) (string, error) {
instance, err := v.fetchInstance(name)
if err != nil {
@@ -176,6 +176,11 @@ func (v *OVirtCloud) ExternalID(name string) (string, error) {
return instance.UUID, nil
}
// InstanceID returns the cloud provider ID of the specified instance.
func (v *OVirtCloud) InstanceID(name string) (string, error) {
return "", nil
}
func getInstancesFromXml(body io.Reader) (OVirtInstanceMap, error) {
if body == nil {
return nil, fmt.Errorf("ovirt rest-api response body is missing")