upload

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2018 License: MIT Imports: 13 Imported by: 0

README

Proxmox Upload Command

This command calls out to the specified Proxmox API server endpoint at /api2/json/nodes/$node/storage/$storage/upload and uploads the image. If user didn't specify the storage device, it will call out to /api2/json/nodes/%s/storage and obtain the first storage device that can accept the specified format.

This command requires authentication. Unless a ticket cache is already saved, use Proxmox Login Command first.

Attempts were made to utilize native Go API (namely the multipart package) to do the upload directly, however, it didn't seem to play well with the Proxmox Upload API. Hence, the currently implementation uses curl command in insecure mode.

As of now, all communications to Proxmox endpoints skip TLS verification.

TLDR;

$ homelab proxmox upload \
    --node=pve \
    --storage=local \
    --file=/my/downloads/ubuntu.iso \
    --format=iso

Parameters

Flag Required Default Content
--node no pve The node in the Proxmox cluster to upload to
--storage yes -- The storage device to save to
--file yes -- The absolute path to the file to upload
--format no iso The format of the file to upload

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProxmoxUploadCommand

func NewProxmoxUploadCommand() *cobra.Command

Types

type ProxmoxUploadRequest

type ProxmoxUploadRequest struct {
	shared.ExtraArgs
	Node    string
	Storage string
	File    string
	Format  string
}

Arguments for 'proxmox upload' command.

func (*ProxmoxUploadRequest) Upload

func (ur *ProxmoxUploadRequest) Upload() error

Perform upload. If ProxmoxUploadRequest#Storage is not set, this method will try to query the Proxmox API for the first storage device that accepts ProxmoxUploadRequest#Format and use that device as the storage option.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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