cpisdk

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Errors
	CreateLoadbalancerError  = "CreateLoadbalancerError"
	UpdateLoadbalancerError  = "UpdateLoadbalancerError"
	DeleteLoadbalancerError  = "DeleteLoadbalancerError"
	GetLoadbalancerError     = "GetLoadbalancerError"
	CPIStatusUpgradeRdeError = "CPIStatusUpgradeRdeError"
	RemoveVIPFromRdeError    = "RemoveVirtualIPFromRdeError"
	AddVIPToRdeError         = "AddVirtualIPToRdeError"

	// Events
	ClientAuthenticated  = "ClientAuthenticated"
	CreatedLoadbalancer  = "CreatedLoadbalancer"
	UpdatedLoadbalancer  = "UpdatedLoadbalancer"
	DeletedLoadbalancer  = "DeletedLoadbalancer"
	CPIStatusRDEUpgraded = "CPIStatusRDEUpgraded"
)

Variables

This section is empty.

Functions

func UpgradeCPISectionInStatus

func UpgradeCPISectionInStatus(statusMap map[string]interface{}) (map[string]interface{}, error)

UpgradeCPISectionInStatus provides a helper function to update the latest CPI status into local entity Provide an automatic conversion of the content in srcCapvcdEntity.entity.status.cpi content to the latest RDE version format (vcdsdk.CPIStatus) Add the placeholder for any special conversion logic inside vcdsdk.CPIStatus (for developers) Convert vcdsdk.CPIStatus to cpiStatusMap as the content in srcCapvcdEntity.entity.status.cpi; return cpiStatusMap

Types

type CPIRDEManager

type CPIRDEManager struct {
	// Client will be refreshed separately
	RDEManager *vcdsdk.RDEManager
}

func NewCPIRDEManager

func NewCPIRDEManager(rdeManager *vcdsdk.RDEManager) *CPIRDEManager

func (*CPIRDEManager) AddToErrorSet

func (cpiRdeManager *CPIRDEManager) AddToErrorSet(ctx context.Context, errorName, vcdResourceId, detailedErrorMessage string) error

func (*CPIRDEManager) AddToErrorSetWithNameAndId

func (cpiRdeManager *CPIRDEManager) AddToErrorSetWithNameAndId(ctx context.Context, errorName, vcdResourceId, vcdResourceName, detailedErrorMessage string) error

func (*CPIRDEManager) AddToEventSet

func (cpiRdeManager *CPIRDEManager) AddToEventSet(ctx context.Context, eventName, vcdResourceId, detailedEventMsg string) error

func (*CPIRDEManager) AddToEventSetWithNameAndId

func (cpiRdeManager *CPIRDEManager) AddToEventSetWithNameAndId(ctx context.Context, eventName, vcdResourceId, vcdResourceName, detailedEventMsg string) error

func (*CPIRDEManager) AddVIPToVCDResourceSet

func (cpiRDEManager *CPIRDEManager) AddVIPToVCDResourceSet(ctx context.Context, vsName string, vsID string, externalIP string) error

AddVIPToVCDResourceSet adds virtual IP to the RDE and removes the VIP from older "status.virtualIPs" section if present

func (*CPIRDEManager) AddVirtualIpToRDE

func (cpiRDEManager *CPIRDEManager) AddVirtualIpToRDE(ctx context.Context, addIp string) error

func (*CPIRDEManager) GetRDEVirtualIps

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

func (*CPIRDEManager) RemoveVirtualIpFromRDE

func (cpiRDEManager *CPIRDEManager) RemoveVirtualIpFromRDE(ctx context.Context, removeIp string) error

func (*CPIRDEManager) UpgradeCPIStatusOfExistingRDE

func (cpiRDEManager *CPIRDEManager) UpgradeCPIStatusOfExistingRDE(ctx context.Context, rdeId string) error

UpgradeCPIStatusOfExistingRDE Creates an empty cpi section with just the name and version populated if CPI status section is missing from CAPVCD RDE. This method is intended to be called when CPI is started up. EnsureLoadBalancer function, which is called for every instance of load balancer type service during start up, will take care of lazily updating rest of the information related to CPI. Provide an automatic conversion of the content in srcEntity.entity.status.cpi content to the latest RDE version format (CPIStatus) Add the placeholder for any special conversion logic inside CSIStatus inside UpgradeCPISectionInStatus() (for developers) Call an API call (PUT) to update CAPVCD entity and persist data into VCD For future CPI upgrades, this method may become a factory of converters (ConvertFrom()).

Jump to

Keyboard shortcuts

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