upcloud

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UpCloudMetadataEndpoint is the local UpCloud endpoint.
	UpCloudMetadataEndpoint = "http://169.254.169.254/metadata/v1.json"

	// UpCloudExternalIPEndpoint is the local UpCloud endpoint for the external IP.
	UpCloudExternalIPEndpoint = "http://169.254.169.254/metadata/v1/network/interfaces/1/ip_addresses/1/address"

	// UpCloudHostnameEndpoint is the local UpCloud endpoint for the hostname.
	UpCloudHostnameEndpoint = "http://169.254.169.254/metadata/v1/hostname"

	// UpCloudUserDataEndpoint is the local UpCloud endpoint for the config.
	UpCloudUserDataEndpoint = "http://169.254.169.254/metadata/v1/user_data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaData

type MetaData struct {
	Hostname   string   `json:"hostname,omitempty"`
	InstanceID string   `json:"instance_id,omitempty"`
	PublicKeys []string `json:"public_keys,omitempty"`
	Region     string   `json:"region,omitempty"`

	Network struct {
		Interfaces []struct {
			Index       int `json:"index,omitempty"`
			IPAddresses []struct {
				Address  string   `json:"address,omitempty"`
				DHCP     bool     `json:"dhcp,omitempty"`
				DNS      []string `json:"dns,omitempty"`
				Family   string   `json:"family,omitempty"`
				Floating bool     `json:"floating,omitempty"`
				Gateway  string   `json:"gateway,omitempty"`
				Network  string   `json:"network,omitempty"`
			} `json:"ip_addresses,omitempty"`
			MAC         string `json:"mac,omitempty"`
			NetworkType string `json:"type,omitempty"`
			NetworkID   string `json:"network_id,omitempty"`
		} `json:"interfaces,omitempty"`
		DNS []string `json:"dns,omitempty"`
	} `json:"network,omitempty"`
}

MetaData represents a metadata Upcloud interface.

type UpCloud

type UpCloud struct{}

UpCloud is the concrete type that implements the runtime.Platform interface.

func (*UpCloud) Configuration

func (u *UpCloud) Configuration(ctx context.Context) ([]byte, error)

Configuration implements the runtime.Platform interface.

func (*UpCloud) ConfigurationNetwork

func (u *UpCloud) ConfigurationNetwork(metadataConfig []byte, confProvider config.Provider) (config.Provider, error)

ConfigurationNetwork implements the network configuration interface.

func (*UpCloud) ExternalIPs

func (u *UpCloud) ExternalIPs(ctx context.Context) (addrs []net.IP, err error)

ExternalIPs implements the runtime.Platform interface.

func (*UpCloud) Hostname

func (u *UpCloud) Hostname(ctx context.Context) (hostname []byte, err error)

Hostname implements the runtime.Platform interface.

func (*UpCloud) KernelArgs

func (u *UpCloud) KernelArgs() procfs.Parameters

KernelArgs implements the runtime.Platform interface.

func (*UpCloud) Mode

func (u *UpCloud) Mode() runtime.Mode

Mode implements the runtime.Platform interface.

func (*UpCloud) Name

func (u *UpCloud) Name() string

Name implements the runtime.Platform interface.

Jump to

Keyboard shortcuts

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