controller

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: 64 Imported by: 0

README

Edge-Cloud Controller

The Edge-Cloud Controller handles all persistent state and disseminates data to the Matcher and Cloudlet-Mgr nodes.

Persistent state is primarily inserted by User-driven API calls, i.e. to Create/Update/Delete Developers, Apps, Operators, Cloudlets, etc. Persistent state is stored via an Etcd database.

Persistent state is disseminated to the Matcher and Cloudlet-Mgr nodes by the notify mechanism whenever that data changes. The Matcher and Cloudlet-Mgr nodes are not part of the Etcd Cluster. They only manage a copy of the Controller's data in memory to allow for faster decision making on that data. The Matcher and Cloudlet-Mgr may not need the full set of data managed by the Controller, so the Controller will only forward changes that are needed.

Much of the code for handling objects is boiler-plate, and is handled by auto-generated code. See the protoc-gen-gomex readme. Additionally some unit test code is also generated by the protoc-gen-test code. See the readme there as well, plus the unit test template code in the go files there.

For controller unit tests that involve an etcd back-end, either the test uses a dummy etcd backend (dummy_etcd.go), or spawns a single etcd instance (the equivalent of which can be done by running the controller with --localEtcd).

CRM State Handling

See crm_state.md

Documentation

Overview

useralert config

Index

Constants

View Source
const (
	CloudletCertRefreshTaskKey     = "CloudletCertRefreshTask"
	CloudletResourceRefreshTaskKey = "CloudletResourceRefreshTask"
)
View Source
const (
	PlatformInitTimeout           = 20 * time.Minute
	DefaultResourceAlertThreshold = 80 // percentage
)
View Source
const (
	NoGenResourceAlerts = 0
	GenResourceAlerts   = 1
)
View Source
const (
	ToggleFlavorMatchVerbose = "toggle-flavormatch-verbose"
	ShowControllers          = "show-controllers"
)
View Source
const (
	// For K8s/Docker based Apps
	ShortTimeout = edgeproto.Duration(6 * time.Second)
	// For VM based Apps
	LongTimeout = edgeproto.Duration(60 * time.Second)
)
View Source
const (
	GPUDriverBuildURLValidity = 20 * time.Minute
	ChangeInProgress          = "ChangeInProgress"
	AllCloudlets              = ""
)
View Source
const (
	DataModelVersion0Prefix = "Version"
	DataModelVersion2Prefix = "VersionV2"
)

DataModelVersion0's db value is a string which was the hash value. DataModelVersion2's db value is the JSON of edgeproto.DataModelVersion.

View Source
const DummyInfoDelay = 10 * time.Millisecond

Add in a little day to allow intermediate state changes to be seen. But don't add too much because it increases the unit test run time.

View Source
const NotifyChangeMaxLen = int64(200)
View Source
const RootLBSharedPortBegin int32 = 10000

Variables

View Source
var (
	StreamMsgKeyID       = "id"
	StreamMsgKeyModRev   = "modRev"
	StreamMsgTypeMessage = "message"
	StreamMsgTypeError   = "error"
	StreamMsgTypeSOM     = "start-of-stream-message"
	StreamMsgTypeEOM     = "end-of-stream-message"
	StreamMsgTypeInfoEOM = "end-of-info-stream-message"

	StreamMsgReadTimeout     = 30 * time.Minute
	StreamMsgInfoReadTimeout = 3 * time.Second
)
View Source
var ActionInProgressMsg = "action is already in progress"
View Source
var AppUsageInfluxQueryTemplate = `SELECT %s from "%s" WHERE ` + getInfluxQueryWhere(cloudcommon.AppInstEventSelectors) + ` AND time >= '%s' AND time < '%s' order by time desc`
View Source
var ClusterUsageInfluxQueryTemplate = `SELECT %s from "%s" WHERE ` + getInfluxQueryWhere(cloudcommon.ClusterInstEventSelectors) + ` %sAND time >= '%s' AND time < '%s' order by time desc`
View Source
var ControllerCreatedAlerts = "ControllerCreatedAlerts"
View Source
var ControllerId = ""
View Source
var CreateAppInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_CREATING: struct{}{},
}

Transition states indicate states in which the CRM is still busy.

View Source
var CreateCheckpointInfluxQueryTemplate = `SELECT %s from "%s" WHERE time >= '%s' AND time < '%s' order by time desc`
View Source
var CreateCloudletTransitions = map[dme.CloudletState]struct{}{}

Transition states indicate states in which the CRM is still busy.

View Source
var CreateClusterInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_CREATING: struct{}{},
}

Transition states indicate states in which the CRM is still busy.

View Source
var DeleteAppInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_DELETING: struct{}{},
}
View Source
var DeleteClusterInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_DELETING: struct{}{},
}
View Source
var ErrCtrlAlreadyInProgress = errors.New("Change already in progress")
View Source
var ErrCtrlUpgradeRequired = errors.New("data mode upgrade required")
View Source
var GetCheckpointInfluxQueryTemplate = `SELECT %s from "%s" WHERE "org"='%s' AND time <= '%s' order by time desc`
View Source
var InfluxMaximumTimestamp, _ = time.Parse(time.RFC3339, "2262-04-11T23:47:15Z")
View Source
var InfluxMinimumTimestamp, _ = time.Parse(time.RFC3339, "1677-09-21T00:13:44Z")

influx timestamp ranges can handle (64-bit int min in time form)

View Source
var NextCheckpoint = InfluxMaximumTimestamp //for unit tests, so getClusterCheckpoint will never sleep
View Source
var ObjBusyDeletionMsg = "busy, cannot be deleted"
View Source
var PrevCheckpoint = InfluxMinimumTimestamp
View Source
var RequireAppInstPortConsistency = false
View Source
var UpdateAppInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_UPDATING: struct{}{},
}
View Source
var UpdateCloudletTransitions = map[dme.CloudletState]struct{}{
	dme.CloudletState_CLOUDLET_STATE_UPGRADE: struct{}{},
}
View Source
var UpdateClusterInstTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_UPDATING: struct{}{},
}
View Source
var UpdateVMPoolTransitions = map[edgeproto.TrackedState]struct{}{
	edgeproto.TrackedState_UPDATING: struct{}{},
}

Transition states indicate states in which the CRM is still busy.

View Source
var VersionHash_UpgradeFuncs = []VersionUpgrade{
	{0, "d41d8cd98f00b204e9800998ecf8427e", nil, ""},
	{52, "c2d882033b0c14f28cece41cf4010060", nil, ""},
	{53, "14ae4c721c1bace6e8379d0061a72a77", UpgradeCrmOnEdge, "UpgradeCrmOnEdge"},
	{54, "eff9d3a6c74fd02840efce05d1984e8d", AddStaticFqdn, "AddStaticFqdn"},
	{55, "eac56710c013d954db31eeb306b514a4", InstanceKeysRegionScopedName, "InstanceKeysRegionScopedName"},
}

Functions

func AddStaticFqdn

func AddStaticFqdn(ctx context.Context, objStore objstore.KVStore, allApis *AllApis, sup *UpgradeSupport, dbModelID int32) error

func AppInstKeyName

func AppInstKeyName(ctx context.Context, objStore objstore.KVStore, allApis *AllApis, sup *UpgradeSupport, dbModelID int32) error

AppInstKeyName fixes an issue with the original AppInstKeyName upgrade function which failed to upgrade ClusterRefs properly, as it was looking for the wrong AppInst ref format.

func ControllerConnect

func ControllerConnect(ctx context.Context, addr string) (*grpc.ClientConn, error)

func CreateClusterUsageRecord

func CreateClusterUsageRecord(ctx context.Context, cluster *edgeproto.ClusterInst, endTime time.Time) error

func GetAppInstID

func GetAppInstID(ctx context.Context, appInst *edgeproto.AppInst, app *edgeproto.App, salt string, sanitizer NameSanitizer) (string, error)

GetAppInstID returns a string for this AppInst that is likely to be unique within the region. It does not guarantee uniqueness. The delimiter '.' is removed from the AppInstId so that it can be used to append further strings to this ID to build derived unique names. Salt can be used by the caller to add an extra field if needed to ensure uniqueness. In all cases, any requirements for uniqueness must be guaranteed by the caller. Name sanitization for the platform is performed

func GetPlatformVMsResources

func GetPlatformVMsResources(ctx context.Context, cloudletInfo *edgeproto.CloudletInfo) ([]edgeproto.VMResource, error)

func GetRootDir

func GetRootDir() string

func GetRunTimeStats

func GetRunTimeStats(usageType string, checkpoint, key interface{}, logs []client.Result, stats *RunTimeStats) error

func InitNotify

func InitNotify(metricsInflux *influxq.InfluxQ, edgeEventsInflux *influxq.InfluxQ, clientQ notify.RecvAppInstClientHandler, allApis *AllApis)

func InstanceKeysRegionScopedName

func InstanceKeysRegionScopedName(ctx context.Context, objStore objstore.KVStore, allApis *AllApis, sup *UpgradeSupport, dbModelID int32) error

InstanceKeysRegionScopedName deals with moving the CloudletKey out of the AppInst/ClusterInst Key and onto the object body, changing the unique key. Also, this requires the instance name to be unique within the entire region instead of within a cloudlet scope.

func RecordCloudletEvent

func RecordCloudletEvent(ctx context.Context, cloudletKey *edgeproto.CloudletKey, event cloudcommon.InstanceEvent, serverStatus string)

func Run

func Run()

func RunSingleUpgrade

func RunSingleUpgrade(ctx context.Context, objStore objstore.KVStore, allApis *AllApis, upgradeSupport *UpgradeSupport, fn VersionUpgradeFunc, upgradeID int32) error

Helper function to run a single upgrade function across all the elements of a KVStore fn will be called for each of the entries, and therefore it's up to the fn implementation to filter based on the prefix

func StartLocalRedisServer

func StartLocalRedisServer(opts ...process.StartOp) (*process.RedisCache, error)

func TestUpgradeExample

func TestUpgradeExample(ctx context.Context, objStore objstore.KVStore) error

func UpgradeCrmOnEdge

func UpgradeCrmOnEdge(ctx context.Context, objStore objstore.KVStore, allApis *AllApis, sup *UpgradeSupport, dbModelID int32) error

func ValidateContainerName

func ValidateContainerName(deployment, name string) error

Types

type AlertApi

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

func NewAlertApi

func NewAlertApi(sync *regiondata.Sync, all *AllApis) *AlertApi

func (*AlertApi) CleanupAppInstAlerts

func (s *AlertApi) CleanupAppInstAlerts(ctx context.Context, key *edgeproto.AppInstKey)

func (*AlertApi) CleanupCloudletAlerts

func (s *AlertApi) CleanupCloudletAlerts(ctx context.Context, key *edgeproto.CloudletKey)

func (*AlertApi) CleanupClusterInstAlerts

func (s *AlertApi) CleanupClusterInstAlerts(ctx context.Context, key *edgeproto.ClusterKey, cloudletKey *edgeproto.CloudletKey)

func (*AlertApi) Delete

func (s *AlertApi) Delete(ctx context.Context, in *edgeproto.Alert, rev int64)

func (*AlertApi) Flush

func (s *AlertApi) Flush(ctx context.Context, notifyId int64)

func (*AlertApi) Prune

func (s *AlertApi) Prune(ctx context.Context, keys map[edgeproto.AlertKey]struct{})

func (*AlertApi) ShowAlert

func (*AlertApi) StoreDelete

func (s *AlertApi) StoreDelete(ctx context.Context, in *edgeproto.Alert)

func (*AlertApi) StoreUpdate

func (s *AlertApi) StoreUpdate(ctx context.Context, old, new *edgeproto.Alert)

func (*AlertApi) Update

func (s *AlertApi) Update(ctx context.Context, in *edgeproto.Alert, rev int64)

type AlertPolicyApi

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

Should only be one of these instantiated in main

func NewAlertPolicyApi

func NewAlertPolicyApi(sync *regiondata.Sync, all *AllApis) *AlertPolicyApi

func (*AlertPolicyApi) CreateAlertPolicy

func (a *AlertPolicyApi) CreateAlertPolicy(ctx context.Context, in *edgeproto.AlertPolicy) (*edgeproto.Result, error)

func (*AlertPolicyApi) DeleteAlertPolicy

func (a *AlertPolicyApi) DeleteAlertPolicy(ctx context.Context, in *edgeproto.AlertPolicy) (res *edgeproto.Result, reterr error)

func (*AlertPolicyApi) UpdateAlertPolicy

func (a *AlertPolicyApi) UpdateAlertPolicy(ctx context.Context, in *edgeproto.AlertPolicy) (*edgeproto.Result, error)

type AllApis

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

func NewAllApis

func NewAllApis(sync *regiondata.Sync) *AllApis

func (*AllApis) GetAlertPolicyApi

func (s *AllApis) GetAlertPolicyApi() edgeproto.AlertPolicyApiServer

func (*AllApis) GetAppApi

func (s *AllApis) GetAppApi() edgeproto.AppApiServer

func (*AllApis) GetAppInstApi

func (s *AllApis) GetAppInstApi() edgeproto.AppInstApiServer

func (*AllApis) GetAutoProvPolicyApi

func (s *AllApis) GetAutoProvPolicyApi() edgeproto.AutoProvPolicyApiServer

func (*AllApis) GetAutoScalePolicyApi

func (s *AllApis) GetAutoScalePolicyApi() edgeproto.AutoScalePolicyApiServer

func (*AllApis) GetCloudletApi

func (s *AllApis) GetCloudletApi() edgeproto.CloudletApiServer

func (*AllApis) GetCloudletNodeApi

func (s *AllApis) GetCloudletNodeApi() edgeproto.CloudletNodeApiServer

func (*AllApis) GetCloudletPoolApi

func (s *AllApis) GetCloudletPoolApi() edgeproto.CloudletPoolApiServer

func (*AllApis) GetClusterInstApi

func (s *AllApis) GetClusterInstApi() edgeproto.ClusterInstApiServer

func (*AllApis) GetFlavorApi

func (s *AllApis) GetFlavorApi() edgeproto.FlavorApiServer

func (*AllApis) GetGPUDriverApi

func (s *AllApis) GetGPUDriverApi() edgeproto.GPUDriverApiServer

func (*AllApis) GetNetworkApi

func (s *AllApis) GetNetworkApi() edgeproto.NetworkApiServer

func (*AllApis) GetOperatorCodeApi

func (s *AllApis) GetOperatorCodeApi() edgeproto.OperatorCodeApiServer

func (*AllApis) GetResTagTableApi

func (s *AllApis) GetResTagTableApi() edgeproto.ResTagTableApiServer

func (*AllApis) GetTrustPolicyApi

func (s *AllApis) GetTrustPolicyApi() edgeproto.TrustPolicyApiServer

func (*AllApis) GetTrustPolicyExceptionApi

func (s *AllApis) GetTrustPolicyExceptionApi() edgeproto.TrustPolicyExceptionApiServer

func (*AllApis) GetVMPoolApi

func (s *AllApis) GetVMPoolApi() edgeproto.VMPoolApiServer

func (*AllApis) Start

func (s *AllApis) Start(ctx context.Context)

func (*AllApis) Stop

func (s *AllApis) Stop()

type AppApi

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

Should only be one of these instantiated in main

func NewAppApi

func NewAppApi(sync *regiondata.Sync, all *AllApis) *AppApi

func (*AppApi) AddAppAlertPolicy

func (s *AppApi) AddAppAlertPolicy(ctx context.Context, in *edgeproto.AppAlertPolicy) (*edgeproto.Result, error)

func (*AppApi) AddAppAutoProvPolicy

func (s *AppApi) AddAppAutoProvPolicy(ctx context.Context, in *edgeproto.AppAutoProvPolicy) (*edgeproto.Result, error)

func (*AppApi) AndroidPackageConflicts

func (s *AppApi) AndroidPackageConflicts(a *edgeproto.App) bool

AndroidPackageConflicts returns true if an app with a different developer+name has the same package. It is expect that different versions of the same app with the same package however so we do not do a full key comparison

func (*AppApi) AutoDeleteApps

func (s *AppApi) AutoDeleteApps(ctx context.Context, key *edgeproto.FlavorKey)

func (*AppApi) AutoDeleteAppsForOrganization

func (s *AppApi) AutoDeleteAppsForOrganization(ctx context.Context, org string)

func (*AppApi) CheckAppCompatibleWithTrustPolicy

func (s *AppApi) CheckAppCompatibleWithTrustPolicy(ctx context.Context, ckey *edgeproto.CloudletKey, app *edgeproto.App, trustPolicy *edgeproto.TrustPolicy) error

func (*AppApi) CreateApp

func (s *AppApi) CreateApp(ctx context.Context, in *edgeproto.App) (res *edgeproto.Result, reterr error)

func (*AppApi) CreateAppCheckpoint

func (s *AppApi) CreateAppCheckpoint(ctx context.Context, timestamp time.Time) error

This is checkpointing for all appinsts

func (*AppApi) CreateAppUsageRecord

func (s *AppApi) CreateAppUsageRecord(ctx context.Context, appInst *edgeproto.AppInst, endTime time.Time) error

func (*AppApi) DeleteApp

func (s *AppApi) DeleteApp(ctx context.Context, in *edgeproto.App) (res *edgeproto.Result, reterr error)

func (*AppApi) Get

func (s *AppApi) Get(key *edgeproto.AppKey, buf *edgeproto.App) bool

func (*AppApi) GetAllApps

func (s *AppApi) GetAllApps(apps map[edgeproto.AppKey]*edgeproto.App)

func (*AppApi) HasApp

func (s *AppApi) HasApp(key *edgeproto.AppKey) bool

func (*AppApi) RemoveAppAlertPolicy

func (s *AppApi) RemoveAppAlertPolicy(ctx context.Context, in *edgeproto.AppAlertPolicy) (*edgeproto.Result, error)

func (*AppApi) RemoveAppAutoProvPolicy

func (s *AppApi) RemoveAppAutoProvPolicy(ctx context.Context, in *edgeproto.AppAutoProvPolicy) (*edgeproto.Result, error)

func (*AppApi) ShowApp

func (*AppApi) UpdateApp

func (s *AppApi) UpdateApp(ctx context.Context, in *edgeproto.App) (*edgeproto.Result, error)

func (*AppApi) UsesAlertPolicy

func (s *AppApi) UsesAlertPolicy(key *edgeproto.AlertPolicyKey) *edgeproto.AppKey

func (*AppApi) UsesAutoProvPolicy

func (s *AppApi) UsesAutoProvPolicy(key *edgeproto.PolicyKey) *edgeproto.AppKey

func (*AppApi) UsesFlavor

func (s *AppApi) UsesFlavor(key *edgeproto.FlavorKey) *edgeproto.AppKey

type AppCheckpoint

type AppCheckpoint struct {
	Timestamp time.Time
	Org       string
	Keys      []*edgeproto.AppInstKey
	Status    []string // either cloudcommon.InstanceUp or cloudcommon.InstanceDown
}

func GetAppCheckpoint

func GetAppCheckpoint(ctx context.Context, org string, timestamp time.Time) (*AppCheckpoint, error)

returns all the checkpointed appinsts of the most recent checkpoint with regards to timestamp

type AppInstApi

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

func NewAppInstApi

func NewAppInstApi(sync *regiondata.Sync, all *AllApis) *AppInstApi

func (*AppInstApi) AutoDelete

func (s *AppInstApi) AutoDelete(ctx context.Context, appinsts []*edgeproto.AppInst) error

func (*AppInstApi) AutoDeleteAppInsts

func (s *AppInstApi) AutoDeleteAppInsts(ctx context.Context, dynInsts map[edgeproto.AppInstKey]struct{}, crmoverride edgeproto.CRMOverride, cb edgeproto.ClusterInstApi_DeleteClusterInstServer) error

func (*AppInstApi) CheckCloudletAppinstsCompatibleWithTrustPolicy

func (s *AppInstApi) CheckCloudletAppinstsCompatibleWithTrustPolicy(ctx context.Context, ckey *edgeproto.CloudletKey, TrustPolicy *edgeproto.TrustPolicy) error

func (*AppInstApi) CreateAppInst

func (*AppInstApi) DeleteAppInst

func (*AppInstApi) DeleteFromInfo

func (s *AppInstApi) DeleteFromInfo(ctx context.Context, in *edgeproto.AppInstInfo)

func (*AppInstApi) Get

func (s *AppInstApi) Get(key *edgeproto.AppInstKey, val *edgeproto.AppInst) bool

func (*AppInstApi) HandleFedAppInstEvent

func (s *AppInstApi) HandleFedAppInstEvent(ctx context.Context, in *edgeproto.FedAppInstEvent) (*edgeproto.Result, error)

Handle AppInst status callbacks from Federation Partner

func (*AppInstApi) HasKey

func (s *AppInstApi) HasKey(key *edgeproto.AppInstKey) bool

func (*AppInstApi) HealthCheckUpdate

func (s *AppInstApi) HealthCheckUpdate(ctx context.Context, key *edgeproto.AppInstKey, state dme.HealthCheck)

func (*AppInstApi) RecordAppInstEvent

func (s *AppInstApi) RecordAppInstEvent(ctx context.Context, appInst *edgeproto.AppInst, event cloudcommon.InstanceEvent, serverStatus string)

func (*AppInstApi) RefreshAppInst

func (*AppInstApi) ReplaceErrorState

func (s *AppInstApi) ReplaceErrorState(ctx context.Context, in *edgeproto.AppInst, newState edgeproto.TrackedState)

func (*AppInstApi) ShowAppInst

func (*AppInstApi) UpdateAppInst

func (*AppInstApi) UpdateFromInfo

func (s *AppInstApi) UpdateFromInfo(ctx context.Context, in *edgeproto.AppInstInfo)

func (*AppInstApi) UsesClusterInst

func (s *AppInstApi) UsesClusterInst(callerOrg string, in *edgeproto.ClusterKey) bool

func (*AppInstApi) UsesFlavor

func (s *AppInstApi) UsesFlavor(key *edgeproto.FlavorKey) *edgeproto.AppInstKey

type AppInstClientApi

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

func NewAppInstClientApi

func NewAppInstClientApi(all *AllApis) *AppInstClientApi

func (*AppInstClientApi) AddAppInstClient

func (s *AppInstClientApi) AddAppInstClient(ctx context.Context, client *edgeproto.AppInstClient)

func (*AppInstClientApi) ClearRecvChan

Returns number of channels in the list that are left

func (*AppInstClientApi) Flush

func (s *AppInstClientApi) Flush(ctx context.Context, notifyId int64)

func (*AppInstClientApi) Prune

func (s *AppInstClientApi) Prune(ctx context.Context, keys map[edgeproto.AppInstClientKey]struct{})

func (*AppInstClientApi) RecvAppInstClient

func (s *AppInstClientApi) RecvAppInstClient(ctx context.Context, client *edgeproto.AppInstClient)

func (*AppInstClientApi) SetRecvChan

type AppInstClientKeyApi

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

func NewAppInstClientKeyApi

func NewAppInstClientKeyApi(sync *regiondata.Sync, all *AllApis) *AppInstClientKeyApi

func (*AppInstClientKeyApi) Delete

func (*AppInstClientKeyApi) Flush

func (s *AppInstClientKeyApi) Flush(ctx context.Context, notifyId int64)

func (*AppInstClientKeyApi) HasKey

func (*AppInstClientKeyApi) Prune

func (s *AppInstClientKeyApi) Prune(ctx context.Context, keys map[edgeproto.AppInstKey]struct{})

func (*AppInstClientKeyApi) Update

type AppInstIDSanitizer

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

func NewAppInstIDSanitizer

func NewAppInstIDSanitizer(ctx context.Context, appInstApi *AppInstApi, cloudlet *edgeproto.Cloudlet) *AppInstIDSanitizer

func (*AppInstIDSanitizer) NameSanitize

func (s *AppInstIDSanitizer) NameSanitize(name string) (string, error)

type AppInstInfoApi

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

func NewAppInstInfoApi

func NewAppInstInfoApi(sync *regiondata.Sync, all *AllApis) *AppInstInfoApi

func (*AppInstInfoApi) Delete

func (s *AppInstInfoApi) Delete(ctx context.Context, in *edgeproto.AppInstInfo, rev int64)

func (*AppInstInfoApi) Flush

func (s *AppInstInfoApi) Flush(ctx context.Context, notifyId int64)

func (*AppInstInfoApi) Prune

func (s *AppInstInfoApi) Prune(ctx context.Context, keys map[edgeproto.AppInstKey]struct{})

func (*AppInstInfoApi) Update

func (s *AppInstInfoApi) Update(ctx context.Context, in *edgeproto.AppInstInfo, rev int64)

type AppInstLatencyApi

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

func NewAppInstLatencyApi

func NewAppInstLatencyApi(sync *regiondata.Sync, all *AllApis) *AppInstLatencyApi

func (*AppInstLatencyApi) RequestAppInstLatency

func (s *AppInstLatencyApi) RequestAppInstLatency(ctx context.Context, in *edgeproto.AppInstLatency) (*edgeproto.Result, error)

type AppInstRefKeyV1

type AppInstRefKeyV1 struct {
	AppKey     edgeproto.AppKey    `json:"app_key"`
	ClusterKey ClusterInstRefKeyV1 `json:"cluster_inst_key"`
}

New AppInstRefKey is the AppInst Name and Org

type AppInstRefsApi

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

func NewAppInstRefsApi

func NewAppInstRefsApi(sync *regiondata.Sync, all *AllApis) *AppInstRefsApi

type AutoClusterType

type AutoClusterType int
const (
	NoAutoCluster AutoClusterType = iota
	ChooseAutoCluster
	ReservableAutoCluster
	MultiTenantAutoCluster
)

type AutoProvInfoApi

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

func NewAutoProvInfoApi

func NewAutoProvInfoApi(sync *regiondata.Sync, all *AllApis) *AutoProvInfoApi

func (*AutoProvInfoApi) Delete

func (s *AutoProvInfoApi) Delete(ctx context.Context, in *edgeproto.AutoProvInfo, rev int64)

func (*AutoProvInfoApi) Flush

func (s *AutoProvInfoApi) Flush(ctx context.Context, notifyId int64)

func (*AutoProvInfoApi) Prune

func (s *AutoProvInfoApi) Prune(ctx context.Context, keys map[edgeproto.CloudletKey]struct{})

func (*AutoProvInfoApi) Update

func (s *AutoProvInfoApi) Update(ctx context.Context, in *edgeproto.AutoProvInfo, rev int64)

type AutoProvPolicyApi

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

func NewAutoProvPolicyApi

func NewAutoProvPolicyApi(sync *regiondata.Sync, all *AllApis) *AutoProvPolicyApi

func (*AutoProvPolicyApi) AddAutoProvPolicyCloudlet

func (s *AutoProvPolicyApi) AddAutoProvPolicyCloudlet(ctx context.Context, in *edgeproto.AutoProvPolicyCloudlet) (*edgeproto.Result, error)

func (*AutoProvPolicyApi) CreateAutoProvPolicy

func (s *AutoProvPolicyApi) CreateAutoProvPolicy(ctx context.Context, in *edgeproto.AutoProvPolicy) (*edgeproto.Result, error)

func (*AutoProvPolicyApi) DeleteAutoProvPolicy

func (s *AutoProvPolicyApi) DeleteAutoProvPolicy(ctx context.Context, in *edgeproto.AutoProvPolicy) (res *edgeproto.Result, reterr error)

func (*AutoProvPolicyApi) RecvAutoProvCounts

func (s *AutoProvPolicyApi) RecvAutoProvCounts(ctx context.Context, msg *edgeproto.AutoProvCounts)

func (*AutoProvPolicyApi) RemoveAutoProvPolicyCloudlet

func (s *AutoProvPolicyApi) RemoveAutoProvPolicyCloudlet(ctx context.Context, in *edgeproto.AutoProvPolicyCloudlet) (*edgeproto.Result, error)

func (*AutoProvPolicyApi) STMFind

func (s *AutoProvPolicyApi) STMFind(stm concurrency.STM, name, dev string, policy *edgeproto.AutoProvPolicy) error

func (*AutoProvPolicyApi) SetInfluxQ

func (s *AutoProvPolicyApi) SetInfluxQ(influxQ *influxq.InfluxQ)

func (*AutoProvPolicyApi) UpdateAutoProvPolicy

func (s *AutoProvPolicyApi) UpdateAutoProvPolicy(ctx context.Context, in *edgeproto.AutoProvPolicy) (*edgeproto.Result, error)

func (*AutoProvPolicyApi) UsesCloudlet

func (s *AutoProvPolicyApi) UsesCloudlet(key *edgeproto.CloudletKey) []edgeproto.PolicyKey

type AutoScalePolicyApi

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

func NewAutoScalePolicyApi

func NewAutoScalePolicyApi(sync *regiondata.Sync, all *AllApis) *AutoScalePolicyApi

func (*AutoScalePolicyApi) CreateAutoScalePolicy

func (s *AutoScalePolicyApi) CreateAutoScalePolicy(ctx context.Context, in *edgeproto.AutoScalePolicy) (*edgeproto.Result, error)

func (*AutoScalePolicyApi) DeleteAutoScalePolicy

func (s *AutoScalePolicyApi) DeleteAutoScalePolicy(ctx context.Context, in *edgeproto.AutoScalePolicy) (res *edgeproto.Result, reterr error)

func (*AutoScalePolicyApi) UpdateAutoScalePolicy

func (s *AutoScalePolicyApi) UpdateAutoScalePolicy(ctx context.Context, in *edgeproto.AutoScalePolicy) (*edgeproto.Result, error)

type CallContext

type CallContext struct {
	Undo                   bool
	CRMUndo                bool
	Override               edgeproto.CRMOverride
	AutoCluster            bool
	SkipCloudletReadyCheck bool
}

func DefCallContext

func DefCallContext() *CallContext

func (*CallContext) Clone

func (c *CallContext) Clone() *CallContext

func (*CallContext) SetOverride

func (c *CallContext) SetOverride(o *edgeproto.CRMOverride)

SetOverride takes the override specified from the user, and removes it from the input object. Because there may be multiple calls to this function, we only modify the override if it's non-default. Override is only meant as a switch to the current operation, not as a persistent state on the object.

func (*CallContext) WithAutoCluster

func (c *CallContext) WithAutoCluster() *CallContext

func (*CallContext) WithCRMUndo

func (c *CallContext) WithCRMUndo() *CallContext

Normally, the CRM change is the last change in the API call, and if it fails, CRM will clean up after itself. Thus the undo function should skip any CRM changes. However, in some cases (like autocluster), the CRM change is not the last change, and we may hit other failures after the CRM change succeeds. In that case, we need to have the undo function apply the CRM changes.

func (*CallContext) WithUndo

func (c *CallContext) WithUndo() *CallContext

type CbWrapper

type CbWrapper struct {
	GenericCb
	// contains filtered or unexported fields
}

func (*CbWrapper) Send

func (s *CbWrapper) Send(res *edgeproto.Result) error

type Checkpointer

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

func NewCheckpointer

func NewCheckpointer(events *influxq.InfluxQ, clusterInstApi *ClusterInstApi) *Checkpointer

func (*Checkpointer) GetInterval

func (s *Checkpointer) GetInterval() time.Duration

func (*Checkpointer) Run

func (s *Checkpointer) Run(ctx context.Context)

func (*Checkpointer) Start

func (s *Checkpointer) Start()

func (*Checkpointer) StartSpan

func (s *Checkpointer) StartSpan() opentracing.Span

func (*Checkpointer) Stop

func (s *Checkpointer) Stop()

type CleanupStreamAction

type CleanupStreamAction bool
var (
	CleanupStream   CleanupStreamAction = true
	NoCleanupStream CleanupStreamAction = false
)

type CloudletApi

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

func NewCloudletApi

func NewCloudletApi(sync *regiondata.Sync, all *AllApis) *CloudletApi

func (*CloudletApi) AddCloudletAllianceOrg

func (s *CloudletApi) AddCloudletAllianceOrg(ctx context.Context, in *edgeproto.CloudletAllianceOrg) (*edgeproto.Result, error)

func (*CloudletApi) AddCloudletResMapping

func (s *CloudletApi) AddCloudletResMapping(ctx context.Context, in *edgeproto.CloudletResMap) (*edgeproto.Result, error)

func (*CloudletApi) ChangeCloudletDNS

func (s *CloudletApi) ChangeCloudletDNS(key *edgeproto.CloudletKey, inCb edgeproto.CloudletApi_ChangeCloudletDNSServer) (reterr error)

func (*CloudletApi) CreateCloudlet

func (*CloudletApi) DeleteCloudlet

func (*CloudletApi) FindFlavorMatch

func (s *CloudletApi) FindFlavorMatch(ctx context.Context, in *edgeproto.FlavorMatch) (*edgeproto.FlavorMatch, error)

func (*CloudletApi) GenerateAccessKey

func (s *CloudletApi) GenerateAccessKey(ctx context.Context, key *edgeproto.CloudletKey) (*edgeproto.Result, error)

func (*CloudletApi) Get

func (*CloudletApi) GetAccessData

func (*CloudletApi) GetCas

Get CAs for RegionalCloudlet service. To match the Vault API, each request only returns one CA.

func (*CloudletApi) GetCloudletForVMPool

func (s *CloudletApi) GetCloudletForVMPool(vmPoolKey *edgeproto.VMPoolKey) *edgeproto.Cloudlet

func (*CloudletApi) GetCloudletGPUDriverLicenseConfig

func (s *CloudletApi) GetCloudletGPUDriverLicenseConfig(ctx context.Context, key *edgeproto.CloudletKey) (*edgeproto.Result, error)

func (*CloudletApi) GetCloudletManifest

func (s *CloudletApi) GetCloudletManifest(ctx context.Context, key *edgeproto.CloudletKey) (*edgeproto.CloudletManifest, error)

func (*CloudletApi) GetCloudletProps

func (s *CloudletApi) GetCloudletProps(ctx context.Context, in *edgeproto.CloudletProps) (*edgeproto.CloudletProps, error)

func (*CloudletApi) GetCloudletResourceInfo

func (s *CloudletApi) GetCloudletResourceInfo(ctx context.Context, stm concurrency.STM, cloudlet *edgeproto.Cloudlet, vmResources []edgeproto.VMResource, infraResMap map[string]edgeproto.InfraResource) (map[string]edgeproto.InfraResource, error)

func (*CloudletApi) GetCloudletResourceUsage

func (s *CloudletApi) GetCloudletResourceUsage(ctx context.Context, usage *edgeproto.CloudletResourceUsage) (*edgeproto.CloudletResourceUsage, error)

func (*CloudletApi) GetResourceUsage

func (s *CloudletApi) GetResourceUsage(ctx context.Context, stm concurrency.STM, cloudlet *edgeproto.Cloudlet, infraResInfo []edgeproto.InfraResource, allVmResources []edgeproto.VMResource, infraUsage bool) ([]edgeproto.InfraResource, error)

Get actual resource info used by the cloudlet

func (*CloudletApi) HasKey

func (s *CloudletApi) HasKey(key *edgeproto.CloudletKey) bool

func (*CloudletApi) InitVaultClient

func (s *CloudletApi) InitVaultClient(ctx context.Context) error

func (*CloudletApi) IssueCert

Issue certificate to RegionalCloudlet service.

func (*CloudletApi) RemoveCloudletAllianceOrg

func (s *CloudletApi) RemoveCloudletAllianceOrg(ctx context.Context, in *edgeproto.CloudletAllianceOrg) (*edgeproto.Result, error)

func (*CloudletApi) RemoveCloudletResMapping

func (s *CloudletApi) RemoveCloudletResMapping(ctx context.Context, in *edgeproto.CloudletResMap) (*edgeproto.Result, error)

func (*CloudletApi) ReplaceErrorState

func (s *CloudletApi) ReplaceErrorState(ctx context.Context, in *edgeproto.Cloudlet, newState edgeproto.TrackedState)

func (*CloudletApi) RevokeAccessKey

func (s *CloudletApi) RevokeAccessKey(ctx context.Context, key *edgeproto.CloudletKey) (*edgeproto.Result, error)

func (*CloudletApi) SetState

func (s *CloudletApi) SetState(ctx context.Context, in *edgeproto.Cloudlet, newState edgeproto.TrackedState)

func (*CloudletApi) ShowCloudlet

func (*CloudletApi) UpdateAppInstLocations

func (s *CloudletApi) UpdateAppInstLocations(ctx context.Context, in *edgeproto.Cloudlet)

func (*CloudletApi) UpdateCloudlet

func (s *CloudletApi) UpdateCloudlet(in *edgeproto.Cloudlet, inCb edgeproto.CloudletApi_UpdateCloudletServer) (reterr error)

func (*CloudletApi) UpdateCloudletsUsingTrustPolicy

func (s *CloudletApi) UpdateCloudletsUsingTrustPolicy(ctx context.Context, trustPolicy *edgeproto.TrustPolicy, cb edgeproto.TrustPolicyApi_CreateTrustPolicyServer) error

func (*CloudletApi) UpgradeAccessKey

func (*CloudletApi) UsesFlavor

func (s *CloudletApi) UsesFlavor(key *edgeproto.FlavorKey) *edgeproto.CloudletKey

func (*CloudletApi) UsesGPUDriver

func (s *CloudletApi) UsesGPUDriver(driverKey *edgeproto.GPUDriverKey) (bool, []string)

func (*CloudletApi) UsesPlatformFeatures

func (s *CloudletApi) UsesPlatformFeatures(pfKey *edgeproto.PlatformFeaturesKey) (bool, []string)

func (*CloudletApi) UsesResTagTable

func (s *CloudletApi) UsesResTagTable(key *edgeproto.ResTagTableKey) *edgeproto.CloudletKey

func (*CloudletApi) UsesTrustPolicy

func (s *CloudletApi) UsesTrustPolicy(key *edgeproto.PolicyKey, stateMatch edgeproto.TrackedState) *edgeproto.CloudletKey

func (*CloudletApi) ValidateCloudletsUsingTrustPolicy

func (s *CloudletApi) ValidateCloudletsUsingTrustPolicy(ctx context.Context, trustPolicy *edgeproto.TrustPolicy) error

func (*CloudletApi) VerifyTrustPoliciesForAppInsts

func (s *CloudletApi) VerifyTrustPoliciesForAppInsts(ctx context.Context, app *edgeproto.App, appInsts map[edgeproto.AppInstKey]struct{}) error

func (*CloudletApi) WaitForTrustPolicyState

func (s *CloudletApi) WaitForTrustPolicyState(ctx context.Context, key *edgeproto.CloudletKey, targetState edgeproto.TrackedState, errorState edgeproto.TrackedState, timeout time.Duration) error

type CloudletCertRefreshTaskable

type CloudletCertRefreshTaskable struct {
	CloudletTaskableHelper
}

func NewCloudletCertRefreshTaskable

func NewCloudletCertRefreshTaskable(all *AllApis) *CloudletCertRefreshTaskable

NewCloudletCertRefreshTaskable returns a PeriodicTaskable for refreshing cloudlet certificates

func (*CloudletCertRefreshTaskable) GetInterval

func (s *CloudletCertRefreshTaskable) GetInterval() time.Duration

func (*CloudletCertRefreshTaskable) StartSpan

func (s *CloudletCertRefreshTaskable) StartSpan() opentracing.Span

type CloudletInfoApi

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

func NewCloudletInfoApi

func NewCloudletInfoApi(sync *regiondata.Sync, all *AllApis) *CloudletInfoApi

func (*CloudletInfoApi) ClearCloudletAndAppInstDownAlerts

func (s *CloudletInfoApi) ClearCloudletAndAppInstDownAlerts(ctx context.Context, in *edgeproto.CloudletInfo)

func (*CloudletInfoApi) Del

func (s *CloudletInfoApi) Del(ctx context.Context, key *edgeproto.CloudletKey, wait func(int64))

func (*CloudletInfoApi) Delete

func (s *CloudletInfoApi) Delete(ctx context.Context, in *edgeproto.CloudletInfo, rev int64)

Delete from notify just marks the cloudlet offline

func (*CloudletInfoApi) EvictCloudletInfo

func (s *CloudletInfoApi) EvictCloudletInfo(ctx context.Context, in *edgeproto.CloudletInfo) (*edgeproto.Result, error)

func (*CloudletInfoApi) FireCloudletAndAppInstDownAlerts

func (s *CloudletInfoApi) FireCloudletAndAppInstDownAlerts(ctx context.Context, in *edgeproto.CloudletInfo)

func (*CloudletInfoApi) Flush

func (s *CloudletInfoApi) Flush(ctx context.Context, notifyId int64)

func (*CloudletInfoApi) InjectCloudletInfo

func (s *CloudletInfoApi) InjectCloudletInfo(ctx context.Context, in *edgeproto.CloudletInfo) (*edgeproto.Result, error)

func (*CloudletInfoApi) Prune

func (s *CloudletInfoApi) Prune(ctx context.Context, keys map[edgeproto.CloudletKey]struct{})

func (*CloudletInfoApi) Update

func (s *CloudletInfoApi) Update(ctx context.Context, in *edgeproto.CloudletInfo, rev int64)

func (*CloudletInfoApi) UpdateFields

func (s *CloudletInfoApi) UpdateFields(ctx context.Context, in *edgeproto.CloudletInfo, rev int64)

func (*CloudletInfoApi) UpdateRPC

func (s *CloudletInfoApi) UpdateRPC(ctx context.Context, in *edgeproto.CloudletInfo)

type CloudletNodeApi

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

func NewCloudletNodeApi

func NewCloudletNodeApi(sync *regiondata.Sync, all *AllApis) *CloudletNodeApi

func (*CloudletNodeApi) CreateCloudletNode

func (s *CloudletNodeApi) CreateCloudletNode(ctx context.Context, in *edgeproto.CloudletNode) (*edgeproto.Result, error)

func (*CloudletNodeApi) CreateCloudletNodeReq

func (s *CloudletNodeApi) CreateCloudletNodeReq(ctx context.Context, node *edgeproto.CloudletNode) (string, error)

func (*CloudletNodeApi) DeleteCloudletNode

func (s *CloudletNodeApi) DeleteCloudletNode(ctx context.Context, in *edgeproto.CloudletNode) (*edgeproto.Result, error)

func (*CloudletNodeApi) DeleteCloudletNodeReq

func (s *CloudletNodeApi) DeleteCloudletNodeReq(ctx context.Context, key *edgeproto.CloudletNodeKey) error

func (*CloudletNodeApi) UpdateCloudletNode

func (s *CloudletNodeApi) UpdateCloudletNode(ctx context.Context, in *edgeproto.CloudletNode) (*edgeproto.Result, error)

type CloudletPoolApi

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

func NewCloudletPoolApi

func NewCloudletPoolApi(sync *regiondata.Sync, all *AllApis) *CloudletPoolApi

func (*CloudletPoolApi) AddCloudletPoolMember

func (s *CloudletPoolApi) AddCloudletPoolMember(ctx context.Context, in *edgeproto.CloudletPoolMember) (*edgeproto.Result, error)

func (*CloudletPoolApi) CreateCloudletPool

func (s *CloudletPoolApi) CreateCloudletPool(ctx context.Context, in *edgeproto.CloudletPool) (*edgeproto.Result, error)

func (*CloudletPoolApi) DeleteCloudletPool

func (s *CloudletPoolApi) DeleteCloudletPool(ctx context.Context, in *edgeproto.CloudletPool) (res *edgeproto.Result, reterr error)

func (*CloudletPoolApi) GetCloudletPoolKeysForCloudletKey

func (s *CloudletPoolApi) GetCloudletPoolKeysForCloudletKey(in *edgeproto.CloudletKey) []edgeproto.CloudletPoolKey

func (*CloudletPoolApi) HasCloudletPool

func (s *CloudletPoolApi) HasCloudletPool(key *edgeproto.CloudletPoolKey) bool

func (*CloudletPoolApi) RemoveCloudletPoolMember

func (s *CloudletPoolApi) RemoveCloudletPoolMember(ctx context.Context, in *edgeproto.CloudletPoolMember) (*edgeproto.Result, error)

func (*CloudletPoolApi) UpdateCloudletPool

func (s *CloudletPoolApi) UpdateCloudletPool(ctx context.Context, in *edgeproto.CloudletPool) (*edgeproto.Result, error)

func (*CloudletPoolApi) UsesCloudlet

type CloudletRefsApi

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

func NewCloudletRefsApi

func NewCloudletRefsApi(sync *regiondata.Sync, all *AllApis) *CloudletRefsApi

func (*CloudletRefsApi) Delete

func (s *CloudletRefsApi) Delete(ctx context.Context, key *edgeproto.CloudletKey, wait func(int64))

type CloudletRefsV1

type CloudletRefsV1 struct {
	ClusterInsts []ClusterInstRefKeyV1 `json:"cluster_insts"`
	VmAppInsts   []AppInstRefKeyV1     `json:"vm_app_insts"`
	K8SAppInsts  []AppInstRefKeyV1     `json:"k8s_app_insts"`
}

type CloudletTaskableHelper

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

CloudletTaskableHelper provides common code for any periodic cloudlet task

func (*CloudletTaskableHelper) Run

type ClusterCheckpoint

type ClusterCheckpoint struct {
	Timestamp time.Time
	Org       string
	Keys      []*edgeproto.ClusterKey
	Status    []string // either cloudcommon.InstanceUp or cloudcommon.InstanceDown
}

func GetClusterCheckpoint

func GetClusterCheckpoint(ctx context.Context, org string, timestamp time.Time) (*ClusterCheckpoint, error)

returns all the checkpointed clusterinsts of the most recent checkpoint with regards to timestamp

type ClusterInstApi

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

func NewClusterInstApi

func NewClusterInstApi(sync *regiondata.Sync, all *AllApis) *ClusterInstApi

func (*ClusterInstApi) CreateClusterCheckpoint

func (s *ClusterInstApi) CreateClusterCheckpoint(ctx context.Context, timestamp time.Time) error

This is checkpointing for the usage api, from month to month

func (*ClusterInstApi) DeleteFromInfo

func (s *ClusterInstApi) DeleteFromInfo(ctx context.Context, in *edgeproto.ClusterInstInfo)

func (*ClusterInstApi) DeleteIdleReservableClusterInsts

func (s *ClusterInstApi) DeleteIdleReservableClusterInsts(ctx context.Context, in *edgeproto.IdleReservableClusterInsts) (*edgeproto.Result, error)

func (*ClusterInstApi) Get

func (*ClusterInstApi) GetRootLBFlavorInfo

func (s *ClusterInstApi) GetRootLBFlavorInfo(ctx context.Context, stm concurrency.STM, cloudlet *edgeproto.Cloudlet, cloudletInfo *edgeproto.CloudletInfo) (*edgeproto.FlavorInfo, error)

func (*ClusterInstApi) HasKey

func (s *ClusterInstApi) HasKey(key *edgeproto.ClusterKey) bool

func (*ClusterInstApi) RecordClusterInstEvent

func (s *ClusterInstApi) RecordClusterInstEvent(ctx context.Context, cluster *edgeproto.ClusterInst, event cloudcommon.InstanceEvent, serverStatus string)

func (*ClusterInstApi) ReplaceErrorState

func (s *ClusterInstApi) ReplaceErrorState(ctx context.Context, in *edgeproto.ClusterInst, newState edgeproto.TrackedState)

func (*ClusterInstApi) UpdateFromInfo

func (s *ClusterInstApi) UpdateFromInfo(ctx context.Context, in *edgeproto.ClusterInstInfo)

func (*ClusterInstApi) UsesAutoScalePolicy

func (s *ClusterInstApi) UsesAutoScalePolicy(key *edgeproto.PolicyKey) *edgeproto.ClusterKey

func (*ClusterInstApi) UsesFlavor

func (s *ClusterInstApi) UsesFlavor(key *edgeproto.FlavorKey) *edgeproto.ClusterKey

func (*ClusterInstApi) UsesNetwork

func (s *ClusterInstApi) UsesNetwork(networkKey *edgeproto.NetworkKey) *edgeproto.ClusterKey

type ClusterInstInfoApi

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

func NewClusterInstInfoApi

func NewClusterInstInfoApi(sync *regiondata.Sync, all *AllApis) *ClusterInstInfoApi

func (*ClusterInstInfoApi) Delete

func (*ClusterInstInfoApi) Flush

func (s *ClusterInstInfoApi) Flush(ctx context.Context, notifyId int64)

func (*ClusterInstInfoApi) Prune

func (s *ClusterInstInfoApi) Prune(ctx context.Context, keys map[edgeproto.ClusterKey]struct{})

func (*ClusterInstInfoApi) Update

type ClusterInstRefKeyV1

type ClusterInstRefKeyV1 struct {
	ClusterKey   edgeproto.ClusterKeyV1 `json:"cluster_key"`
	Organization string                 `json:"organization,omitempty"`
}

New ClusterInstRefKey is just the ClusterKey

type ClusterRefsApi

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

func NewClusterRefsApi

func NewClusterRefsApi(sync *regiondata.Sync, all *AllApis) *ClusterRefsApi

type ControllerApi

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

func NewControllerApi

func NewControllerApi(sync *regiondata.Sync, all *AllApis) *ControllerApi

func (*ControllerApi) RunJobs

func (s *ControllerApi) RunJobs(ctx context.Context, run func(ctx context.Context, arg interface{}, addr string) error, arg interface{}) error

RunJobs spawns a thread per controller to run the passed in function. RunJobs blocks until all threads are done.

func (*ControllerApi) ShowController

type ControllerMetricsReceiver

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

func NewControllerMetricsReceiver

func NewControllerMetricsReceiver(metricsInflux *influxq.InfluxQ, edgeEventsInflux *influxq.InfluxQ) *ControllerMetricsReceiver

func (*ControllerMetricsReceiver) RecvMetric

func (c *ControllerMetricsReceiver) RecvMetric(ctx context.Context, metric *edgeproto.Metric)

Send metric to correct influxdb

type DebugApi

type DebugApi struct{}

func (*DebugApi) DisableDebugLevels

func (*DebugApi) EnableDebugLevels

func (*DebugApi) RunDebug

func (*DebugApi) ShowDebugLevels

type DeviceApi

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

func NewDeviceApi

func NewDeviceApi(sync *regiondata.Sync, all *AllApis) *DeviceApi

func (*DeviceApi) CreateDevice

func (s *DeviceApi) CreateDevice(ctx context.Context, in *edgeproto.Device) (*edgeproto.Result, error)

func (*DeviceApi) Delete

func (s *DeviceApi) Delete(ctx context.Context, in *edgeproto.Device, rev int64)

func (*DeviceApi) EvictDevice

func (s *DeviceApi) EvictDevice(ctx context.Context, in *edgeproto.Device) (*edgeproto.Result, error)

This api deletes the device from the controller cache

func (*DeviceApi) Flush

func (s *DeviceApi) Flush(ctx context.Context, notifyId int64)

func (*DeviceApi) HasDevice

func (s *DeviceApi) HasDevice(key *edgeproto.DeviceKey) bool

func (*DeviceApi) InjectDevice

func (s *DeviceApi) InjectDevice(ctx context.Context, in *edgeproto.Device) (*edgeproto.Result, error)

func (*DeviceApi) Prune

func (s *DeviceApi) Prune(ctx context.Context, keys map[edgeproto.DeviceKey]struct{})

func (*DeviceApi) ShowDevice

func (*DeviceApi) ShowDeviceReport

Show devices that showed up in this timestamp

func (*DeviceApi) Update

func (s *DeviceApi) Update(ctx context.Context, in *edgeproto.Device, rev int64)

Does the same as create - once the device is stored it's there forever

type DummyInfoResponder

type DummyInfoResponder struct {
	CloudletCache        *edgeproto.CloudletCache
	AppInstCache         *edgeproto.AppInstCache
	AppInstInfoCache     edgeproto.AppInstInfoCache
	ClusterInstCache     *edgeproto.ClusterInstCache
	ClusterInstInfoCache edgeproto.ClusterInstInfoCache
	RecvAppInstInfo      notify.RecvAppInstInfoHandler
	RecvClusterInstInfo  notify.RecvClusterInstInfoHandler
	VMPoolCache          *edgeproto.VMPoolCache
	VMPoolInfoCache      edgeproto.VMPoolInfoCache
	RecvVMPoolInfo       notify.RecvVMPoolInfoHandler
	// contains filtered or unexported fields
}

func DefaultDummyInfoResponder

func DefaultDummyInfoResponder(apis *AllApis) *DummyInfoResponder

func (*DummyInfoResponder) InitDummyInfoResponder

func (d *DummyInfoResponder) InitDummyInfoResponder()

func (*DummyInfoResponder) SetPause

func (d *DummyInfoResponder) SetPause(enable bool)

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

func (*DummyInfoResponder) SetSimulateAppCreateFailure

func (d *DummyInfoResponder) SetSimulateAppCreateFailure(state bool)

func (*DummyInfoResponder) SetSimulateAppDeleteFailure

func (d *DummyInfoResponder) SetSimulateAppDeleteFailure(state bool)

func (*DummyInfoResponder) SetSimulateClusterCreateFailure

func (d *DummyInfoResponder) SetSimulateClusterCreateFailure(state bool)

func (*DummyInfoResponder) SetSimulateClusterDeleteFailure

func (d *DummyInfoResponder) SetSimulateClusterDeleteFailure(state bool)

func (*DummyInfoResponder) SetSimulateVMPoolUpdateFailure

func (d *DummyInfoResponder) SetSimulateVMPoolUpdateFailure(state bool)

type DummyStreamout

type DummyStreamout struct {
	grpc.ServerStream
	// contains filtered or unexported fields
}

func (*DummyStreamout) Context

func (d *DummyStreamout) Context() context.Context

func (*DummyStreamout) Send

func (d *DummyStreamout) Send(res *edgeproto.Result) error

type ExecApi

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

func NewExecApi

func NewExecApi(all *AllApis) *ExecApi

func (*ExecApi) AccessCloudlet

func (s *ExecApi) AccessCloudlet(ctx context.Context, req *edgeproto.ExecRequest) (*edgeproto.ExecRequest, error)

func (*ExecApi) RecvExecRequest

func (s *ExecApi) RecvExecRequest(ctx context.Context, msg *edgeproto.ExecRequest)

Receive message from notify framework

func (*ExecApi) RunCommand

func (s *ExecApi) RunCommand(ctx context.Context, req *edgeproto.ExecRequest) (*edgeproto.ExecRequest, error)

func (*ExecApi) RunConsole

func (s *ExecApi) RunConsole(ctx context.Context, req *edgeproto.ExecRequest) (*edgeproto.ExecRequest, error)

func (*ExecApi) SendLocalRequest

func (s *ExecApi) SendLocalRequest(ctx context.Context, req *edgeproto.ExecRequest) (*edgeproto.ExecRequest, error)

sendLocalRequest sends the request over the notify framework to all CRM clients. We then wait for a CRM client with the AppInst to reply with an answer to the offer.

func (*ExecApi) ShowLogs

type ExecReq

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

type FlavorApi

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

func NewFlavorApi

func NewFlavorApi(sync *regiondata.Sync, all *AllApis) *FlavorApi

func (*FlavorApi) AddFlavorRes

func (s *FlavorApi) AddFlavorRes(ctx context.Context, in *edgeproto.Flavor) (*edgeproto.Result, error)

func (*FlavorApi) CreateFlavor

func (s *FlavorApi) CreateFlavor(ctx context.Context, in *edgeproto.Flavor) (*edgeproto.Result, error)

func (*FlavorApi) DeleteFlavor

func (s *FlavorApi) DeleteFlavor(ctx context.Context, in *edgeproto.Flavor) (res *edgeproto.Result, reterr error)

func (*FlavorApi) HasFlavor

func (s *FlavorApi) HasFlavor(key *edgeproto.FlavorKey) bool

func (*FlavorApi) RemoveFlavorRes

func (s *FlavorApi) RemoveFlavorRes(ctx context.Context, in *edgeproto.Flavor) (*edgeproto.Result, error)

func (*FlavorApi) ShowFlavor

func (*FlavorApi) UpdateFlavor

func (s *FlavorApi) UpdateFlavor(ctx context.Context, in *edgeproto.Flavor) (*edgeproto.Result, error)

type FlowRateLimitSettingsApi

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

func NewFlowRateLimitSettingsApi

func NewFlowRateLimitSettingsApi(sync *regiondata.Sync, all *AllApis) *FlowRateLimitSettingsApi

func (*FlowRateLimitSettingsApi) CreateFlowRateLimitSettings

func (r *FlowRateLimitSettingsApi) CreateFlowRateLimitSettings(ctx context.Context, in *edgeproto.FlowRateLimitSettings) (*edgeproto.Result, error)

Create FlowRateLimitSettings for the specified RateLimitSettings. If no RateLimitSettings exists, create a new one

func (*FlowRateLimitSettingsApi) DeleteFlowRateLimitSettings

func (r *FlowRateLimitSettingsApi) DeleteFlowRateLimitSettings(ctx context.Context, in *edgeproto.FlowRateLimitSettings) (*edgeproto.Result, error)

Delete FlowRateLimitSettings for the specified RateLimitSettings. If no FlowSettings and MaxReqsSettings left, remove the RateLimitSettings

func (*FlowRateLimitSettingsApi) ShowFlowRateLimitSettings

Show FlowRateLimit settings for an API endpoint type

func (*FlowRateLimitSettingsApi) ShowRateLimitSettings

Show RateLimit settings for an API endpoint type

func (*FlowRateLimitSettingsApi) UpdateFlowRateLimitSettings

func (r *FlowRateLimitSettingsApi) UpdateFlowRateLimitSettings(ctx context.Context, in *edgeproto.FlowRateLimitSettings) (*edgeproto.Result, error)

Update FlowRateLimitSettings for the specified RateLimitSettings

type GPUDriverApi

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

func NewGPUDriverApi

func NewGPUDriverApi(sync *regiondata.Sync, all *AllApis) *GPUDriverApi

func (*GPUDriverApi) AddGPUDriverBuild

func (*GPUDriverApi) CreateGPUDriver

func (*GPUDriverApi) DeleteGPUDriver

func (*GPUDriverApi) GetGPUDriverBuildURL

func (*GPUDriverApi) GetGPUDriverLicenseConfig

func (s *GPUDriverApi) GetGPUDriverLicenseConfig(ctx context.Context, key *edgeproto.GPUDriverKey) (*edgeproto.Result, error)

func (*GPUDriverApi) ShowGPUDriver

func (*GPUDriverApi) UpdateGPUDriver

type GenerateResourceAlerts

type GenerateResourceAlerts int

type GenericCb

type GenericCb interface {
	Send(*edgeproto.Result) error
	grpc.ServerStream
}

type MaxReqsRateLimitSettingsApi

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

func NewMaxReqsRateLimitSettingsApi

func NewMaxReqsRateLimitSettingsApi(sync *regiondata.Sync, all *AllApis) *MaxReqsRateLimitSettingsApi

Init store and cache for MaxReqsRateLimitSettings

func (*MaxReqsRateLimitSettingsApi) CreateMaxReqsRateLimitSettings

func (r *MaxReqsRateLimitSettingsApi) CreateMaxReqsRateLimitSettings(ctx context.Context, in *edgeproto.MaxReqsRateLimitSettings) (*edgeproto.Result, error)

Create MaxReqsRateLimitSettings for the specified RateLimitSettings. If no RateLimitSettings exists, create a new one

func (*MaxReqsRateLimitSettingsApi) DeleteMaxReqsRateLimitSettings

func (r *MaxReqsRateLimitSettingsApi) DeleteMaxReqsRateLimitSettings(ctx context.Context, in *edgeproto.MaxReqsRateLimitSettings) (*edgeproto.Result, error)

Delete MaxReqsRateLimitSettings for the specified RateLimitSettings. If no FlowSettings and MaxReqsSettings left, remove the RateLimitSettings

func (*MaxReqsRateLimitSettingsApi) ShowMaxReqsRateLimitSettings

Show MaxReqsRateLimit settings for an API endpoint type

func (*MaxReqsRateLimitSettingsApi) UpdateMaxReqsRateLimitSettings

func (r *MaxReqsRateLimitSettingsApi) UpdateMaxReqsRateLimitSettings(ctx context.Context, in *edgeproto.MaxReqsRateLimitSettings) (*edgeproto.Result, error)

Update MaxReqsRateLimitSettings for the specified RateLimitSettings

type NameSanitizer

type NameSanitizer interface {
	NameSanitize(name string) (string, error)
}

NameSanitizer is broken out as an interface for unit tests

type NetworkApi

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

func NewNetworkApi

func NewNetworkApi(sync *regiondata.Sync, all *AllApis) *NetworkApi

func (*NetworkApi) CreateNetwork

func (*NetworkApi) DeleteNetwork

func (s *NetworkApi) DeleteNetwork(in *edgeproto.Network, cb edgeproto.NetworkApi_DeleteNetworkServer) (reterr error)

func (*NetworkApi) ShowNetwork

func (*NetworkApi) UpdateNetwork

func (*NetworkApi) UsesCloudlet

func (s *NetworkApi) UsesCloudlet(in *edgeproto.CloudletKey) *edgeproto.NetworkKey

type NodeApi

type NodeApi struct{}

func (*NodeApi) ShowNode

type OperatorCodeApi

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

func NewOperatorCodeApi

func NewOperatorCodeApi(sync *regiondata.Sync, all *AllApis) *OperatorCodeApi

func (*OperatorCodeApi) CreateOperatorCode

func (s *OperatorCodeApi) CreateOperatorCode(ctx context.Context, in *edgeproto.OperatorCode) (*edgeproto.Result, error)

func (*OperatorCodeApi) DeleteOperatorCode

func (s *OperatorCodeApi) DeleteOperatorCode(ctx context.Context, in *edgeproto.OperatorCode) (*edgeproto.Result, error)

type OrganizationApi

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

func NewOrganizationApi

func NewOrganizationApi(sync *regiondata.Sync, all *AllApis) *OrganizationApi

func (*OrganizationApi) OrganizationInUse

func (s *OrganizationApi) OrganizationInUse(ctx context.Context, in *edgeproto.Organization) (*edgeproto.Result, error)

type PeriodicData

type PeriodicData struct {
	LastTime time.Time
}

type PeriodicReservableClusterInstCleanup

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

func (*PeriodicReservableClusterInstCleanup) GetInterval

func (*PeriodicReservableClusterInstCleanup) Run

func (*PeriodicReservableClusterInstCleanup) StartSpan

func (s *PeriodicReservableClusterInstCleanup) StartSpan() opentracing.Span

type PlatformFeaturesApi

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

func NewPlatformFeaturesApi

func NewPlatformFeaturesApi(sync *regiondata.Sync, all *AllApis) *PlatformFeaturesApi

func (*PlatformFeaturesApi) Delete

func (*PlatformFeaturesApi) DeletePlatformFeatures

func (s *PlatformFeaturesApi) DeletePlatformFeatures(ctx context.Context, in *edgeproto.PlatformFeatures) (res *edgeproto.Result, reterr error)

DeletePlatformFeatures for platforms that are no longer supported. PlatformFeatures are populated by CCRMs, but we do not clean them up if a CCRM goes offline because there may still be Cloudlets referencing them. If the CCRM is not just temporarily offline, but has been removed from the system, then this API allows the admin the manually remove features for platforms that are no longer supported.

func (*PlatformFeaturesApi) FeaturesByPlatform

func (s *PlatformFeaturesApi) FeaturesByPlatform() map[string]edgeproto.PlatformFeatures

func (*PlatformFeaturesApi) Flush

func (s *PlatformFeaturesApi) Flush(ctx context.Context, notifyId int64)

func (*PlatformFeaturesApi) GetCloudletFeatures

func (s *PlatformFeaturesApi) GetCloudletFeatures(ctx context.Context, platformType string) (*edgeproto.PlatformFeatures, error)

func (*PlatformFeaturesApi) Prune

func (s *PlatformFeaturesApi) Prune(ctx context.Context, keys map[edgeproto.PlatformFeaturesKey]struct{})

func (*PlatformFeaturesApi) Update

Update platformFeatures, sent by CCRM to Controller

type RateLimitSettingsApi

type RateLimitSettingsApi struct {
	*FlowRateLimitSettingsApi
	*MaxReqsRateLimitSettingsApi
}

type ResTagTableApi

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

func NewResTagTableApi

func NewResTagTableApi(sync *regiondata.Sync, all *AllApis) *ResTagTableApi

func (*ResTagTableApi) AddGpuResourceHintIfNeeded

func (s *ResTagTableApi) AddGpuResourceHintIfNeeded(ctx context.Context, stm concurrency.STM, spec *vmspec.VMCreationSpec, cloudlet edgeproto.Cloudlet) string

func (*ResTagTableApi) AddResTag

func (*ResTagTableApi) CreateResTagTable

func (s *ResTagTableApi) CreateResTagTable(ctx context.Context, in *edgeproto.ResTagTable) (*edgeproto.Result, error)

func (*ResTagTableApi) DeleteResTagTable

func (s *ResTagTableApi) DeleteResTagTable(ctx context.Context, in *edgeproto.ResTagTable) (res *edgeproto.Result, reterr error)

func (*ResTagTableApi) GetCloudletResourceMap

func (s *ResTagTableApi) GetCloudletResourceMap(ctx context.Context, stm concurrency.STM, key *edgeproto.ResTagTableKey) (*edgeproto.ResTagTable, error)

Routines supporting the mapping used in GetVMSpec

func (*ResTagTableApi) GetResTablesForCloudlet

func (s *ResTagTableApi) GetResTablesForCloudlet(ctx context.Context, stm concurrency.STM, cl *edgeproto.Cloudlet) (tables map[string]*edgeproto.ResTagTable, err error)

func (*ResTagTableApi) GetResTagTable

func (*ResTagTableApi) GetVMSpec

func (s *ResTagTableApi) GetVMSpec(ctx context.Context, stm concurrency.STM, nodeflavor edgeproto.Flavor, cloudletFlavorName string, cl edgeproto.Cloudlet, cli edgeproto.CloudletInfo) (*vmspec.VMCreationSpec, error)

GetVMSpec returns the VMCreationAttributes including flavor name and the size of the external volume which is required, if any

func (*ResTagTableApi) RemoveResTag

func (s *ResTagTableApi) RemoveResTag(ctx context.Context, in *edgeproto.ResTagTable) (*edgeproto.Result, error)

func (*ResTagTableApi) UpdateResTagTable

func (s *ResTagTableApi) UpdateResTagTable(ctx context.Context, in *edgeproto.ResTagTable) (*edgeproto.Result, error)

Update misc data, so far the availability zone for any of the optional resources needed.

func (*ResTagTableApi) UsesGpu

func (*ResTagTableApi) ValidateOptResMapValues

func (s *ResTagTableApi) ValidateOptResMapValues(resmap map[string]string) (bool, error)

func (*ResTagTableApi) ValidateResName

func (s *ResTagTableApi) ValidateResName(ctx context.Context, in string) (error, bool)

type RunTimeStats

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

type Services

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

type SettingsApi

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

func NewSettingsApi

func NewSettingsApi(sync *regiondata.Sync, all *AllApis) *SettingsApi

func (*SettingsApi) Get

func (s *SettingsApi) Get() *edgeproto.Settings

func (*SettingsApi) ResetSettings

func (s *SettingsApi) ResetSettings(ctx context.Context, in *edgeproto.Settings) (*edgeproto.Result, error)

func (*SettingsApi) ShowSettings

func (s *SettingsApi) ShowSettings(ctx context.Context, in *edgeproto.Settings) (*edgeproto.Settings, error)

func (*SettingsApi) UpdateSettings

func (s *SettingsApi) UpdateSettings(ctx context.Context, in *edgeproto.Settings) (*edgeproto.Result, error)

type StreamObjApi

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

func NewStreamObjApi

func NewStreamObjApi(sync *regiondata.Sync, all *AllApis) *StreamObjApi

func (*StreamObjApi) StreamAppInst

func (*StreamObjApi) StreamCloudlet

func (*StreamObjApi) StreamClusterInst

func (*StreamObjApi) StreamGPUDriver

func (*StreamObjApi) StreamMsgs

func (*StreamObjApi) UpdateStatus

func (s *StreamObjApi) UpdateStatus(ctx context.Context, obj interface{}, state *edgeproto.TrackedState, cloudletState *dme.CloudletState, streamKey string)

Publish info object received from CRM to redis so that controller can act on status messages & info state accordingly

type StreamOp

type StreamOp func(op *StreamOptions)

func WithNoResetStream

func WithNoResetStream() StreamOp

type StreamOptions

type StreamOptions struct {
	NoResetStream bool
}

type StreamoutCb

type StreamoutCb struct {
	grpc.ServerStream
	// contains filtered or unexported fields
}

func (*StreamoutCb) Context

func (s *StreamoutCb) Context() context.Context

func (*StreamoutCb) Send

func (s *StreamoutCb) Send(res *edgeproto.Result) error

type SyncLeaseData

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

This synchronizes lease data with the persistent storage (etcd). Data associated with the lease is meant to be deleted after the lease expires, if this controller goes away. However, it's also possible due to network/cpu congestion, that the lease keepalives fail even though both Controller and Etcd are running. If that happens, etcd will flush the lease data, and this Controller needs to restore it once a new lease can be established.

func NewSyncLeaseData

func NewSyncLeaseData(sy *regiondata.Sync, allApis *AllApis) *SyncLeaseData

func (*SyncLeaseData) ControllerAliveLease

func (s *SyncLeaseData) ControllerAliveLease() int64

func (*SyncLeaseData) LeaseID

func (s *SyncLeaseData) LeaseID() int64

func (*SyncLeaseData) Start

func (s *SyncLeaseData) Start(ctx context.Context)

func (*SyncLeaseData) Stop

func (s *SyncLeaseData) Stop()

type TrustPolicyApi

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

func NewTrustPolicyApi

func NewTrustPolicyApi(sync *regiondata.Sync, all *AllApis) *TrustPolicyApi

func (*TrustPolicyApi) DeleteTrustPolicy

func (*TrustPolicyApi) GetTrustPolicies

func (s *TrustPolicyApi) GetTrustPolicies(policies map[edgeproto.PolicyKey]*edgeproto.TrustPolicy)

type TrustPolicyExceptionApi

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

func NewTrustPolicyExceptionApi

func NewTrustPolicyExceptionApi(sync *regiondata.Sync, all *AllApis) *TrustPolicyExceptionApi

func (*TrustPolicyExceptionApi) CreateTrustPolicyException

func (s *TrustPolicyExceptionApi) CreateTrustPolicyException(ctx context.Context, in *edgeproto.TrustPolicyException) (*edgeproto.Result, error)

func (*TrustPolicyExceptionApi) DeleteTrustPolicyException

func (s *TrustPolicyExceptionApi) DeleteTrustPolicyException(ctx context.Context, in *edgeproto.TrustPolicyException) (*edgeproto.Result, error)

func (*TrustPolicyExceptionApi) GetTrustPolicyExceptionForAppKey

func (s *TrustPolicyExceptionApi) GetTrustPolicyExceptionForAppKey(appKey *edgeproto.AppKey) *edgeproto.TrustPolicyException

func (*TrustPolicyExceptionApi) GetTrustPolicyExceptionForCloudletPoolKey

func (s *TrustPolicyExceptionApi) GetTrustPolicyExceptionForCloudletPoolKey(cKey *edgeproto.CloudletPoolKey) *edgeproto.TrustPolicyException

func (*TrustPolicyExceptionApi) GetTrustPolicyExceptionRules

func (s *TrustPolicyExceptionApi) GetTrustPolicyExceptionRules(ckey *edgeproto.CloudletPoolKey, appKey *edgeproto.AppKey) []*edgeproto.SecurityRule

func (*TrustPolicyExceptionApi) TrustPolicyExceptionForAppKeyExists

func (s *TrustPolicyExceptionApi) TrustPolicyExceptionForAppKeyExists(appKey *edgeproto.AppKey) *edgeproto.TrustPolicyExceptionKey

func (*TrustPolicyExceptionApi) TrustPolicyExceptionForCloudletPoolKeyExists

func (s *TrustPolicyExceptionApi) TrustPolicyExceptionForCloudletPoolKeyExists(cKey *edgeproto.CloudletPoolKey) *edgeproto.TrustPolicyExceptionKey

func (*TrustPolicyExceptionApi) UpdateTrustPolicyException

func (s *TrustPolicyExceptionApi) UpdateTrustPolicyException(ctx context.Context, in *edgeproto.TrustPolicyException) (res *edgeproto.Result, reterr error)

type UpgradeSupport

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

type VMPoolApi

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

func NewVMPoolApi

func NewVMPoolApi(sync *regiondata.Sync, all *AllApis) *VMPoolApi

func (*VMPoolApi) AddVMPoolMember

func (s *VMPoolApi) AddVMPoolMember(ctx context.Context, in *edgeproto.VMPoolMember) (*edgeproto.Result, error)

func (*VMPoolApi) CreateVMPool

func (s *VMPoolApi) CreateVMPool(ctx context.Context, in *edgeproto.VMPool) (*edgeproto.Result, error)

func (*VMPoolApi) DeleteVMPool

func (s *VMPoolApi) DeleteVMPool(ctx context.Context, in *edgeproto.VMPool) (res *edgeproto.Result, reterr error)

func (*VMPoolApi) RemoveVMPoolMember

func (s *VMPoolApi) RemoveVMPoolMember(ctx context.Context, in *edgeproto.VMPoolMember) (*edgeproto.Result, error)

func (*VMPoolApi) ShowVMPool

func (*VMPoolApi) UpdateFromInfo

func (s *VMPoolApi) UpdateFromInfo(ctx context.Context, in *edgeproto.VMPoolInfo)

func (*VMPoolApi) UpdateVMPool

func (s *VMPoolApi) UpdateVMPool(ctx context.Context, in *edgeproto.VMPool) (*edgeproto.Result, error)

type VMPoolInfoApi

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

func NewVMPoolInfoApi

func NewVMPoolInfoApi(sync *regiondata.Sync, all *AllApis) *VMPoolInfoApi

func (*VMPoolInfoApi) Delete

func (s *VMPoolInfoApi) Delete(ctx context.Context, in *edgeproto.VMPoolInfo, rev int64)

func (*VMPoolInfoApi) Flush

func (s *VMPoolInfoApi) Flush(ctx context.Context, notifyId int64)

func (*VMPoolInfoApi) Prune

func (s *VMPoolInfoApi) Prune(ctx context.Context, keys map[edgeproto.VMPoolKey]struct{})

func (*VMPoolInfoApi) Update

func (s *VMPoolInfoApi) Update(ctx context.Context, in *edgeproto.VMPoolInfo, rev int64)

type VaultRoles

type VaultRoles struct {
	DmeRoleID    string `json:"dmeroleid"`
	DmeSecretID  string `json:"dmesecretid"`
	CRMRoleID    string `json:"crmroleid"`
	CRMSecretID  string `json:"crmsecretid"`
	CtrlRoleID   string `json:"controllerroleid"`
	CtrlSecretID string `json:"controllersecretid"`
}

Vault roles for all services

type VersionUpgrade

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

type VersionUpgradeFunc

type VersionUpgradeFunc func(context.Context, objstore.KVStore, *AllApis, *UpgradeSupport, int32) error

Prototype for the upgrade function - takes an objectstore and stm to ensure automicity of each upgrade function

Jump to

Keyboard shortcuts

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