gcp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMDSURL         = "http://metadata.google.internal/computeMetadata/v1"
	IMDSInstanceURL = IMDSURL + "/instance/id"
	IMDSRegionURL   = IMDSURL + "/instance/zone"
	IMDSHeaderKey   = "Metadata-Flavor"
	IMDSHeaderVal   = "Google"
	IMDSHeader      = IMDSHeaderKey + ": " + IMDSHeaderVal
)
View Source
const NAME = "gcp"
View Source
const (
	NAME_SIM = "gcp-sim"
)

Variables

This section is empty.

Functions

func GetNodeAnnotations

func GetNodeAnnotations(ctx context.Context) (map[string]string, error)

func Loader

func NamedLoader

func NamedLoader() (string, providers.Loader)

func NamedLoaderSim

func NamedLoaderSim() (string, providers.Loader)

func NewSim

func NewSim(clientFactory ClientFactory, trimTiers int) *simProvider

Types

type Client

type Client interface {
	ProjectID() string
	Instances(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) (InstanceIterator, string)
	PageSize() *uint32
}

type ClientFactory

type ClientFactory func(pageSize *int) (Client, error)

type InstanceIterator

type InstanceIterator interface {
	Next() (*computepb.Instance, error)
}

type Provider

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

func New

func New(clientFactory ClientFactory, trimTiers int) *Provider

func (*Provider) GenerateTopologyConfig

func (p *Provider) GenerateTopologyConfig(ctx context.Context, pageSize *int, instances []topology.ComputeInstances) (*topology.Vertex, *httperr.Error)

func (*Provider) GetInstancesRegions

func (p *Provider) GetInstancesRegions(ctx context.Context, nodes []string) (map[string]string, error)

GetInstancesRegions implements slurm.instanceMapper

func (*Provider) Instances2NodeMap

func (p *Provider) Instances2NodeMap(ctx context.Context, nodes []string) (map[string]string, error)

Instances2NodeMap implements slurm.instanceMapper

Jump to

Keyboard shortcuts

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