download

package
v6.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	pulumi.CustomResourceState

	// The expected checksum of the file.
	Checksum pulumi.StringPtrOutput `pulumi:"checksum"`
	// The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
	ChecksumAlgorithm pulumi.StringPtrOutput `pulumi:"checksumAlgorithm"`
	// The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
	ContentType pulumi.StringOutput `pulumi:"contentType"`
	// The identifier for the target datastore.
	DatastoreId pulumi.StringOutput `pulumi:"datastoreId"`
	// Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
	DecompressionAlgorithm pulumi.StringPtrOutput `pulumi:"decompressionAlgorithm"`
	// The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
	FileName pulumi.StringOutput `pulumi:"fileName"`
	// The node name.
	NodeName pulumi.StringOutput `pulumi:"nodeName"`
	// If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
	Overwrite pulumi.BoolOutput `pulumi:"overwrite"`
	// If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
	OverwriteUnmanaged pulumi.BoolOutput `pulumi:"overwriteUnmanaged"`
	// The file size.
	Size pulumi.IntOutput `pulumi:"size"`
	// The file download timeout seconds. Default is 600 (10min).
	UploadTimeout pulumi.IntOutput `pulumi:"uploadTimeout"`
	// The URL to download the file from. Format `https?://.*`.
	Url pulumi.StringOutput `pulumi:"url"`
	// By default `true`. If `false`, no SSL/TLS certificates will be verified.
	Verify pulumi.BoolOutput `pulumi:"verify"`
}

Manages files upload using PVE download-url API. It can be fully compatible and faster replacement for image files created using `Storage.File`. Supports images for VMs (ISO images) and LXC (CT Templates).

## Example Usage

<!--Start PulumiCodeChooser --> ```go package main

import (

"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/Download"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Download.NewFile(ctx, "release20231228Debian12BookwormQcow2Img", &Download.FileArgs{
			Checksum:          pulumi.String("d2fbcf11fb28795842e91364d8c7b69f1870db09ff299eb94e4fbbfa510eb78d141e74c1f4bf6dfa0b7e33d0c3b66e6751886feadb4e9916f778bab1776bdf1b"),
			ChecksumAlgorithm: pulumi.String("sha512"),
			ContentType:       pulumi.String("iso"),
			DatastoreId:       pulumi.String("local"),
			FileName:          pulumi.String("debian-12-generic-amd64-20231228-1609.img"),
			NodeName:          pulumi.String("pve"),
			Url:               pulumi.String("https://cloud.debian.org/images/cloud/bookworm/20231228-1609/debian-12-generic-amd64-20231228-1609.qcow2"),
		})
		if err != nil {
			return err
		}
		_, err = Download.NewFile(ctx, "latestDebian12BookwormQcow2Img", &Download.FileArgs{
			ContentType: pulumi.String("iso"),
			DatastoreId: pulumi.String("local"),
			FileName:    pulumi.String("debian-12-generic-amd64.qcow2.img"),
			NodeName:    pulumi.String("pve"),
			Url:         pulumi.String("https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2"),
		})
		if err != nil {
			return err
		}
		_, err = Download.NewFile(ctx, "latestUbuntu22JammyQcow2Img", &Download.FileArgs{
			ContentType: pulumi.String("iso"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("pve"),
			Url:         pulumi.String("https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"),
		})
		if err != nil {
			return err
		}
		_, err = Download.NewFile(ctx, "latestStaticUbuntu24NobleQcow2Img", &Download.FileArgs{
			ContentType: pulumi.String("iso"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("pve"),
			Overwrite:   pulumi.Bool(false),
			Url:         pulumi.String("https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"),
		})
		if err != nil {
			return err
		}
		_, err = Download.NewFile(ctx, "release20231211Ubuntu22JammyLxcImg", &Download.FileArgs{
			Checksum:          pulumi.String("c9997dcfea5d826fd04871f960c513665f2e87dd7450bba99f68a97e60e4586e"),
			ChecksumAlgorithm: pulumi.String("sha256"),
			ContentType:       pulumi.String("vztmpl"),
			DatastoreId:       pulumi.String("local"),
			NodeName:          pulumi.String("pve"),
			UploadTimeout:     pulumi.Int(4444),
			Url:               pulumi.String("https://cloud-images.ubuntu.com/releases/22.04/release-20231211/ubuntu-22.04-server-cloudimg-amd64-root.tar.xz"),
		})
		if err != nil {
			return err
		}
		_, err = Download.NewFile(ctx, "latestUbuntu22JammyLxcImg", &Download.FileArgs{
			ContentType: pulumi.String("vztmpl"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("pve"),
			Url:         pulumi.String("https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.tar.gz"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` <!--End PulumiCodeChooser -->

func GetFile

func GetFile(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *FileState, opts ...pulumi.ResourceOption) (*File, error)

GetFile gets an existing File resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewFile

func NewFile(ctx *pulumi.Context,
	name string, args *FileArgs, opts ...pulumi.ResourceOption) (*File, error)

NewFile registers a new resource with the given unique name, arguments, and options.

func (*File) ElementType

func (*File) ElementType() reflect.Type

func (*File) ToFileOutput

func (i *File) ToFileOutput() FileOutput

func (*File) ToFileOutputWithContext

func (i *File) ToFileOutputWithContext(ctx context.Context) FileOutput

type FileArgs

type FileArgs struct {
	// The expected checksum of the file.
	Checksum pulumi.StringPtrInput
	// The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
	ChecksumAlgorithm pulumi.StringPtrInput
	// The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
	ContentType pulumi.StringInput
	// The identifier for the target datastore.
	DatastoreId pulumi.StringInput
	// Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
	DecompressionAlgorithm pulumi.StringPtrInput
	// The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
	FileName pulumi.StringPtrInput
	// The node name.
	NodeName pulumi.StringInput
	// If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
	Overwrite pulumi.BoolPtrInput
	// If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
	OverwriteUnmanaged pulumi.BoolPtrInput
	// The file download timeout seconds. Default is 600 (10min).
	UploadTimeout pulumi.IntPtrInput
	// The URL to download the file from. Format `https?://.*`.
	Url pulumi.StringInput
	// By default `true`. If `false`, no SSL/TLS certificates will be verified.
	Verify pulumi.BoolPtrInput
}

The set of arguments for constructing a File resource.

func (FileArgs) ElementType

func (FileArgs) ElementType() reflect.Type

type FileArray

type FileArray []FileInput

func (FileArray) ElementType

func (FileArray) ElementType() reflect.Type

func (FileArray) ToFileArrayOutput

func (i FileArray) ToFileArrayOutput() FileArrayOutput

func (FileArray) ToFileArrayOutputWithContext

func (i FileArray) ToFileArrayOutputWithContext(ctx context.Context) FileArrayOutput

type FileArrayInput

type FileArrayInput interface {
	pulumi.Input

	ToFileArrayOutput() FileArrayOutput
	ToFileArrayOutputWithContext(context.Context) FileArrayOutput
}

FileArrayInput is an input type that accepts FileArray and FileArrayOutput values. You can construct a concrete instance of `FileArrayInput` via:

FileArray{ FileArgs{...} }

type FileArrayOutput

type FileArrayOutput struct{ *pulumi.OutputState }

func (FileArrayOutput) ElementType

func (FileArrayOutput) ElementType() reflect.Type

func (FileArrayOutput) Index

func (FileArrayOutput) ToFileArrayOutput

func (o FileArrayOutput) ToFileArrayOutput() FileArrayOutput

func (FileArrayOutput) ToFileArrayOutputWithContext

func (o FileArrayOutput) ToFileArrayOutputWithContext(ctx context.Context) FileArrayOutput

type FileInput

type FileInput interface {
	pulumi.Input

	ToFileOutput() FileOutput
	ToFileOutputWithContext(ctx context.Context) FileOutput
}

type FileMap

type FileMap map[string]FileInput

func (FileMap) ElementType

func (FileMap) ElementType() reflect.Type

func (FileMap) ToFileMapOutput

func (i FileMap) ToFileMapOutput() FileMapOutput

func (FileMap) ToFileMapOutputWithContext

func (i FileMap) ToFileMapOutputWithContext(ctx context.Context) FileMapOutput

type FileMapInput

type FileMapInput interface {
	pulumi.Input

	ToFileMapOutput() FileMapOutput
	ToFileMapOutputWithContext(context.Context) FileMapOutput
}

FileMapInput is an input type that accepts FileMap and FileMapOutput values. You can construct a concrete instance of `FileMapInput` via:

FileMap{ "key": FileArgs{...} }

type FileMapOutput

type FileMapOutput struct{ *pulumi.OutputState }

func (FileMapOutput) ElementType

func (FileMapOutput) ElementType() reflect.Type

func (FileMapOutput) MapIndex

func (FileMapOutput) ToFileMapOutput

func (o FileMapOutput) ToFileMapOutput() FileMapOutput

func (FileMapOutput) ToFileMapOutputWithContext

func (o FileMapOutput) ToFileMapOutputWithContext(ctx context.Context) FileMapOutput

type FileOutput

type FileOutput struct{ *pulumi.OutputState }

func (FileOutput) Checksum

func (o FileOutput) Checksum() pulumi.StringPtrOutput

The expected checksum of the file.

func (FileOutput) ChecksumAlgorithm

func (o FileOutput) ChecksumAlgorithm() pulumi.StringPtrOutput

The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.

func (FileOutput) ContentType

func (o FileOutput) ContentType() pulumi.StringOutput

The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.

func (FileOutput) DatastoreId

func (o FileOutput) DatastoreId() pulumi.StringOutput

The identifier for the target datastore.

func (FileOutput) DecompressionAlgorithm

func (o FileOutput) DecompressionAlgorithm() pulumi.StringPtrOutput

Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.

func (FileOutput) ElementType

func (FileOutput) ElementType() reflect.Type

func (FileOutput) FileName

func (o FileOutput) FileName() pulumi.StringOutput

The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.

func (FileOutput) NodeName

func (o FileOutput) NodeName() pulumi.StringOutput

The node name.

func (FileOutput) Overwrite

func (o FileOutput) Overwrite() pulumi.BoolOutput

If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.

func (FileOutput) OverwriteUnmanaged

func (o FileOutput) OverwriteUnmanaged() pulumi.BoolOutput

If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.

func (FileOutput) Size

func (o FileOutput) Size() pulumi.IntOutput

The file size.

func (FileOutput) ToFileOutput

func (o FileOutput) ToFileOutput() FileOutput

func (FileOutput) ToFileOutputWithContext

func (o FileOutput) ToFileOutputWithContext(ctx context.Context) FileOutput

func (FileOutput) UploadTimeout

func (o FileOutput) UploadTimeout() pulumi.IntOutput

The file download timeout seconds. Default is 600 (10min).

func (FileOutput) Url

func (o FileOutput) Url() pulumi.StringOutput

The URL to download the file from. Format `https?://.*`.

func (FileOutput) Verify

func (o FileOutput) Verify() pulumi.BoolOutput

By default `true`. If `false`, no SSL/TLS certificates will be verified.

type FileState

type FileState struct {
	// The expected checksum of the file.
	Checksum pulumi.StringPtrInput
	// The algorithm to calculate the checksum of the file. Must be `md5` | `sha1` | `sha224` | `sha256` | `sha384` | `sha512`.
	ChecksumAlgorithm pulumi.StringPtrInput
	// The file content type. Must be `iso` for VM images or `vztmpl` for LXC images.
	ContentType pulumi.StringPtrInput
	// The identifier for the target datastore.
	DatastoreId pulumi.StringPtrInput
	// Decompress the downloaded file using the specified compression algorithm. Must be one of `gz` | `lzo` | `zst`.
	DecompressionAlgorithm pulumi.StringPtrInput
	// The file name. If not provided, it is calculated using `url`. PVE will raise 'wrong file extension' error for some popular extensions file `.raw` or `.qcow2`. Workaround is to use e.g. `.img` instead.
	FileName pulumi.StringPtrInput
	// The node name.
	NodeName pulumi.StringPtrInput
	// If `true` and size of uploaded file is different, than size from `url` Content-Length header, file will be downloaded again. If `false`, there will be no checks.
	Overwrite pulumi.BoolPtrInput
	// If `true` and a file with the same name already exists in the datastore, it will be deleted and the new file will be downloaded. If `false` and the file already exists, an error will be returned.
	OverwriteUnmanaged pulumi.BoolPtrInput
	// The file size.
	Size pulumi.IntPtrInput
	// The file download timeout seconds. Default is 600 (10min).
	UploadTimeout pulumi.IntPtrInput
	// The URL to download the file from. Format `https?://.*`.
	Url pulumi.StringPtrInput
	// By default `true`. If `false`, no SSL/TLS certificates will be verified.
	Verify pulumi.BoolPtrInput
}

func (FileState) ElementType

func (FileState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

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