packet

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func New

func New(opts *Options) (*API, error)

func (*API) AddKey

func (a *API) AddKey(name, key string) (string, error)

func (*API) CreateDevice

func (a *API) CreateDevice(hostname string, conf *conf.Conf, console Console) (*packngo.Device, error)

console is optional, and is closed on error or when the device is deleted.

func (*API) DeleteDevice

func (a *API) DeleteDevice(deviceID string) error

func (*API) DeleteKey

func (a *API) DeleteKey(keyID string) error

func (*API) GC

func (a *API) GC(gracePeriod time.Duration) error

func (*API) GetDeviceAddress

func (a *API) GetDeviceAddress(device *packngo.Device, family int, public bool) string

func (*API) ListKeys

func (a *API) ListKeys() ([]packngo.SSHKey, error)

func (*API) PreflightCheck

func (a *API) PreflightCheck() error

type Console

type Console interface {
	io.WriteCloser
	SSHClient(ip, user string) (*ssh.Client, error)
}

type Options

type Options struct {
	*platform.Options

	// Config file. Defaults to $HOME/.config/packet.json.
	ConfigPath string
	// Profile name
	Profile string
	// API key (overrides config profile)
	ApiKey string
	// Project UUID (overrides config profile)
	Project string

	// Packet location code
	Facility string
	// Slug of the device type (e.g. "t1.small.x86")
	Plan string
	// CPU architecture
	Architecture string
	// e.g. https://raw.githubusercontent.com/coreos/coreos-assembler/main/mantle/platform/api/packet/fcos-x86_64.ipxe
	IPXEURL string
	// e.g. https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/31.20200223.3.0/x86_64/fedora-coreos-31.20200223.3.0-metal.x86_64.raw.xz
	ImageURL string
}

Jump to

Keyboard shortcuts

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