accountmgmtutil

package
v0.42.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTermsAccepted

func CheckTermsAccepted(ctx context.Context, spec *remote.AmsConfig, conn connection.Connection) (accepted bool, redirectURI string, err error)

func GetOrganizationID

func GetOrganizationID(ctx context.Context, conn connection.Connection) (accountID string, err error)

Types

type QuotaSpec added in v0.42.0

type QuotaSpec struct {
	Name         string
	Quota        int
	BillingModel string
}

QuotaSpec - contains quota name and remaining quota count

func BattleOfInstanceBillingModels added in v0.42.0

func BattleOfInstanceBillingModels(quotas []QuotaSpec) []QuotaSpec

This function selects the billing model that should be used It represents some requirement to always use the same standard billing models This function should not exist but it does represents some requirement that we cannot do on backend

func GetUserSupportedInstanceType added in v0.42.0

func GetUserSupportedInstanceType(ctx context.Context, spec *remote.AmsConfig, conn connection.Connection) (quota *QuotaSpec, err error)

func GetUserSupportedInstanceTypes

func GetUserSupportedInstanceTypes(ctx context.Context, spec *remote.AmsConfig, conn connection.Connection) (quota []QuotaSpec, err error)

func PickInstanceType added in v0.42.0

func PickInstanceType(amsTypes []QuotaSpec) *QuotaSpec

PickInstanceType - Standard instance always wins! This function should not exist but it does represents some requirement from business to only pick one instance type when two are presented. When standard instance type is present in user instances it should always take precedence

type QuotaType

type QuotaType = string

AMS types

const (
	QuotaTrialType    QuotaType = "trial"
	QuotaStandardType QuotaType = "standard"
)

Jump to

Keyboard shortcuts

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