job

package
v0.0.0-...-10b7995 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(l log.Logger)

func IsSpecialOS

func IsSpecialOS(i *packet.Instance) bool

func MakeHardwareWithInstance

func MakeHardwareWithInstance() (*packet.Discovery, []packet.MACAddr, string)

func RegisterDefaultInstaller

func RegisterDefaultInstaller(bootScript BootScript)

func RegisterDistro

func RegisterDistro(name string, builder BootScript)

func RegisterSlug

func RegisterSlug(name string, builder BootScript)

func ServePublicKey

func ServePublicKey(w http.ResponseWriter, req *http.Request)

func SetClient

func SetClient(c *packet.Client)

SetClient sets the client used to interact with the api.

Types

type BootScript

type BootScript func(Job, *ipxe.Script)

type Component

type Component struct {
	Type            string      `json:"type"`
	Name            string      `json:"name"`
	Vendor          string      `json:"vendor"`
	Model           string      `json:"model"`
	Serial          string      `json:"serial"`
	FirmwareVersion string      `json:"firmware_version"`
	Data            interface{} `json:"data"`
}

Component models a single hardware component

type ComponentsResponse

type ComponentsResponse struct {
	Components []Component `json:"components"`
}

type Job

type Job struct {
	log.Logger
	// contains filtered or unexported fields
}

Job this comment is useless

func CreateFromDHCP

func CreateFromDHCP(mac net.HardwareAddr, giaddr net.IP, circuitID string) (Job, error)

CreateFromDHCP looks up hardware using the MAC from cacher to create a job

func CreateFromIP

func CreateFromIP(ip net.IP) (Job, error)

CreateFromIP looksup hardware using the IP from cacher to create a job

func CreateFromRemoteAddr

func CreateFromRemoteAddr(ip string) (Job, error)

CreateFromRemoteAddr looks up hardware using the IP from cacher to create a job

func (Job) AddHardware

func (j Job) AddHardware(w http.ResponseWriter, req *http.Request)

AddHardware - Add hardware component(s)

func (Job) Arch

func (j Job) Arch() string

func (Job) BondingMode

func (j Job) BondingMode() packet.BondingMode

func (Job) CryptedPassword

func (j Job) CryptedPassword() string

func (Job) CustomPXEDone

func (j Job) CustomPXEDone()

func (Job) DisablePXE

func (j Job) DisablePXE()

func (Job) Error

func (j Job) Error(err error, args ...interface{})

func (Job) FacilityCode

func (j Job) FacilityCode() string

func (Job) Fatal

func (j Job) Fatal(err error, args ...interface{})

func (Job) HardwareID

func (j Job) HardwareID() string

func (Job) HardwareState

func (j Job) HardwareState() string

HardwareState will return (enrolled burn_in preinstallable preinstalling failed_preinstall provisionable provisioning deprovisioning in_use)

func (Job) ID

func (j Job) ID() string

func (Job) IPXEScriptURL

func (j Job) IPXEScriptURL() string

IPXEScriptURL returns the value of instance.IPXEScriptURL

func (Job) InstanceID

func (j Job) InstanceID() string

func (Job) InstanceIPs

func (j Job) InstanceIPs() []packet.IP

func (Job) InterfaceMAC

func (j Job) InterfaceMAC(i int) net.HardwareAddr

func (Job) InterfaceName

func (j Job) InterfaceName(i int) string

func (Job) Interfaces

func (j Job) Interfaces() []packet.Port

func (Job) IsARM

func (j Job) IsARM() bool

func (Job) IsUEFI

func (j Job) IsUEFI() bool

func (Job) Manufacturer

func (j Job) Manufacturer() string

func (Job) MarkDeviceActive

func (j Job) MarkDeviceActive()

func (Job) OperatingSystem

func (j Job) OperatingSystem() *packet.OperatingSystem

func (Job) PArch

func (j Job) PArch() string

func (Job) PlanSlug

func (j Job) PlanSlug() string

func (Job) PlanVersionSlug

func (j Job) PlanVersionSlug() string

func (Job) PostHardwareProblem

func (j Job) PostHardwareProblem(slug string) bool

func (Job) PrimaryNIC

func (j Job) PrimaryNIC() net.HardwareAddr

PrimaryNIC returns the mac address of the NIC we expect to be dhcp/pxe'ing

func (Job) PrivateSubnets

func (j Job) PrivateSubnets() []string

func (Job) ServeDHCP

func (j Job) ServeDHCP(w dhcp4.ReplyWriter, req *dhcp4.Packet)

ServeDHCP responds to DHCP packets

func (Job) ServeFile

func (j Job) ServeFile(w http.ResponseWriter, req *http.Request)

func (Job) ServePhoneHomeEndpoint

func (j Job) ServePhoneHomeEndpoint(w http.ResponseWriter, req *http.Request)

func (Job) ServeProblemEndpoint

func (j Job) ServeProblemEndpoint(w http.ResponseWriter, req *http.Request)

func (Job) ServeTFTP

func (j Job) ServeTFTP(filename, client string) (tftpgo.ReadCloser, error)

func (Job) ServicesVersion

func (j Job) ServicesVersion() packet.ServicesVersion

func (Job) UserData

func (j Job) UserData() string

UserData returns instance.UserData

type Mock

type Mock Job

func NewMock

func NewMock(t zaptest.TestingT, slug, facility string) Mock

NewMock returns a mock Job with only minimal fields set, it is useful only for tests

func NewMockFromDiscovery

func NewMockFromDiscovery(d *packet.Discovery, mac net.HardwareAddr) Mock

func (Mock) DropInstance

func (m Mock) DropInstance()

func (Mock) Job

func (m Mock) Job() Job

func (*Mock) SetIP

func (m *Mock) SetIP(ip net.IP)

func (*Mock) SetIPXEScriptURL

func (m *Mock) SetIPXEScriptURL(url string)

func (*Mock) SetMAC

func (m *Mock) SetMAC(mac string)

func (*Mock) SetManufacturer

func (m *Mock) SetManufacturer(slug string)

func (*Mock) SetOSDistro

func (m *Mock) SetOSDistro(distro string)

func (*Mock) SetOSSlug

func (m *Mock) SetOSSlug(slug string)

func (*Mock) SetOSVersion

func (m *Mock) SetOSVersion(version string)

func (*Mock) SetPassword

func (m *Mock) SetPassword(password string)

func (*Mock) SetState

func (m *Mock) SetState(state string)

type Mode

type Mode uint32

func (Mode) Slug

func (m Mode) Slug() string

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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