aws

package
v0.0.0-...-74102c1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMDS           = "http://169.254.169.254"
	IMDS_TOKEN_URL = IMDS + "/latest/api/token"
	IMDS_URL       = IMDS + "/latest/meta-data"
)
View Source
const (
	NAME_SIM = "aws-sim"

	AvailabilityZoneKey = "availability_zone"
	GroupNameKey        = "group"

	DEFAULT_MAX_RESULTS = 20
)
View Source
const NAME = "aws"

Variables

This section is empty.

Functions

func Loader

func LoaderSim

func LoaderSim(ctx context.Context, cfg providers.Config) (providers.Provider, error)

func NamedLoader

func NamedLoader() (string, providers.Loader)

func NamedLoaderSim

func NamedLoaderSim() (string, providers.Loader)

Types

type Client

type Client struct {
	EC2 EC2Client
}

type ClientFactory

type ClientFactory func(region string) (*Client, error)

type Credentials

type Credentials struct {
	AccessKeyId     string
	SecretAccessKey string
	Token           string // Token is optional
}

type CredsClient

type CredsClient interface {
	Retrieve(ctx context.Context) (aws.Credentials, error)
}

type EC2Client

type EC2Client interface {
	DescribeInstanceTopology(ctx context.Context, params *ec2.DescribeInstanceTopologyInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTopologyOutput, error)
}

type IDMSClient

type IDMSClient interface {
	GetRegion(ctx context.Context, params *imds.GetRegionInput, optFns ...func(*imds.Options)) (*imds.GetRegionOutput, error)
}

type Provider

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

func New

func New(clientFactory ClientFactory, imdsClient IDMSClient) *Provider

func (*Provider) GenerateTopologyConfig

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

func (*Provider) GetComputeInstancesRegion

func (p *Provider) GetComputeInstancesRegion() (string, error)

GetComputeInstancesRegion implements slurm.instanceMapper

func (*Provider) GetNodeInstance

func (p *Provider) GetNodeInstance(node *v1.Node) (string, error)

GetNodeInstance implements k8s.k8sNodeInfo

func (*Provider) GetNodeRegion

func (p *Provider) GetNodeRegion(node *v1.Node) (string, error)

GetNodeRegion implements k8s.k8sNodeInfo

func (*Provider) Instances2NodeMap

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

Instances2NodeMap implements slurm.instanceMapper

type SimClient

type SimClient struct {
	Model      *models.Model
	Outputs    map[string](*[]types.InstanceTopology)
	NextTokens map[string]string
}

func (SimClient) DescribeInstanceTopology

func (client SimClient) DescribeInstanceTopology(ctx context.Context, params *ec2.DescribeInstanceTopologyInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTopologyOutput, error)

Jump to

Keyboard shortcuts

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