fake

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeRamMax         = uint64(40960)
	FakeVcpusMax       = uint64(50)
	FakeDiskMax        = uint64(5000)
	FakeExternalIpsMax = uint64(30)
)

Variables

View Source
var AccessVarProps = map[string]*edgeproto.PropertyInfo{
	"APIKey": &edgeproto.PropertyInfo{
		Name:        "API Key",
		Description: "API Key for authentication",
		Secret:      true,
	},
}
View Source
var DefaultFlavorList = []*edgeproto.FlavorInfo{
	&edgeproto.FlavorInfo{
		Name:  "x1.tiny",
		Vcpus: uint64(1),
		Ram:   uint64(1024),
		Disk:  uint64(20),
	},
	&edgeproto.FlavorInfo{
		Name:  "x1.small",
		Vcpus: uint64(2),
		Ram:   uint64(4096),
		Disk:  uint64(40),
	},
}
View Source
var FakeAppDNSRoot = "fake.net"

Functions

func GetPlatformVMs

func GetPlatformVMs() []edgeproto.VmInfo

func NewPlatform

func NewPlatform() platform.Platform

func NewPlatformSingleCluster

func NewPlatformSingleCluster() platform.Platform

func NewPlatformVMPool

func NewPlatformVMPool() platform.Platform

Types

type Platform

type Platform struct {
	FlavorList []*edgeproto.FlavorInfo
	// contains filtered or unexported fields
}

func (*Platform) ActiveChanged

func (s *Platform) ActiveChanged(ctx context.Context, platformActive bool) error

func (*Platform) AddCrmServiceOps

func (s *Platform) AddCrmServiceOps(ops ...process.CrmServiceOp)

func (*Platform) ChangeAppInstDNS

func (v *Platform) ChangeAppInstDNS(ctx context.Context, app *edgeproto.App, appInst *edgeproto.AppInst, OldURI string, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) ChangeCloudletDNS

func (s *Platform) ChangeCloudletDNS(ctx context.Context, cloudlet *edgeproto.Cloudlet, oldFqdn string, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) ChangeClusterInstDNS

func (s *Platform) ChangeClusterInstDNS(ctx context.Context, clusterInst *edgeproto.ClusterInst, oldFqdn string, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) CreateAppInst

func (s *Platform) CreateAppInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, flavor *edgeproto.Flavor, updateSender edgeproto.AppInstInfoSender) error

func (*Platform) CreateCloudlet

func (s *Platform) CreateCloudlet(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, pfInitConfig *platform.PlatformInitConfig, flavor *edgeproto.Flavor, caches *platform.Caches, updateCallback edgeproto.CacheUpdateCallback) (bool, error)

func (*Platform) CreateClusterInst

func (s *Platform) CreateClusterInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, updateCallback edgeproto.CacheUpdateCallback, timeout time.Duration) error

func (*Platform) DeleteAppInst

func (s *Platform) DeleteAppInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) DeleteCloudlet

func (s *Platform) DeleteCloudlet(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, pfInitConfig *platform.PlatformInitConfig, caches *platform.Caches, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) DeleteClusterInst

func (s *Platform) DeleteClusterInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) DeleteTrustPolicyException

func (s *Platform) DeleteTrustPolicyException(ctx context.Context, tpeKey *edgeproto.TrustPolicyExceptionKey, clusterKey *edgeproto.ClusterKey) error

func (*Platform) GatherCloudletInfo

func (s *Platform) GatherCloudletInfo(ctx context.Context, info *edgeproto.CloudletInfo) error

func (*Platform) GetAppInstRuntime

func (s *Platform) GetAppInstRuntime(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst) (*edgeproto.AppInstRuntime, error)

func (*Platform) GetCloudletInfraResources

func (s *Platform) GetCloudletInfraResources(ctx context.Context) (*edgeproto.InfraResourcesSnapshot, error)

func (*Platform) GetCloudletManifest

func (s *Platform) GetCloudletManifest(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, pfInitConfig *platform.PlatformInitConfig, accessApi platform.AccessApi, flavor *edgeproto.Flavor, caches *platform.Caches) (*edgeproto.CloudletManifest, error)

func (*Platform) GetClusterAdditionalResourceMetric

func (s *Platform) GetClusterAdditionalResourceMetric(ctx context.Context, cloudlet *edgeproto.Cloudlet, resMetric *edgeproto.Metric, resources []edgeproto.VMResource) error

func (*Platform) GetClusterAdditionalResources

func (s *Platform) GetClusterAdditionalResources(ctx context.Context, cloudlet *edgeproto.Cloudlet, vmResources []edgeproto.VMResource, infraResMap map[string]edgeproto.InfraResource) map[string]edgeproto.InfraResource

called by controller, make sure it doesn't make any calls to infra API

func (*Platform) GetClusterInfraResources

func (s *Platform) GetClusterInfraResources(ctx context.Context, cluster *edgeproto.ClusterInst) (*edgeproto.InfraResources, error)

func (*Platform) GetClusterPlatformClient

func (s *Platform) GetClusterPlatformClient(ctx context.Context, clusterInst *edgeproto.ClusterInst, clientType string) (ssh.Client, error)

func (*Platform) GetConsoleUrl

func (s *Platform) GetConsoleUrl(ctx context.Context, app *edgeproto.App, appInst *edgeproto.AppInst) (string, error)

func (*Platform) GetContainerCommand

func (s *Platform) GetContainerCommand(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, req *edgeproto.ExecRequest) (string, error)

func (*Platform) GetFeatures

func (s *Platform) GetFeatures() *edgeproto.PlatformFeatures

func (*Platform) GetInitHAConditionalCompatibilityVersion

func (s *Platform) GetInitHAConditionalCompatibilityVersion(ctx context.Context) string

func (*Platform) GetNodePlatformClient

func (s *Platform) GetNodePlatformClient(ctx context.Context, node *edgeproto.CloudletMgmtNode, ops ...pc.SSHClientOp) (ssh.Client, error)

func (*Platform) GetResources

func (s *Platform) GetResources() *fakecommon.Resources

func (*Platform) GetRestrictedCloudletStatus

func (s *Platform) GetRestrictedCloudletStatus(ctx context.Context, cloudlet *edgeproto.Cloudlet, pfConfig *edgeproto.PlatformConfig, accessApi platform.AccessApi, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) GetRootLBClients

func (s *Platform) GetRootLBClients(ctx context.Context) (map[string]platform.RootLBClient, error)

func (*Platform) GetRootLBFlavor

func (s *Platform) GetRootLBFlavor(ctx context.Context) (*edgeproto.Flavor, error)

func (*Platform) GetVersionProperties

func (s *Platform) GetVersionProperties(ctx context.Context) map[string]string

func (*Platform) HandleFedAppInstCb

func (s *Platform) HandleFedAppInstCb(ctx context.Context, msg *edgeproto.FedAppInstEvent)

func (*Platform) HasTrustPolicyException

func (s *Platform) HasTrustPolicyException(ctx context.Context, tpeKey *edgeproto.TrustPolicyExceptionKey, clusterInst *edgeproto.ClusterInst) bool

func (*Platform) InitCommon

func (s *Platform) InitCommon(ctx context.Context, platformConfig *platform.PlatformConfig, caches *platform.Caches, haMgr *redundancy.HighAvailabilityManager, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) InitHAConditional

func (s *Platform) InitHAConditional(ctx context.Context, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) ListCloudletMgmtNodes

func (s *Platform) ListCloudletMgmtNodes(ctx context.Context, clusterInsts []edgeproto.ClusterInst, vmAppInsts []edgeproto.AppInst) ([]edgeproto.CloudletMgmtNode, error)

func (*Platform) NameSanitize

func (s *Platform) NameSanitize(name string) string

func (*Platform) PerformUpgrades

func (s *Platform) PerformUpgrades(ctx context.Context, caches *platform.Caches, cloudletState dme.CloudletState) error

func (*Platform) SetPause

func (s *Platform) SetPause(enable bool)

SetPause pauses responder until unpaused. Warning: don't double-pause or double-unpause.

func (*Platform) SetPowerState

func (s *Platform) SetPowerState(ctx context.Context, app *edgeproto.App, appInst *edgeproto.AppInst, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) SetSimulateAppCreateFailure

func (s *Platform) SetSimulateAppCreateFailure(state bool)

func (*Platform) SetSimulateAppDeleteFailure

func (s *Platform) SetSimulateAppDeleteFailure(state bool)

func (*Platform) SetSimulateClusterCreateFailure

func (s *Platform) SetSimulateClusterCreateFailure(state bool)

func (*Platform) SetSimulateClusterDeleteFailure

func (s *Platform) SetSimulateClusterDeleteFailure(state bool)

func (*Platform) TrustPolicyExceptionCount

func (s *Platform) TrustPolicyExceptionCount(ctx context.Context) int

func (*Platform) UpdateAppInst

func (s *Platform) UpdateAppInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, flavor *edgeproto.Flavor, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) UpdateCloudlet

func (s *Platform) UpdateCloudlet(ctx context.Context, cloudlet *edgeproto.Cloudlet, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) UpdateClusterInst

func (s *Platform) UpdateClusterInst(ctx context.Context, clusterInst *edgeproto.ClusterInst, updateCallback edgeproto.CacheUpdateCallback) error

func (*Platform) UpdateResourcesMax

func (s *Platform) UpdateResourcesMax(envVars map[string]string) error

func (*Platform) UpdateTrustPolicy

func (s *Platform) UpdateTrustPolicy(ctx context.Context, TrustPolicy *edgeproto.TrustPolicy) error

func (*Platform) UpdateTrustPolicyException

func (s *Platform) UpdateTrustPolicyException(ctx context.Context, tpe *edgeproto.TrustPolicyException, clusterKey *edgeproto.ClusterKey) error

func (*Platform) VerifyVMs

func (s *Platform) VerifyVMs(ctx context.Context, vms []edgeproto.VM) error

func (*Platform) WaitHasTrustPolicyException

func (s *Platform) WaitHasTrustPolicyException(ctx context.Context, tpeKey *edgeproto.TrustPolicyExceptionKey, clusterInst *edgeproto.ClusterInst) bool

type PlatformSingleCluster

type PlatformSingleCluster struct {
	Platform
}

func (*PlatformSingleCluster) GetFeatures

type PlatformVMPool

type PlatformVMPool struct {
	Platform
}

func (*PlatformVMPool) GetFeatures

func (s *PlatformVMPool) GetFeatures() *edgeproto.PlatformFeatures

Jump to

Keyboard shortcuts

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