equinixmetal

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package equinixmetal contains the Equinix Metal implementation of the [platform.Platform].

Index

Constants

View Source
const (
	// EquinixMetalUserDataEndpoint is the local metadata endpoint for Equinix.
	EquinixMetalUserDataEndpoint = "https://metadata.platformequinix.com/userdata"
	// EquinixMetalMetaDataEndpoint is the local endpoint for machine info like networking.
	EquinixMetalMetaDataEndpoint = "https://metadata.platformequinix.com/metadata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Public     bool   `json:"public"`
	Management bool   `json:"management"`
	Enabled    bool   `json:"enabled"`
	CIDR       int    `json:"cidr"`
	Family     int    `json:"address_family"`
	Netmask    string `json:"netmask"`
	Network    string `json:"network"`
	Address    string `json:"address"`
	Gateway    string `json:"gateway"`
}

Address holds address info from the equinixmetal metadata.

type BGPNeighbor added in v1.7.0

type BGPNeighbor struct {
	AddressFamily int      `json:"address_family"`
	PeerIPs       []string `json:"peer_ips"`
}

BGPNeighbor holds BGP neighbor info from the equinixmetal metadata.

type Bonding

type Bonding struct {
	Mode int `json:"mode"`
}

Bonding holds bonding info from the equinixmetal metadata.

type EquinixMetal

type EquinixMetal struct{}

EquinixMetal is a platform for EquinixMetal Metal cloud.

func (*EquinixMetal) Configuration

func (p *EquinixMetal) Configuration(ctx context.Context, r state.State) ([]byte, error)

Configuration implements the platform.Platform interface.

func (*EquinixMetal) FireEvent

func (p *EquinixMetal) FireEvent(ctx context.Context, event Event) error

FireEvent will take an event and pass it to an events server. nb: This is currently only used with Equinix Metal but we may find interesting ways to extend it for other event servers (Azure may have something similar?)

func (*EquinixMetal) KernelArgs

func (p *EquinixMetal) KernelArgs(arch string) procfs.Parameters

KernelArgs implements the runtime.Platform interface.

func (*EquinixMetal) Mode

func (p *EquinixMetal) Mode() runtime.Mode

Mode implements the platform.Platform interface.

func (*EquinixMetal) Name

func (p *EquinixMetal) Name() string

Name implements the platform.Platform interface.

func (*EquinixMetal) NetworkConfiguration

func (p *EquinixMetal) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error

NetworkConfiguration implements the runtime.Platform interface.

func (*EquinixMetal) ParseMetadata

func (p *EquinixMetal) ParseMetadata(ctx context.Context, equinixMetadata *MetadataConfig, st state.State) (*runtime.PlatformNetworkConfig, error)

ParseMetadata converts Equinix Metal metadata into Talos network configuration.

type Event

type Event struct {
	Type    string `json:"type"`
	Message string `json:"msg"`
}

Event holds data to pass to the Equinix Metal event URL.

type Interface

type Interface struct {
	Name string `json:"name"`
	MAC  string `json:"mac"`
	Bond string `json:"bond"`
}

Interface holds interface info from the equinixmetal metadata.

type MetadataConfig

type MetadataConfig struct {
	ID             string        `json:"id"`
	Hostname       string        `json:"hostname"`
	Plan           string        `json:"plan"`
	Metro          string        `json:"metro"`
	Facility       string        `json:"facility"`
	Network        Network       `json:"network"`
	BGPNeighbors   []BGPNeighbor `json:"bgp_neighbors"`
	PrivateSubnets []string      `json:"private_subnets"`
}

MetadataConfig holds equinixmetal metadata info.

type Network

type Network struct {
	Bonding    Bonding     `json:"bonding"`
	Interfaces []Interface `json:"interfaces"`
	Addresses  []Address   `json:"addresses"`
}

Network holds network info from the equinixmetal metadata.

Jump to

Keyboard shortcuts

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