1. Packages
  2. Packages
  3. Proxmox Virtual Environment (Proxmox VE)
  4. API Docs
  5. getFiles
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski
proxmoxve logo
Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski

    Retrieves a list of files available in a datastore on a specific Proxmox VE node.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
    import * as std from "@pulumi/std";
    
    export = async () => {
        const isoFiles = await proxmoxve.getFiles({
            nodeName: "pve",
            datastoreId: "local",
            contentType: "iso",
        });
        const imageExists = (await std.anytrue({
            input: .map(f => (f.fileName == "noble-server-cloudimg-amd64.img")),
        })).result;
        // Only download if the image doesn't already exist
        const ubuntuNoble: proxmoxve.download.FileLegacy[] = [];
        for (const range = {value: 0}; range.value < (imageExists ? 0 : 1); range.value++) {
            ubuntuNoble.push(new proxmoxve.download.FileLegacy(`ubuntu_noble-${range.value}`, {
                datastoreId: "local",
                nodeName: "pve",
                contentType: "iso",
                url: "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img",
            }));
        }
        // List all files without filtering
        const allFiles = await proxmoxve.getFiles({
            nodeName: "pve",
            datastoreId: "local",
        });
        return {
            isoFileCount: isoFiles.files.length,
            allFileNames: .map(f => (f.fileName)),
        };
    }
    
    import pulumi
    import pulumi_proxmoxve as proxmoxve
    import pulumi_std as std
    
    iso_files = proxmoxve.get_files(node_name="pve",
        datastore_id="local",
        content_type="iso")
    image_exists = std.anytrue(input=[f.file_name == "noble-server-cloudimg-amd64.img" for f in iso_files.files]).result
    # Only download if the image doesn't already exist
    ubuntu_noble = []
    for range in [{"value": i} for i in range(0, 0 if image_exists else 1)]:
        ubuntu_noble.append(proxmoxve.download.FileLegacy(f"ubuntu_noble-{range['value']}",
            datastore_id="local",
            node_name="pve",
            content_type="iso",
            url="https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"))
    # List all files without filtering
    all_files = proxmoxve.get_files(node_name="pve",
        datastore_id="local")
    pulumi.export("isoFileCount", len(iso_files.files))
    pulumi.export("allFileNames", [f.file_name for f in all_files.files])
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using ProxmoxVE = Pulumi.ProxmoxVE;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(async() => 
    {
        var isoFiles = await ProxmoxVE.Index.GetFiles.InvokeAsync(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
            ContentType = "iso",
        });
    
        var imageExists = (await Std.Index.Anytrue.InvokeAsync(new()
        {
            Input = ,
        })).Result;
    
        // Only download if the image doesn't already exist
        var ubuntuNoble = new List<ProxmoxVE.Download.FileLegacy>();
        for (var rangeIndex = 0; rangeIndex < imageExists ? %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(0) (example.pp:14,27-28)) : %!v(PANIC=Format method: fatal: A failure has occurred: unexpected literal type in GenLiteralValueExpression: cty.NumberIntVal(1) (example.pp:14,31-32)); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            ubuntuNoble.Add(new ProxmoxVE.Download.FileLegacy($"ubuntu_noble-{range.Value}", new()
            {
                DatastoreId = "local",
                NodeName = "pve",
                ContentType = "iso",
                Url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img",
            }));
        }
        // List all files without filtering
        var allFiles = await ProxmoxVE.Index.GetFiles.InvokeAsync(new()
        {
            NodeName = "pve",
            DatastoreId = "local",
        });
    
        return new Dictionary<string, object?>
        {
            ["isoFileCount"] = isoFiles.Files.Length,
            ["allFileNames"] = ,
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Using getFiles

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getFiles(args: GetFilesArgs, opts?: InvokeOptions): Promise<GetFilesResult>
    function getFilesOutput(args: GetFilesOutputArgs, opts?: InvokeOptions): Output<GetFilesResult>
    def get_files(content_type: Optional[str] = None,
                  datastore_id: Optional[str] = None,
                  file_name_regex: Optional[str] = None,
                  node_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetFilesResult
    def get_files_output(content_type: Optional[pulumi.Input[str]] = None,
                  datastore_id: Optional[pulumi.Input[str]] = None,
                  file_name_regex: Optional[pulumi.Input[str]] = None,
                  node_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetFilesResult]
    func GetFiles(ctx *Context, args *GetFilesArgs, opts ...InvokeOption) (*GetFilesResult, error)
    func GetFilesOutput(ctx *Context, args *GetFilesOutputArgs, opts ...InvokeOption) GetFilesResultOutput

    > Note: This function is named GetFiles in the Go SDK.

    public static class GetFiles 
    {
        public static Task<GetFilesResult> InvokeAsync(GetFilesArgs args, InvokeOptions? opts = null)
        public static Output<GetFilesResult> Invoke(GetFilesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFilesResult> getFiles(GetFilesArgs args, InvokeOptions options)
    public static Output<GetFilesResult> getFiles(GetFilesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: proxmoxve:index/getFiles:getFiles
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DatastoreId string
    The identifier of the datastore.
    NodeName string
    The name of the node.
    ContentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    FileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    DatastoreId string
    The identifier of the datastore.
    NodeName string
    The name of the node.
    ContentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    FileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId String
    The identifier of the datastore.
    nodeName String
    The name of the node.
    contentType String
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex String
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId string
    The identifier of the datastore.
    nodeName string
    The name of the node.
    contentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastore_id str
    The identifier of the datastore.
    node_name str
    The name of the node.
    content_type str
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    file_name_regex str
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId String
    The identifier of the datastore.
    nodeName String
    The name of the node.
    contentType String
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex String
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.

    getFiles Result

    The following output properties are available:

    DatastoreId string
    The identifier of the datastore.
    Files List<Pulumi.ProxmoxVE.Outputs.GetFilesFile>
    The list of files in the datastore.
    Id string
    The provider-assigned unique ID for this managed resource.
    NodeName string
    The name of the node.
    ContentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    FileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    DatastoreId string
    The identifier of the datastore.
    Files []GetFilesFile
    The list of files in the datastore.
    Id string
    The provider-assigned unique ID for this managed resource.
    NodeName string
    The name of the node.
    ContentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    FileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId String
    The identifier of the datastore.
    files List<GetFilesFile>
    The list of files in the datastore.
    id String
    The provider-assigned unique ID for this managed resource.
    nodeName String
    The name of the node.
    contentType String
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex String
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId string
    The identifier of the datastore.
    files GetFilesFile[]
    The list of files in the datastore.
    id string
    The provider-assigned unique ID for this managed resource.
    nodeName string
    The name of the node.
    contentType string
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex string
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastore_id str
    The identifier of the datastore.
    files Sequence[GetFilesFile]
    The list of files in the datastore.
    id str
    The provider-assigned unique ID for this managed resource.
    node_name str
    The name of the node.
    content_type str
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    file_name_regex str
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.
    datastoreId String
    The identifier of the datastore.
    files List<Property Map>
    The list of files in the datastore.
    id String
    The provider-assigned unique ID for this managed resource.
    nodeName String
    The name of the node.
    contentType String
    The content type to filter by. When set, only files of this type are returned. Valid values are backup, images, import, iso, rootdir, snippets, vztmpl.
    fileNameRegex String
    A regular expression to filter files by name. When set, only files whose name matches the expression are returned.

    Supporting Types

    GetFilesFile

    ContentType string
    The content type of the file.
    FileFormat string
    The format of the file.
    FileName string
    The name of the file.
    FileSize int
    The size of the file in bytes.
    Id string
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    Vmid int
    The VM ID associated with the file, if applicable.
    ContentType string
    The content type of the file.
    FileFormat string
    The format of the file.
    FileName string
    The name of the file.
    FileSize int
    The size of the file in bytes.
    Id string
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    Vmid int
    The VM ID associated with the file, if applicable.
    contentType String
    The content type of the file.
    fileFormat String
    The format of the file.
    fileName String
    The name of the file.
    fileSize Integer
    The size of the file in bytes.
    id String
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    vmid Integer
    The VM ID associated with the file, if applicable.
    contentType string
    The content type of the file.
    fileFormat string
    The format of the file.
    fileName string
    The name of the file.
    fileSize number
    The size of the file in bytes.
    id string
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    vmid number
    The VM ID associated with the file, if applicable.
    content_type str
    The content type of the file.
    file_format str
    The format of the file.
    file_name str
    The name of the file.
    file_size int
    The size of the file in bytes.
    id str
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    vmid int
    The VM ID associated with the file, if applicable.
    contentType String
    The content type of the file.
    fileFormat String
    The format of the file.
    fileName String
    The name of the file.
    fileSize Number
    The size of the file in bytes.
    id String
    The unique identifier of the file (volume ID), e.g. local:iso/ubuntu.iso.
    vmid Number
    The VM ID associated with the file, if applicable.

    Package Details

    Repository
    proxmoxve muhlba91/pulumi-proxmoxve
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the proxmox Terraform Provider.
    proxmoxve logo
    Viewing docs for Proxmox Virtual Environment (Proxmox VE) v8.1.0
    published on Sunday, Apr 26, 2026 by Daniel Muehlbachler-Pietrzykowski
      Try Pulumi Cloud free. Your team will thank you.