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

    Deprecated: Use proxmoxve.sdn.getVnets instead. This data source will be removed in v1.0.

    Retrieves information about all SDN VNets in Proxmox. This data source lists all virtual networks configured in the Software-Defined Networking setup.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
    
    // List all SDN VNets
    const all = proxmoxve.sdn.getVnetsLegacy({});
    export const dataProxmoxVirtualEnvironmentSdnVnetsAll = {
        vnets: all.then(all => all.vnets),
    };
    
    import pulumi
    import pulumi_proxmoxve as proxmoxve
    
    # List all SDN VNets
    all = proxmoxve.sdn.get_vnets_legacy()
    pulumi.export("dataProxmoxVirtualEnvironmentSdnVnetsAll", {
        "vnets": all.vnets,
    })
    
    package main
    
    import (
    	"github.com/muhlba91/pulumi-proxmoxve/sdk/v8/go/proxmoxve/sdn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// List all SDN VNets
    		all, err := sdn.GetVnetsLegacy(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("dataProxmoxVirtualEnvironmentSdnVnetsAll", []sdn.GetVnetsLegacyVnetMap{
    			"vnets": all.Vnets,
    		})
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using ProxmoxVE = Pulumi.ProxmoxVE;
    
    return await Deployment.RunAsync(() => 
    {
        // List all SDN VNets
        var all = ProxmoxVE.Sdn.GetVnetsLegacy.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["dataProxmoxVirtualEnvironmentSdnVnetsAll"] = 
            {
                { "vnets", all.Apply(getVnetsLegacyResult => getVnetsLegacyResult.Vnets) },
            },
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.proxmoxve.sdn.SdnFunctions;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // List all SDN VNets
            final var all = SdnFunctions.getVnetsLegacy(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            ctx.export("dataProxmoxVirtualEnvironmentSdnVnetsAll", Map.of("vnets", all.vnets()));
        }
    }
    
    variables:
      # List all SDN VNets
      all:
        fn::invoke:
          function: proxmoxve:sdn:getVnetsLegacy
          arguments: {}
    outputs:
      dataProxmoxVirtualEnvironmentSdnVnetsAll:
        vnets: ${all.vnets}
    

    Using getVnetsLegacy

    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 getVnetsLegacy(opts?: InvokeOptions): Promise<GetVnetsLegacyResult>
    function getVnetsLegacyOutput(opts?: InvokeOptions): Output<GetVnetsLegacyResult>
    def get_vnets_legacy(opts: Optional[InvokeOptions] = None) -> GetVnetsLegacyResult
    def get_vnets_legacy_output(opts: Optional[InvokeOptions] = None) -> Output[GetVnetsLegacyResult]
    func GetVnetsLegacy(ctx *Context, opts ...InvokeOption) (*GetVnetsLegacyResult, error)
    func GetVnetsLegacyOutput(ctx *Context, opts ...InvokeOption) GetVnetsLegacyResultOutput

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

    public static class GetVnetsLegacy 
    {
        public static Task<GetVnetsLegacyResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetVnetsLegacyResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVnetsLegacyResult> getVnetsLegacy(InvokeOptions options)
    public static Output<GetVnetsLegacyResult> getVnetsLegacy(InvokeOptions options)
    
    fn::invoke:
      function: proxmoxve:sdn/getVnetsLegacy:getVnetsLegacy
      arguments:
        # arguments dictionary

    getVnetsLegacy Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Vnets List<Pulumi.ProxmoxVE.Sdn.Outputs.GetVnetsLegacyVnet>
    List of SDN VNets.
    Id string
    The provider-assigned unique ID for this managed resource.
    Vnets []GetVnetsLegacyVnet
    List of SDN VNets.
    id String
    The provider-assigned unique ID for this managed resource.
    vnets List<GetVnetsLegacyVnet>
    List of SDN VNets.
    id string
    The provider-assigned unique ID for this managed resource.
    vnets GetVnetsLegacyVnet[]
    List of SDN VNets.
    id str
    The provider-assigned unique ID for this managed resource.
    vnets Sequence[GetVnetsLegacyVnet]
    List of SDN VNets.
    id String
    The provider-assigned unique ID for this managed resource.
    vnets List<Property Map>
    List of SDN VNets.

    Supporting Types

    GetVnetsLegacyVnet

    Alias string
    Id string
    IsolatePorts bool
    Tag int
    VlanAware bool
    Zone string
    Alias string
    Id string
    IsolatePorts bool
    Tag int
    VlanAware bool
    Zone string
    alias String
    id String
    isolatePorts Boolean
    tag Integer
    vlanAware Boolean
    zone String
    alias string
    id string
    isolatePorts boolean
    tag number
    vlanAware boolean
    zone string
    alias str
    id str
    isolate_ports bool
    tag int
    vlan_aware bool
    zone str
    alias String
    id String
    isolatePorts Boolean
    tag Number
    vlanAware Boolean
    zone String

    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.0.0
    published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
      Try Pulumi Cloud free. Your team will thank you.