import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
 * Use this resource to upload files to a Proxmox VE node. The file can be a backup, an ISO image, a Disk Image, a snippet, or a container template depending on the `contentType` attribute.
 *
 * ## Example Usage
 *
 * ### Backups (`backup`)
 *
 * > The resource with this content type uses SSH access to the node. You might need to configure the `ssh` option in the `provider` section.
 *
 * > The provider currently does not support restoring backups. You can use the Proxmox VE web interface or the `qmrestore` / `pct restore` command to restore VM / Container from a backup.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 *
 * const backup = new proxmoxve.FileLegacy("backup", {
 *     contentType: "backup",
 *     datastoreId: "local",
 *     nodeName: "pve",
 *     sourceFile: {
 *         path: "vzdump-lxc-100-2023_11_08-23_10_05.tar.zst",
 *     },
 * });
 * ```
 *
 * ### Images
 *
 * > Consider using `proxmoxve.download.FileLegacy` resource instead. Using this resource for images is less efficient (requires to transfer uploaded image to node) though still supported.
 *
 * > The `import` content type is not enabled by default on Proxmox VE storages. To use this resource with `contentType = "import"`, first add `Import` to the allowed content types on the target storage under 'Datacenter > Storage' in the Proxmox web interface.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 *
 * const ubuntuContainerTemplate = new proxmoxve.FileLegacy("ubuntu_container_template", {
 *     contentType: "iso",
 *     datastoreId: "local",
 *     nodeName: "pve",
 *     sourceFile: {
 *         path: "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img",
 *     },
 * });
 * ```
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 *
 * const ubuntuContainerTemplate = new proxmoxve.FileLegacy("ubuntu_container_template", {
 *     contentType: "import",
 *     datastoreId: "local",
 *     nodeName: "pve",
 *     sourceFile: {
 *         path: "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img",
 *     },
 * });
 * ```
 *
 * ### Snippets
 *
 * > Snippets are not enabled by default in new Proxmox installations. You need to enable them in the 'Datacenter>Storage' section of the proxmox interface before first using this resource.
 *
 * > The resource with this content type uses SSH access to the node. You might need to configure the `ssh` option in the `provider` section.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 * import * as std from "@pulumi/std";
 *
 * const cloudConfig = new proxmoxve.FileLegacy("cloud_config", {
 *     contentType: "snippets",
 *     datastoreId: "local",
 *     nodeName: "pve",
 *     sourceRaw: {
 *         data: std.trimspace({
 *             input: example.publicKeyOpenssh,
 *         }).then(invoke => `#cloud-config
 * chpasswd:
 *   list: |
 *     ubuntu:example
 *   expire: false
 * hostname: example-hostname
 * packages:
 *   - qemu-guest-agent
 * users:
 *   - default
 *   - name: ubuntu
 *     groups: sudo
 *     shell: /bin/bash
 *     ssh-authorized-keys:
 *       - ${invoke.result}
 *     sudo: ALL=(ALL) NOPASSWD:ALL
 * `),
 *         fileName: "example.cloud-config.yaml",
 *     },
 * });
 * ```
 *
 * The `fileMode` attribute can be used to make a script file executable, e.g. when referencing the file in the `hookScriptFileId` attribute of [a container](https://bpg.sh/docs/resources/virtual_environment_container#hook-script-file-id) or [a VM](https://bpg.sh/docs/resources/virtual_environment_vm#hook-script-file-id) resource which is a requirement enforced by the Proxmox VE API.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 *
 * const hookScript = new proxmoxve.FileLegacy("hook_script", {
 *     contentType: "snippets",
 *     datastoreId: "local",
 *     nodeName: "pve",
 *     fileMode: "0700",
 *     sourceRaw: {
 *         data: `#!/usr/bin/env bash
 *
 * echo \\"Running hook script\\"
 * `,
 *         fileName: "prepare-hook.sh",
 *     },
 * });
 * ```
 *
 * ### Container Template (`vztmpl`)
 *
 * > Consider using `proxmoxve.download.FileLegacy` resource instead. Using this resource for container images is less efficient (requires to transfer uploaded image to node) though still supported.
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
 *
 * const ubuntuContainerTemplate = new proxmoxve.FileLegacy("ubuntu_container_template", {
 *     contentType: "vztmpl",
 *     datastoreId: "local",
 *     nodeName: "first-node",
 *     sourceFile: {
 *         path: "http://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz",
 *     },
 * });
 * ```
 *
 * ## Important Notes
 *
 * The Proxmox VE API endpoint for file uploads does not support chunked transfer
 * encoding, which means that we must first store the source file as a temporary
 * file locally before uploading it.
 *
 * You must ensure that you have at least `Size-in-MB * 2 + 1` MB of storage space
 * available (twice the size plus overhead because a multipart payload needs to be
 * created as another temporary file).
 *
 * By default, if the specified file already exists, the resource will
 * unconditionally replace it and take ownership of the resource. On destruction,
 * the file will be deleted as if it did not exist before. If you want to prevent
 * the resource from replacing the file, set `overwrite` to `false`.
 *
 * ## Import
 *
 * Instances can be imported using the `nodeName`, `datastoreId`, `contentType`
 * and the `fileName` in the following format:
 *
 * Example:
 *
 * ```sh
 * $ pulumi import proxmoxve:index/fileLegacy:FileLegacy cloud_config pve/local:snippets/example.cloud-config.yaml
 * ```
 */
export declare class FileLegacy extends pulumi.CustomResource {
    /**
     * Get an existing FileLegacy resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FileLegacyState, opts?: pulumi.CustomResourceOptions): FileLegacy;
    /**
     * Returns true if the given object is an instance of FileLegacy.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj: any): obj is FileLegacy;
    /**
     * The content type. If not specified, the content
     * type will be inferred from the file extension. Valid values are:
     */
    readonly contentType: pulumi.Output<string>;
    /**
     * The datastore id.
     */
    readonly datastoreId: pulumi.Output<string>;
    /**
     * The file mode in octal format, e.g. `0700` or `600`. Note that the prefixes `0o` and `0x` is not supported! Setting this attribute is also only allowed for `root@pam` authenticated user.
     */
    readonly fileMode: pulumi.Output<string | undefined>;
    /**
     * The file modification date (RFC 3339).
     */
    readonly fileModificationDate: pulumi.Output<string>;
    /**
     * The file name.
     */
    readonly fileName: pulumi.Output<string>;
    /**
     * The file size in bytes.
     */
    readonly fileSize: pulumi.Output<number>;
    /**
     * The file tag.
     */
    readonly fileTag: pulumi.Output<string>;
    /**
     * The node name.
     */
    readonly nodeName: pulumi.Output<string>;
    /**
     * Whether to overwrite an existing file (defaults to
     * `true`).
     */
    readonly overwrite: pulumi.Output<boolean | undefined>;
    /**
     * The source file (conflicts with `sourceRaw`),
     * could be a local file or a URL. If the source file is a URL, the file will
     * be downloaded and stored locally before uploading it to Proxmox VE.
     */
    readonly sourceFile: pulumi.Output<outputs.FileLegacySourceFile | undefined>;
    /**
     * The raw source (conflicts with `sourceFile`).
     */
    readonly sourceRaw: pulumi.Output<outputs.FileLegacySourceRaw | undefined>;
    /**
     * Timeout for uploading ISO/VSTMPL files in
     * seconds (defaults to 1800).
     */
    readonly timeoutUpload: pulumi.Output<number | undefined>;
    /**
     * The SSH upload mode for non-API content types
     * (snippets, backups, etc.). Set to `stream` to pipe the file through an SSH
     * shell session (uses `sudo` where required), or `sftp` to upload via the SFTP
     * subsystem. Use `sftp` when the target host's SSH server only allows the
     * SFTP subsystem; note that the SFTP path does not invoke `sudo`, so the SSH
     * user must have direct write permission to the target directory. Has no
     * effect for `iso`, `vztmpl`, and `import` content types, which always use
     * the HTTP API. Defaults to `stream`.
     */
    readonly uploadMode: pulumi.Output<string | undefined>;
    /**
     * Create a FileLegacy resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name: string, args: FileLegacyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
 * Input properties used for looking up and filtering FileLegacy resources.
 */
export interface FileLegacyState {
    /**
     * The content type. If not specified, the content
     * type will be inferred from the file extension. Valid values are:
     */
    contentType?: pulumi.Input<string | undefined>;
    /**
     * The datastore id.
     */
    datastoreId?: pulumi.Input<string | undefined>;
    /**
     * The file mode in octal format, e.g. `0700` or `600`. Note that the prefixes `0o` and `0x` is not supported! Setting this attribute is also only allowed for `root@pam` authenticated user.
     */
    fileMode?: pulumi.Input<string | undefined>;
    /**
     * The file modification date (RFC 3339).
     */
    fileModificationDate?: pulumi.Input<string | undefined>;
    /**
     * The file name.
     */
    fileName?: pulumi.Input<string | undefined>;
    /**
     * The file size in bytes.
     */
    fileSize?: pulumi.Input<number | undefined>;
    /**
     * The file tag.
     */
    fileTag?: pulumi.Input<string | undefined>;
    /**
     * The node name.
     */
    nodeName?: pulumi.Input<string | undefined>;
    /**
     * Whether to overwrite an existing file (defaults to
     * `true`).
     */
    overwrite?: pulumi.Input<boolean | undefined>;
    /**
     * The source file (conflicts with `sourceRaw`),
     * could be a local file or a URL. If the source file is a URL, the file will
     * be downloaded and stored locally before uploading it to Proxmox VE.
     */
    sourceFile?: pulumi.Input<inputs.FileLegacySourceFile | undefined>;
    /**
     * The raw source (conflicts with `sourceFile`).
     */
    sourceRaw?: pulumi.Input<inputs.FileLegacySourceRaw | undefined>;
    /**
     * Timeout for uploading ISO/VSTMPL files in
     * seconds (defaults to 1800).
     */
    timeoutUpload?: pulumi.Input<number | undefined>;
    /**
     * The SSH upload mode for non-API content types
     * (snippets, backups, etc.). Set to `stream` to pipe the file through an SSH
     * shell session (uses `sudo` where required), or `sftp` to upload via the SFTP
     * subsystem. Use `sftp` when the target host's SSH server only allows the
     * SFTP subsystem; note that the SFTP path does not invoke `sudo`, so the SSH
     * user must have direct write permission to the target directory. Has no
     * effect for `iso`, `vztmpl`, and `import` content types, which always use
     * the HTTP API. Defaults to `stream`.
     */
    uploadMode?: pulumi.Input<string | undefined>;
}
/**
 * The set of arguments for constructing a FileLegacy resource.
 */
export interface FileLegacyArgs {
    /**
     * The content type. If not specified, the content
     * type will be inferred from the file extension. Valid values are:
     */
    contentType?: pulumi.Input<string | undefined>;
    /**
     * The datastore id.
     */
    datastoreId: pulumi.Input<string>;
    /**
     * The file mode in octal format, e.g. `0700` or `600`. Note that the prefixes `0o` and `0x` is not supported! Setting this attribute is also only allowed for `root@pam` authenticated user.
     */
    fileMode?: pulumi.Input<string | undefined>;
    /**
     * The node name.
     */
    nodeName: pulumi.Input<string>;
    /**
     * Whether to overwrite an existing file (defaults to
     * `true`).
     */
    overwrite?: pulumi.Input<boolean | undefined>;
    /**
     * The source file (conflicts with `sourceRaw`),
     * could be a local file or a URL. If the source file is a URL, the file will
     * be downloaded and stored locally before uploading it to Proxmox VE.
     */
    sourceFile?: pulumi.Input<inputs.FileLegacySourceFile | undefined>;
    /**
     * The raw source (conflicts with `sourceFile`).
     */
    sourceRaw?: pulumi.Input<inputs.FileLegacySourceRaw | undefined>;
    /**
     * Timeout for uploading ISO/VSTMPL files in
     * seconds (defaults to 1800).
     */
    timeoutUpload?: pulumi.Input<number | undefined>;
    /**
     * The SSH upload mode for non-API content types
     * (snippets, backups, etc.). Set to `stream` to pipe the file through an SSH
     * shell session (uses `sudo` where required), or `sftp` to upload via the SFTP
     * subsystem. Use `sftp` when the target host's SSH server only allows the
     * SFTP subsystem; note that the SFTP path does not invoke `sudo`, so the SSH
     * user must have direct write permission to the target directory. Has no
     * effect for `iso`, `vztmpl`, and `import` content types, which always use
     * the HTTP API. Defaults to `stream`.
     */
    uploadMode?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=fileLegacy.d.ts.map