()
| 438 | } |
| 439 | |
| 440 | func 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 | |
| 461 | func runStorageDownloadURL(cmd *cobra.Command, args []string) error { |
| 462 | ctx := context.Background() |
no test coverage detected