Documentation ¶
Index ¶
- Constants
- Variables
- func AssignIPAddress(deviceID, ipAddress string) error
- func AttachStorage(storageID, deviceID string) error
- func CloneStorage(storageID, snapshotTimestamp string) error
- func Configure(profile string) error
- func CreateDevice(...) error
- func CreateDeviceVerbose(...) error
- func CreateProject(orgID, name, paymentID string) error
- func CreateSSHKey(label, key string) error
- func CreateSnapshot(storageID string) error
- func CreateSnapshotPolicy(storageID, frequency string, count int) error
- func CreateStorage(projectID, description, plan, facility, frequency string, size, count int) error
- func DeleteDevice(deviceID string) error
- func DeleteProject(id string) error
- func DeleteSSHKey(keyID string) error
- func DeleteSnapshot(storageID, snapshotID string) error
- func DeleteSnapshotPolicy(snapshotPolicyID string) error
- func DeleteStorage(storageID string) error
- func DetachStorage(attachmentID string) error
- func Execute()
- func GetAPIKey() (string, error)
- func GetProjectID(cmd *cobra.Command) string
- func ListDevice(deviceID string) error
- func ListDeviceEvents(id string) error
- func ListDevices(projectID string) error
- func ListFacilities() error
- func ListIPAddress(ipAddressID string) error
- func ListIPReservation(id string) error
- func ListIPReservations(projectID string) error
- func ListOS() error
- func ListPlans() error
- func ListProject(projectID string) error
- func ListProjectEvents(id string) error
- func ListProjects() error
- func ListSSHKey(keyID string) error
- func ListSSHKeys() error
- func ListSnapshots(storageID string) error
- func ListStorage(storageID string) error
- func ListStorageEvents(storageID string) error
- func ListStorages(projectID string) error
- func LockDevice(deviceID string) error
- func MarshallAndPrint(v interface{}) error
- func NewExtPacketClient() (*extpackngo.Client, error)
- func NewPacketClient() (*packngo.Client, error)
- func PowerOffDevice(deviceID string) error
- func PowerOnDevice(deviceID string) error
- func RebootDevice(deviceID string) error
- func RemoveIPReservation(id string) error
- func RequestMoreIPReservations(projectID, ipType, comments string, quantity int) error
- func RestoreStorage(storageID, restorePoint string) error
- func SpotMarketPrices() error
- func UnAssignIPAddress(ipAddressID string) error
- func UnlockDevice(deviceID string) error
- func UpdateDevice(deviceID string, hostname, description, userData, ipxeScriptURL string, ...) error
- func UpdateProject(projectID, name, paymentID string) error
- func UpdateSSHKey(keyID, label, key string) error
- func UpdateSnapshotPolicy(snapshotPolicyID, frequency string, count int) error
- func UpdateStorage(storageID, description string, size int, locked bool) error
- type Config
- type Configs
Constants ¶
const ConfigDir = ".packet"
ConfigDir is the location of the config file under user's $HOME dir
const ConfigFile = "config"
ConfigFile is the filename of the config file
Variables ¶
var RootCmd = &cobra.Command{ Use: "packet", Short: "CLI tool to manage packet.net services", SilenceUsage: true, Run: func(cmd *cobra.Command, args []string) { showVersion, _ := cmd.Flags().GetBool("version") if showVersion { fmt.Printf("%s\n", version) } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func AssignIPAddress ¶
AssignIPAddress assigns an IP address to a device by ID
func AttachStorage ¶
AttachStorage attaches your volume to a device
func CloneStorage ¶
CloneStorage clones your volume or snapshot into a new volume. To clone the volume, send an empty body. To promote a volume snapshot into a new volume, include the snapshot_timestamp attribute in the request body.
func CreateDevice ¶
func CreateDevice(projectID, hostname, plan, facility, operatingSystem, billingCycle, userData, ipxeScriptURL string, tags []string, spotInstance, alwaysPXE bool, spotPriceMax float64) error
CreateDevice creates a new device
func CreateDeviceVerbose ¶
func CreateDeviceVerbose(projectID, hostname, plan, facility, operatingSystem, billingCycle, userData, ipxeScriptURL string, tags []string, spotInstance, alwaysPXE bool, spotPriceMax float64) error
CreateDeviceVerbose creates a new device and logs events till the device is provisionned
func CreateProject ¶
CreateProject creates a new project with the given project name
func CreateSnapshot ¶
CreateSnapshot creates a new snapshot of your volume
func CreateSnapshotPolicy ¶
CreateSnapshotPolicy creates a snapshot policy
func CreateStorage ¶
CreateStorage creates a new volume
func DeleteDevice ¶
DeleteDevice deletes the device associated with the given device id.
func DeleteProject ¶
DeleteProject deletes the project associated with the given project id.
func DeleteSSHKey ¶
DeleteSSHKey deletes the ssh key associated with the given key id.
func DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot
func DeleteSnapshotPolicy ¶
DeleteSnapshotPolicy deletes a snapshot policy
func DetachStorage ¶
DetachStorage detaches your volume from a device
func Execute ¶
func Execute()
Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetAPIKey ¶
GetAPIKey returns either the default configured key or the one passed through the CLI. The key passed through the CLI has the highest priority
func GetProjectID ¶
GetProjectID returns the project ID passed to the CLI, otherwise the configure default ID.
func ListDevice ¶
ListDevice prints out the device associated with the given device id.
func ListDeviceEvents ¶
ListDeviceEvents prints out events by device ID
func ListDevices ¶
ListDevices prints out all devices associated with the given project id.
func ListIPAddress ¶
ListIPAddress prints out ip address by ID
func ListIPReservation ¶
ListIPReservation returns a single IP reservation object
func ListIPReservations ¶
ListIPReservations provides a list of IP resevations for a single project
func ListProject ¶
ListProject prints out the project associated with a given project id
func ListProjectEvents ¶
ListProjectEvents prints out events by device ID
func ListSSHKey ¶
ListSSHKey prints out the ssh key associated with the given key id.
func ListSSHKeys ¶
func ListSSHKeys() error
ListSSHKeys prints out all ssh keys generated by the user.
func ListSnapshots ¶
ListSnapshots returns a list of the current volume’s snapshots
func ListStorageEvents ¶
ListStorageEvents prints out events by device ID
func ListStorages ¶
ListStorages returns a list of the current projects’s volumes
func LockDevice ¶
LockDevice locks the device associated with the given device id.
func MarshallAndPrint ¶
func MarshallAndPrint(v interface{}) error
MarshallAndPrint pretty-prints any object as a JSON string
func NewExtPacketClient ¶
func NewExtPacketClient() (*extpackngo.Client, error)
NewExtPacketClient returns a *extpackngo.Client ready for API calls
func NewPacketClient ¶
NewPacketClient returns a *packngo.Client ready for API calls
func PowerOffDevice ¶
PowerOffDevice powers off the device associated with the given device id.
func PowerOnDevice ¶
PowerOnDevice powers on the device associated with the given device id.
func RebootDevice ¶
RebootDevice reboots the device associated with the given device id.
func RemoveIPReservation ¶
RemoveIPReservation removes an IP reservation from the project
func RequestMoreIPReservations ¶
RequestMoreIPReservations requests more IP space for a project in order to have additional IP addresses to assign to devices
func RestoreStorage ¶
RestoreStorage restores a volume to the given snapshot
func UnAssignIPAddress ¶
UnAssignIPAddress unassigns and IP address from a device
func UnlockDevice ¶
UnlockDevice unlocks the device associated with the given device id.
func UpdateDevice ¶
func UpdateDevice(deviceID string, hostname, description, userData, ipxeScriptURL string, tags []string, locked, alwaysPXE bool) error
UpdateDevice updates a device by ID.
func UpdateProject ¶
UpdateProject updates the project associated with the given project id either by changing the name or the payment method.
func UpdateSSHKey ¶
UpdateSSHKey updates the ssh key associated with the given key id.
func UpdateSnapshotPolicy ¶
UpdateSnapshotPolicy updates a snapshot policy