github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/pkg/providers/xen/list_instances.go (about)

     1  package xen
     2  
     3  import "github.com/solo-io/unik/pkg/types"
     4  
     5  func (p *XenProvider) ListInstances() ([]*types.Instance, error) {
     6  	if len(p.state.GetInstances()) < 1 {
     7  		return []*types.Instance{}, nil
     8  	}
     9  
    10  	var instances []*types.Instance
    11  	for _, v := range p.state.GetInstances() {
    12  		instances = append(instances, v)
    13  	}
    14  
    15  	return instances, nil
    16  }