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

Function newStorageDownloadTemplateCmd

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

Source from the content-addressed store, hash-verified

537}
538
539func newStorageDownloadTemplateCmd() *cobra.Command {
540 cmd := &cobra.Command{
541 Use: "template <node> <storage> <template>",
542 Short: "Download an appliance template",
543 Long: `Download an appliance template from the Proxmox catalog.
544
545<template> may be a full filename (e.g. debian-12-standard_12.7-1_amd64.tar.zst) or
546a package name (e.g. debian-12-standard). When a package name is given, the latest
547version is resolved automatically and the resolved filename is printed to stderr.`,
548 Args: cobra.ExactArgs(3),
549 Example: ` pvetui storage download template pve01 local debian-12-standard
550 pvetui storage download template pve01 local debian-12-standard --section system
551 pvetui storage download template pve01 local debian-12-standard_12.7-1_amd64.tar.zst`,
552 RunE: runStorageDownloadTemplate,
553 }
554
555 cmd.Flags().String("section", "", "Narrow template resolution by section (system, mail, turnkeylinux)")
556 cmd.Flags().StringP("output", "o", "json", "Output format: json or table")
557 addNoWaitFlag(cmd)
558
559 cmd.ValidArgsFunction = completeTemplateNames
560
561 return cmd
562}
563
564func runStorageDownloadTemplate(cmd *cobra.Command, args []string) error {
565 ctx := context.Background()

Callers 1

newStorageDownloadCmdFunction · 0.85

Calls 2

addNoWaitFlagFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected