packet

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NumOfCore = map[string]int{
	"Intel Atom C2550 @ 2.4Ghz":                           4,
	"Intel E3-1240 v3":                                    4,
	"Intel Xeon E3-1578L v5":                              4,
	"Intel Xeon E5-2650 v4 @2.2GHz":                       24,
	"Cavium ThunderX CN8890 @2GHz":                        96,
	"Intel E5-2640 v3":                                    16,
	"Intel Xeon D-1537 @1.7GHz":                           16,
	"AMD EPYC 7401P 24-Core Processor @ 2.0GHz":           24,
	"Intel Xeon Gold 6126":                                2 * 12,
	"Intel Scalable Gold 5120 28-Core Processor @ 2.2GHz": 28,
	"32-core @ 3.0Ghz":                                    32,
}

Functions

func GetCpuCore

func GetCpuCore(name string) (int, error)

func GetFacilityIdFromHerf

func GetFacilityIdFromHerf(herf string) string

formate: "/facilities/[id]"

func ParseFacility

func ParseFacility(facility *packngo.Facility) *v1alpha1.Region

func ParsePlan

func ParsePlan(plan *packngo.Plan) (*v1alpha1.MachineType, error)

func RemoveUnitRetFloat64

func RemoveUnitRetFloat64(in string) (float64, error)

4GB -> 4 2048MB -> 2048/1024 -> 2

func RemoveUnitRetInt

func RemoveUnitRetInt(in string) (int, error)

Types

type Client

type Client struct {
	Client *packngo.Client
	// required because current packngo.Plan does not contain Zones
	PlanRequest *http.Request
}

func NewClient

func NewClient(opts credential.Packet) (*Client, error)

func (*Client) GetName

func (g *Client) GetName() string

func (*Client) ListMachineTypes

func (g *Client) ListMachineTypes() ([]v1alpha1.MachineType, error)

func (*Client) ListRegions

func (g *Client) ListRegions() ([]v1alpha1.Region, error)

func (*Client) ListZones

func (g *Client) ListZones() ([]string, error)

Facility.Code as zone

type PlanList

type PlanList struct {
	Plans []packngo.Plan `json:"plans"`
}

Jump to

Keyboard shortcuts

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