vcdclient

package
v0.0.0-...-57daf80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoRdePrefix = `NO_RDE_`
)
View Source
const (
	// VCDVMIDPrefix is a prefix added to VM objects by VCD. This needs
	// to be removed for query operations.
	VCDVMIDPrefix = "urn:vcloud:vm:"
)
View Source
const (
	VCloudApiVersion = "36.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	VCDAuthConfig   *VCDAuthConfig
	ClusterOrgName  string
	ClusterOVDCName string
	ClusterVAppName string
	VCDClient       *govcd.VCDClient
	VDC             *govcd.Vdc
	APIClient       *swaggerClient.APIClient

	IPAMSubnet string

	ClusterID        string
	OneArm           *OneArm
	HTTPPort         int32
	HTTPSPort        int32
	CertificateAlias string
	RWLock           sync.RWMutex
	// contains filtered or unexported fields
}

Client :

func NewVCDClientFromSecrets

func NewVCDClientFromSecrets(host string, orgName string, vdcName string, vAppName string,
	networkName string, ipamSubnet string, userOrg string, user string, password string,
	refreshToken string, insecure bool, clusterID string, oneArm *OneArm,
	httpPort int32, httpsPort int32, certAlias string, getVdcClient bool) (*Client, error)

NewVCDClientFromSecrets :

func (*Client) CacheGatewayDetails

func (client *Client) CacheGatewayDetails(ctx context.Context) error

CacheGatewayDetails : get gateway reference and cache some details in client object

func (*Client) CreateLoadBalancer

func (client *Client) CreateLoadBalancer(ctx context.Context, virtualServiceNamePrefix string,
	lbPoolNamePrefix string, ips []string, portDetailsList []PortDetails) (string, error)

CreateLoadBalancer : create a new load balancer pool and virtual service pointing to it

func (*Client) DeleteLoadBalancer

func (client *Client) DeleteLoadBalancer(ctx context.Context, virtualServiceNamePrefix string,
	lbPoolNamePrefix string, portDetailsList []PortDetails) error

DeleteLoadBalancer : create a new load balancer pool and virtual service pointing to it

func (*Client) FindVMByName

func (client *Client) FindVMByName(vmName string) (*govcd.VM, error)

FindVMByName finds a VM in a vApp using the name. The client is expected to have a valid bearer token when this function is called.

func (*Client) FindVMByUUID

func (client *Client) FindVMByUUID(vcdVmUUID string) (*govcd.VM, error)

FindVMByUUID finds a VM in a vApp using the UUID. The client is expected to have a valid bearer token when this function is called.

func (*Client) GetLoadBalancer

func (client *Client) GetLoadBalancer(ctx context.Context, virtualServiceName string) (string, error)

GetLoadBalancer :

func (*Client) GetRDEVirtualIps

func (client *Client) GetRDEVirtualIps(ctx context.Context) ([]string, string, *swaggerClient.DefinedEntity, error)

func (*Client) IsNSXTBackedGateway

func (client *Client) IsNSXTBackedGateway() bool

IsNSXTBackedGateway : return true if gateway is backed by NSX-T

func (*Client) IsVmNotAvailable

func (client *Client) IsVmNotAvailable(err error) bool

IsVmNotAvailable : In VCD, if the VM is not available, it can be an access error or the VM may not be present. Hence we sometimes get an error different from govcd.ErrorEntityNotFound

func (*Client) RefreshBearerToken

func (client *Client) RefreshBearerToken() error

func (*Client) UpdateLoadBalancer

func (client *Client) UpdateLoadBalancer(ctx context.Context, lbPoolName string, virtualServiceName string,
	ips []string, internalPort int32, externalPort int32) error

type GatewayBusyError

type GatewayBusyError struct {
	GatewayName string
}

func NewGatewayBusyError

func NewGatewayBusyError(gatewayName string) *GatewayBusyError

func (*GatewayBusyError) Error

func (gatewayBusyError *GatewayBusyError) Error() string

type LoadBalancerPoolBusyError

type LoadBalancerPoolBusyError struct {
	LBPoolName string
}

func NewLBPoolBusyError

func NewLBPoolBusyError(lbPoolName string) *LoadBalancerPoolBusyError

func (*LoadBalancerPoolBusyError) Error

func (lbPoolError *LoadBalancerPoolBusyError) Error() string

type NatRuleRef

type NatRuleRef struct {
	Name         string
	ID           string
	ExternalIP   string
	InternalIP   string
	ExternalPort int
	InternalPort int
}

type NoRDEError

type NoRDEError struct {
	// contains filtered or unexported fields
}

NoRDEError is an error used when the InfraID value in the VCDCluster object does not point to a valid RDE in VCD

func NewNoRDEError

func NewNoRDEError(message string) *NoRDEError

func (*NoRDEError) Error

func (nre *NoRDEError) Error() string

type OneArm

type OneArm struct {
	StartIPAddress string
	EndIPAddress   string
}

OneArm : internal struct representing OneArm config details

type PortDetails

type PortDetails struct {
	Protocol     string
	PortSuffix   string
	ExternalPort int32
	InternalPort int32
	UseSSL       bool
	CertAlias    string
}

type VCDAuthConfig

type VCDAuthConfig struct {
	User         string `json:"user"`
	Password     string `json:"password"`
	RefreshToken string `json:"refreshToken"`
	UserOrg      string `json:"org"`
	Host         string `json:"host"`
	CloudAPIHref string `json:"cloudapihref"`
	VDC          string `json:"vdc"`
	Insecure     bool   `json:"insecure"`
	Token        string `json:"token"`
	IsSysAdmin   bool   // will be set by GetBearerToken()
}

VCDAuthConfig : contains config related to vcd auth

func NewVCDAuthConfigFromSecrets

func NewVCDAuthConfigFromSecrets(host string, user string, secret string,
	refreshToken string, userOrg string, insecure bool) *VCDAuthConfig

func (*VCDAuthConfig) GetBearerToken

func (config *VCDAuthConfig) GetBearerToken() (*govcd.VCDClient, *http.Response, error)

func (*VCDAuthConfig) GetPlainClientFromSecrets

func (config *VCDAuthConfig) GetPlainClientFromSecrets() (*govcd.VCDClient, error)

func (*VCDAuthConfig) GetSwaggerClientFromSecrets

func (config *VCDAuthConfig) GetSwaggerClientFromSecrets() (*govcd.VCDClient, *swaggerClient.APIClient, error)

type VirtualServiceBusyError

type VirtualServiceBusyError struct {
	VirtualServiceName string
}

func NewVirtualServiceBusyError

func NewVirtualServiceBusyError(virtualServiceName string) *VirtualServiceBusyError

func (*VirtualServiceBusyError) Error

func (vsError *VirtualServiceBusyError) Error() string

type VirtualServicePendingError

type VirtualServicePendingError struct {
	VirtualServiceName string
}

func NewVirtualServicePendingError

func NewVirtualServicePendingError(virtualServiceName string) *VirtualServicePendingError

func (*VirtualServicePendingError) Error

func (vsError *VirtualServicePendingError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL