func (m *edgeLBManager) GetPools(ctx context.Context) ([]*edgelbmodels.V2Pool, error) {
	p := &edgelboperations.V2GetPoolsParams{
		Context: ctx,
	}
	r, err := m.client.Operations.V2GetPools(p)
	if err != nil {
		return nil, errors.Unknown(err)
	}
	return r.Payload, nil
}
GetPools returns the list of EdgeLB pools known to the EdgeLB API server.
package manager
import (
	"context"
	"fmt"
	"strings"
	httptransport "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
	edgelbclient "github.com/mesosphere/dcos-edge-lb/pkg/apis/client"
	edgelboperations "github.com/mesosphere/dcos-edge-lb/pkg/apis/client/operations"
	edgelbmodels "github.com/mesosphere/dcos-edge-lb/pkg/apis/models"
	"github.com/mesosphere/dklb/pkg/errors"
)
type EdgeLBManagerOptions struct {
	BearerToken string
	Host string
	InsecureSkipTLSVerify bool
	Path string
	PoolGroup string
	Scheme string
}
type EdgeLBManager interface {
	CreatePool(context.Context, *edgelbmodels.V2Pool) (*edgelbmodels.V2Pool, error)
	DeletePool(context.Context, string) error
	GetPools(ctx context.Context) ([]*edgelbmodels.V2Pool, error)
	GetPool(context.Context, string) (*edgelbmodels.V2Pool, error)
	GetPoolMetadata(context.Context, string) (*edgelbmodels.V2PoolMetadata, error)
	GetVersion(context.Context) (string, error)
	PoolGroup() string
	UpdatePool(context.Context, *edgelbmodels.V2Pool) (*edgelbmodels.V2Pool, error)
}
type edgeLBManager struct {
	client *edgelbclient.DcosEdgeLb
	poolGroup string
}
func NewEdgeLBManager(opts EdgeLBManagerOptions) (EdgeLBManager, error) {
	var (
		t *httptransport.Runtime
	)
	if strings.HasPrefix(opts.Host, "http://") {
		opts.Host = strings.TrimPrefix(opts.Host, "http://")
	}
	if strings.HasPrefix(opts.Host, "https://") {
		opts.Host = strings.TrimPrefix(opts.Host, "https://")
	}
	if !opts.InsecureSkipTLSVerify {
		t = httptransport.New(opts.Host, opts.Path, []string{opts.Scheme})
	} else {
		c, err := httptransport.TLSClient(httptransport.TLSClientOptions{
			InsecureSkipVerify: true,
		})
		if err != nil {
			panic(err)
		}
		t = httptransport.NewWithClient(opts.Host, opts.Path, []string{opts.Scheme}, c)
	}
	if opts.BearerToken != "" {
		t.DefaultAuthentication = httptransport.BearerToken(opts.BearerToken)
	}
	return &edgeLBManager{
		client:    edgelbclient.New(t, strfmt.Default),
		poolGroup: opts.PoolGroup,
	}, nil
}
func (m *edgeLBManager) CreatePool(ctx context.Context, pool *edgelbmodels.V2Pool) (*edgelbmodels.V2Pool, error) {
	p := &edgelboperations.V2CreatePoolParams{
		Context: ctx,
		Pool:    pool,
	}
	r, err := m.client.Operations.V2CreatePool(p)
	if err == nil {
		return r.Payload, nil
	}
	return nil, errors.Unknown(err)
}
func (m *edgeLBManager) DeletePool(ctx context.Context, name string) error {
	p := &edgelboperations.V2DeletePoolParams{
		Context: ctx,
		Name:    name,
	}
	_, err := m.client.Operations.V2DeletePool(p)
	if err == nil {
		return nil
	}
	if err, ok := err.(*edgelboperations.V2DeletePoolDefault); ok && err.Code() == 404 {
		return errors.NotFound(err)
	}
	return errors.Unknown(err)
}