metadata

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: BSD-3-Clause, MIT Imports: 6 Imported by: 75 modules, 74 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

Overview

Package metadata implements the Equinix Metal Metadata API available to Equinix Metal devices at https://metadata.platformequinix.com/metadata.

For more information, see https://metal.equinix.com/developers/docs/servers/metadata/

Index

Constants

View Source
const (
	IPv4 = AddressFamily(4)
	IPv6 = AddressFamily(6)
)
View Source
const (
	BondingBalanceRR    = BondingMode(0)
	BondingActiveBackup = BondingMode(1)
	BondingBalanceXOR   = BondingMode(2)
	BondingBroadcast    = BondingMode(3)
	BondingLACP         = BondingMode(4)
	BondingBalanceTLB   = BondingMode(5)
	BondingBalanceALB   = BondingMode(6)
)
View Source
const BaseURL = "https://metadata.platformequinix.com"

Variables

This section is empty.

Functions

func GetUserData

func GetUserData() ([]byte, error)

func GetUserDataFromURL added in v0.3.0

func GetUserDataFromURL(baseURL string) ([]byte, error)

Types

type AddressFamily

type AddressFamily int

type AddressInfo

type AddressInfo struct {
	ID          string        `json:"id"`
	Family      AddressFamily `json:"address_family"`
	Public      bool          `json:"public"`
	Management  bool          `json:"management"`
	Address     net.IP        `json:"address"`
	NetworkMask net.IP        `json:"netmask"`
	Gateway     net.IP        `json:"gateway"`
	NetworkBits int           `json:"cidr"`
}

type BondingMode

type BondingMode int

func (BondingMode) String

func (m BondingMode) String() string

type CurrentDevice

type CurrentDevice struct {
	ID         string                 `json:"id"`
	Hostname   string                 `json:"hostname"`
	IQN        string                 `json:"iqn"`
	Plan       string                 `json:"plan"`
	Metro      string                 `json:"metro"`
	Facility   string                 `json:"facility"`
	Tags       []string               `json:"tags"`
	SSHKeys    []string               `json:"ssh_keys"`
	OS         OperatingSystem        `json:"operating_system"`
	Network    NetworkInfo            `json:"network"`
	Volumes    []VolumeInfo           `json:"volumes"`
	CustomData map[string]interface{} `json:"customdata"`
}

func GetMetadata

func GetMetadata() (*CurrentDevice, error)

func GetMetadataFromURL added in v0.3.0

func GetMetadataFromURL(baseURL string) (*CurrentDevice, error)

type InterfaceInfo

type InterfaceInfo struct {
	Name string `json:"name"`
	MAC  string `json:"mac"`
}

func (*InterfaceInfo) ParseMAC

func (i *InterfaceInfo) ParseMAC() (net.HardwareAddr, error)

type NetworkInfo

type NetworkInfo struct {
	Interfaces []InterfaceInfo `json:"interfaces"`
	Addresses  []AddressInfo   `json:"addresses"`

	Bonding struct {
		Mode BondingMode `json:"mode"`
	} `json:"bonding"`
}

func (*NetworkInfo) BondingMode

func (n *NetworkInfo) BondingMode() BondingMode

type OperatingSystem

type OperatingSystem struct {
	Slug    string `json:"slug"`
	Distro  string `json:"distro"`
	Version string `json:"version"`
}

type VolumeInfo

type VolumeInfo struct {
	Name string   `json:"name"`
	IQN  string   `json:"iqn"`
	IPs  []net.IP `json:"ips"`

	Capacity struct {
		Size int    `json:"size,string"`
		Unit string `json:"unit"`
	} `json:"capacity"`
}

Jump to

Keyboard shortcuts

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