data

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ENV_AZURE_SUBSCRIPTION_ID = "AZURE_SUBSCRIPTION_ID"
)

Variables

This section is empty.

Functions

func FilterComputeSizesByLocation added in v0.9.6

func FilterComputeSizesByLocation(location *string, computeSizes []string) ([]string, error)

func FilterVMSizeOfferedByLocation added in v0.8.2

func FilterVMSizeOfferedByLocation(vmSizes []string, location string) ([]string, error)

Get InstanceTypes offerings on current location

func IsImageOffered

func IsImageOffered(mCtx *mc.Context, req ImageRequest) bool

func IsVMSizeOfferedByLocation added in v0.8.2

func IsVMSizeOfferedByLocation(vmSize, location string) (bool, error)

func Locations added in v0.9.6

func Locations() ([]string, error)

func LocationsBySupportedResourceType added in v0.9.6

func LocationsBySupportedResourceType(rt ResourceType) ([]string, error)

func SkuG2Support added in v0.9.1

func SkuG2Support(location string, publisher string, offer string, sku string) (string, error)

func SpotInfo added in v0.9.6

func SpotInfo(mCtx *mc.Context, args *SpotInfoArgs) (*spot.SpotResults, error)

This function will return the best spot option

Types

type ComputeSelector added in v0.9.5

type ComputeSelector struct{}

func NewComputeSelector added in v0.9.5

func NewComputeSelector() *ComputeSelector

func (*ComputeSelector) Select added in v0.9.5

func (c *ComputeSelector) Select(
	args *cr.ComputeRequestArgs) ([]string, error)

type ImageReference

type ImageReference struct {
	Publisher string
	Offer     string
	Sku       string
	// community gallery image ID
	ID string
}

func GetImageRef

func GetImageRef(osTarget OSType, arch string, version string) (*ImageReference, error)

version should came in format X.Y (major.minor)

type ImageRequest

type ImageRequest struct {
	Region string
	ImageReference
}

type OSType

type OSType int
const (
	Ubuntu OSType = iota + 1
	RHEL
	Fedora
)

type ResourceType added in v0.9.6

type ResourceType string
const (
	RTPublicIPAddresses ResourceType = "publicIPAddresses"
	RTVirtualMachines   ResourceType = "virtualMachines"
)

type SpotInfoArgs added in v0.9.6

type SpotInfoArgs struct {
	ComputeSizes          []string
	ImageRef              *ImageReference
	OSType                string
	ExcludedLocations     []string
	SpotTolerance         *spot.Tolerance
	SpotPriceIncreaseRate *int
}

type SpotInfoResult added in v0.9.6

type SpotInfoResult struct {
	ComputeSize  string  `json:"skuName"`
	Location     string  `json:"location"`
	Price        float64 `json:"latestSpotPriceUSD"`
	EvictionRate string  `json:"evictionRate"`
}

type SpotSelector added in v0.9.5

type SpotSelector struct{}

func NewSpotSelector added in v0.9.5

func NewSpotSelector() *SpotSelector

func (*SpotSelector) Select added in v0.9.5

func (c *SpotSelector) Select(mCtx *mc.Context,
	args *spot.SpotRequestArgs) (*spot.SpotResults, error)

Jump to

Keyboard shortcuts

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