MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / newStorageDownloadURLCmd

Function newStorageDownloadURLCmd

internal/cli/storage.go:440–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

438}
439
440func newStorageDownloadURLCmd() *cobra.Command {
441 cmd := &cobra.Command{
442 Use: "url <node> <storage> <url>",
443 Short: "Download content from a URL",
444 Args: cobra.ExactArgs(3),
445 Example: ` pvetui storage download url pve01 local https://example.com/debian-12.iso
446 pvetui storage download url pve01 local https://example.com/debian-12.iso --filename debian-12.iso
447 pvetui storage download url pve01 local https://example.com/debian-12.iso --no-wait`,
448 RunE: runStorageDownloadURL,
449 }
450
451 cmd.Flags().String("filename", "", "Override the destination filename")
452 cmd.Flags().String("content-type", "", "Content type override (iso, vztmpl, import); inferred from URL extension when omitted")
453 cmd.Flags().StringP("output", "o", "json", "Output format: json or table")
454 addNoWaitFlag(cmd)
455
456 cmd.ValidArgsFunction = completeStorageNames
457
458 return cmd
459}
460
461func runStorageDownloadURL(cmd *cobra.Command, args []string) error {
462 ctx := context.Background()

Callers 1

newStorageDownloadCmdFunction · 0.85

Calls 2

addNoWaitFlagFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected