mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-12 02:20:51 +00:00
Add moby run packet to boot on baremetal Packet.net hosts
This uses the Packet.net API and iPXE to boot a Moby host. There are several enhancements coming soon, such as SSH key customisation, but this PR is sufficient to boot a host and then use the web interface to get console access. The user must currently upload the built artefacts to a public URL and specify it via --base-url, e.g.: moby run packet --api-key <key> --project-id <id> \ --base-url http://recoil.org/~avsm/ipxe --hostname test-moby packet See #1424 #1245 for related issues. Signed-off-by: Anil Madhavapeddy <anil@docker.com>
This commit is contained in:
56
vendor/github.com/packethost/packngo/facilities.go
generated
vendored
Normal file
56
vendor/github.com/packethost/packngo/facilities.go
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
package packngo
|
||||
|
||||
const facilityBasePath = "/facilities"
|
||||
|
||||
// FacilityService interface defines available facility methods
|
||||
type FacilityService interface {
|
||||
List() ([]Facility, *Response, error)
|
||||
}
|
||||
|
||||
type facilityRoot struct {
|
||||
Facilities []Facility `json:"facilities"`
|
||||
}
|
||||
|
||||
// Facility represents a Packet facility
|
||||
type Facility struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Features []string `json:"features,omitempty"`
|
||||
Address *Address `json:"address,omitempty"`
|
||||
URL string `json:"href,omitempty"`
|
||||
}
|
||||
|
||||
func (f Facility) String() string {
|
||||
return Stringify(f)
|
||||
}
|
||||
|
||||
// Address - the physical address of the facility
|
||||
type Address struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (a Address) String() string {
|
||||
return Stringify(a)
|
||||
}
|
||||
|
||||
// FacilityServiceOp implements FacilityService
|
||||
type FacilityServiceOp struct {
|
||||
client *Client
|
||||
}
|
||||
|
||||
// List returns all available Packet facilities
|
||||
func (s *FacilityServiceOp) List() ([]Facility, *Response, error) {
|
||||
req, err := s.client.NewRequest("GET", facilityBasePath, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
root := new(facilityRoot)
|
||||
resp, err := s.client.Do(req, root)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return root.Facilities, resp, err
|
||||
}
|
||||
Reference in New Issue
Block a user