This repository was archived by the owner on Mar 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
pkg/cloudprovider/providers/openstack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ go_library(
3434 "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions:go_default_library" ,
3535 "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes:go_default_library" ,
3636 "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library" ,
37+ "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/attachinterfaces:go_default_library" ,
3738 "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/volumeattach:go_default_library" ,
3839 "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers:go_default_library" ,
3940 "//vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts:go_default_library" ,
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import (
3131 "github.com/gophercloud/gophercloud"
3232 "github.com/gophercloud/gophercloud/openstack"
3333 apiversions_v1 "github.com/gophercloud/gophercloud/openstack/blockstorage/v1/apiversions"
34+ "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/attachinterfaces"
3435 "github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
3536 "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/trusts"
3637 tokens3 "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
@@ -444,6 +445,26 @@ func getAddressByName(client *gophercloud.ServiceClient, name types.NodeName) (s
444445 return addrs [0 ].Address , nil
445446}
446447
448+ // getAttachedInterfacesByID returns the node interfaces of the specified instance.
449+ func getAttachedInterfacesByID (client * gophercloud.ServiceClient , serviceID string ) ([]attachinterfaces.Interface , error ) {
450+ var interfaces []attachinterfaces.Interface
451+
452+ pager := attachinterfaces .List (client , serviceID )
453+ err := pager .EachPage (func (page pagination.Page ) (bool , error ) {
454+ s , err := attachinterfaces .ExtractInterfaces (page )
455+ if err != nil {
456+ return false , err
457+ }
458+ interfaces = append (interfaces , s ... )
459+ return true , nil
460+ })
461+ if err != nil {
462+ return interfaces , err
463+ }
464+
465+ return interfaces , nil
466+ }
467+
447468func (os * OpenStack ) Clusters () (cloudprovider.Clusters , bool ) {
448469 return nil , false
449470}
You can’t perform that action at this time.
0 commit comments