cmd: Switch packet.net API to github.com/bzub/packngo

This fork has initial support for always-pxe and was
suggested to use be used as an interim solution here:
https://github.com/packethost/packngo/issues/22#issuecomment-319973502

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-08-07 11:18:20 +01:00
parent e61794a344
commit a837312cc7
18 changed files with 29 additions and 25 deletions

View File

@ -8,7 +8,7 @@ import (
"os"
"path/filepath"
"github.com/packethost/packngo"
"github.com/bzub/packngo" // TODO(rn): Update to official once iPXE is merged
log "github.com/sirupsen/logrus"
)

View File

@ -1,6 +1,7 @@
github.com/Azure/azure-sdk-for-go 26132835cbefa2669a306b777f34b929b56aa0a2
github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e
github.com/Azure/go-autorest 58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d
github.com/bzub/packngo 087cff23a860cd69a8c4818c8f6411bd47f6ab96
github.com/Microsoft/go-winio f533f7a102197536779ea3a8cb881d639e21ec5a
github.com/aws/aws-sdk-go fa107560b5f3528a859a1a1511086646731bb1a8
github.com/dgrijalva/jwt-go 6c8dedd55f8a2e41f605de6d5d66e51ed1f299fc
@ -12,7 +13,6 @@ github.com/gophercloud/gophercloud 2804b72cf099b41d2e25c8afcca786f9f962ddee
github.com/jmespath/go-jmespath bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d
github.com/mitchellh/go-ps 4fdf99ab29366514c69ccccddab5dc58b8d84062
github.com/moby/hyperkit a82b409a87f12fa3306813410c37f4eed270efac
github.com/packethost/packngo 91d54000aa56874149d348a884ba083c41d38091
github.com/radu-matei/azure-sdk-for-go 3b12823551999669c9a325a32472508e0af7978e
github.com/radu-matei/azure-vhd-utils e52754d5569d2a643a7775f72ff2a6cf524f4c25
github.com/rn/iso9660wrap 4606f848a055435cdef85305960b0e1bb788d506

View File

@ -23,21 +23,23 @@ type devicesRoot struct {
// Device represents a Packet device
type Device struct {
ID string `json:"id"`
Href string `json:"href,omitempty"`
Hostname string `json:"hostname,omitempty"`
State string `json:"state,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Locked bool `json:"locked,omitempty"`
BillingCycle string `json:"billing_cycle,omitempty"`
Tags []string `json:"tags,omitempty"`
Network []*IPAddress `json:"ip_addresses"`
OS *OS `json:"operating_system,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Facility *Facility `json:"facility,omitempty"`
Project *Project `json:"project,omitempty"`
ProvisionPer float32 `json:"provisioning_percentage,omitempty"`
ID string `json:"id"`
Href string `json:"href,omitempty"`
Hostname string `json:"hostname,omitempty"`
State string `json:"state,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Locked bool `json:"locked,omitempty"`
BillingCycle string `json:"billing_cycle,omitempty"`
Tags []string `json:"tags,omitempty"`
Network []*IPAddress `json:"ip_addresses"`
OS *OS `json:"operating_system,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Facility *Facility `json:"facility,omitempty"`
Project *Project `json:"project,omitempty"`
ProvisionPer float32 `json:"provisioning_percentage,omitempty"`
IPXEScriptUrl string `json:"ipxe_script_url,omitempty"`
AlwaysPXE bool `json:"always_pxe,omitempty"`
}
func (d Device) String() string {
@ -46,14 +48,16 @@ func (d Device) String() string {
// DeviceCreateRequest type used to create a Packet device
type DeviceCreateRequest struct {
HostName string `json:"hostname"`
Plan string `json:"plan"`
Facility string `json:"facility"`
OS string `json:"operating_system"`
BillingCycle string `json:"billing_cycle"`
ProjectID string `json:"project_id"`
UserData string `json:"userdata"`
Tags []string `json:"tags"`
HostName string `json:"hostname"`
Plan string `json:"plan"`
Facility string `json:"facility"`
OS string `json:"operating_system"`
BillingCycle string `json:"billing_cycle"`
ProjectID string `json:"project_id"`
UserData string `json:"userdata"`
Tags []string `json:"tags"`
IPXEScriptUrl string `json:"ipxe_script_url,omitempty"`
AlwaysPXE bool `json:"always_pxe,omitempty"`
}
func (d DeviceCreateRequest) String() string {