xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates
xenorchestra.getPif
Explore with Pulumi AI
Deprecated: xenorchestra.index/getpif.getPif has been deprecated in favor of xenorchestra.index/getxoapif.getXoaPif
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as xenorchestra from "@pulumi/xenorchestra";
import * as xenorchestra from "@vates/pulumi-xenorchestra";
const eth0 = xenorchestra.getXoaPif({
    device: "eth0",
    vlan: -1,
});
const demo_vm = new xenorchestra.Vm("demo-vm", {networks: [{
    networkId: eth0.then(eth0 => eth0.network),
}]});
import pulumi
import pulumi_xenorchestra as xenorchestra
eth0 = xenorchestra.get_xoa_pif(device="eth0",
    vlan=-1)
demo_vm = xenorchestra.Vm("demo-vm", networks=[{
    "network_id": eth0.network,
}])
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/vatesfr/pulumi-xenorchestra/sdk/go/xenorchestra"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		eth0, err := xenorchestra.GetXoaPif(ctx, &xenorchestra.GetXoaPifArgs{
			Device: "eth0",
			Vlan:   -1,
		}, nil)
		if err != nil {
			return err
		}
		_, err = xenorchestra.NewVm(ctx, "demo-vm", &xenorchestra.VmArgs{
			Networks: xenorchestra.VmNetworkArray{
				&xenorchestra.VmNetworkArgs{
					NetworkId: pulumi.String(eth0.Network),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Xenorchestra = Pulumi.Xenorchestra;
return await Deployment.RunAsync(() => 
{
    var eth0 = Xenorchestra.GetXoaPif.Invoke(new()
    {
        Device = "eth0",
        Vlan = -1,
    });
    var demo_vm = new Xenorchestra.Vm("demo-vm", new()
    {
        Networks = new[]
        {
            new Xenorchestra.Inputs.VmNetworkArgs
            {
                NetworkId = eth0.Apply(getXoaPifResult => getXoaPifResult.Network),
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.xenorchestra.XenorchestraFunctions;
import com.pulumi.xenorchestra.inputs.GetXoaPifArgs;
import com.pulumi.xenorchestra.Vm;
import com.pulumi.xenorchestra.VmArgs;
import com.pulumi.xenorchestra.inputs.VmNetworkArgs;
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) {
        final var eth0 = XenorchestraFunctions.getXoaPif(GetXoaPifArgs.builder()
            .device("eth0")
            .vlan(-1)
            .build());
        var demo_vm = new Vm("demo-vm", VmArgs.builder()
            .networks(VmNetworkArgs.builder()
                .networkId(eth0.applyValue(getXoaPifResult -> getXoaPifResult.network()))
                .build())
            .build());
    }
}
resources:
  demo-vm:
    type: xenorchestra:Vm
    properties:
      networks:
        - networkId: ${eth0.network}
variables:
  eth0:
    fn::invoke:
      function: xenorchestra:getXoaPif
      arguments:
        device: eth0
        vlan: -1
Using getPif
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 getPif(args: GetPifArgs, opts?: InvokeOptions): Promise<GetPifResult>
function getPifOutput(args: GetPifOutputArgs, opts?: InvokeOptions): Output<GetPifResult>def get_pif(device: Optional[str] = None,
            host_id: Optional[str] = None,
            vlan: Optional[int] = None,
            opts: Optional[InvokeOptions] = None) -> GetPifResult
def get_pif_output(device: Optional[pulumi.Input[str]] = None,
            host_id: Optional[pulumi.Input[str]] = None,
            vlan: Optional[pulumi.Input[int]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetPifResult]func GetPif(ctx *Context, args *GetPifArgs, opts ...InvokeOption) (*GetPifResult, error)
func GetPifOutput(ctx *Context, args *GetPifOutputArgs, opts ...InvokeOption) GetPifResultOutput> Note: This function is named GetPif in the Go SDK.
public static class GetPif 
{
    public static Task<GetPifResult> InvokeAsync(GetPifArgs args, InvokeOptions? opts = null)
    public static Output<GetPifResult> Invoke(GetPifInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPifResult> getPif(GetPifArgs args, InvokeOptions options)
public static Output<GetPifResult> getPif(GetPifArgs args, InvokeOptions options)
fn::invoke:
  function: xenorchestra:index/getPif:getPif
  arguments:
    # arguments dictionaryThe following arguments are supported:
getPif Result
The following output properties are available:
- Attached bool
 - If the PIF is attached to the network.
 - Device string
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - Host string
 - The host the PIF is associated with.
 - Host
Id string - The ID of the host that the PIF belongs to.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Network string
 - The network the PIF is associated with.
 - Pool
Id string - The pool the PIF is associated with.
 - Uuid string
 - The uuid of the PIF.
 - Vlan int
 - The VLAN the PIF belongs to.
 
- Attached bool
 - If the PIF is attached to the network.
 - Device string
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - Host string
 - The host the PIF is associated with.
 - Host
Id string - The ID of the host that the PIF belongs to.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Network string
 - The network the PIF is associated with.
 - Pool
Id string - The pool the PIF is associated with.
 - Uuid string
 - The uuid of the PIF.
 - Vlan int
 - The VLAN the PIF belongs to.
 
- attached Boolean
 - If the PIF is attached to the network.
 - device String
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - host String
 - The host the PIF is associated with.
 - host
Id String - The ID of the host that the PIF belongs to.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - network String
 - The network the PIF is associated with.
 - pool
Id String - The pool the PIF is associated with.
 - uuid String
 - The uuid of the PIF.
 - vlan Integer
 - The VLAN the PIF belongs to.
 
- attached boolean
 - If the PIF is attached to the network.
 - device string
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - host string
 - The host the PIF is associated with.
 - host
Id string - The ID of the host that the PIF belongs to.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - network string
 - The network the PIF is associated with.
 - pool
Id string - The pool the PIF is associated with.
 - uuid string
 - The uuid of the PIF.
 - vlan number
 - The VLAN the PIF belongs to.
 
- attached bool
 - If the PIF is attached to the network.
 - device str
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - host str
 - The host the PIF is associated with.
 - host_
id str - The ID of the host that the PIF belongs to.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - network str
 - The network the PIF is associated with.
 - pool_
id str - The pool the PIF is associated with.
 - uuid str
 - The uuid of the PIF.
 - vlan int
 - The VLAN the PIF belongs to.
 
- attached Boolean
 - If the PIF is attached to the network.
 - device String
 - The name of the network device. Examples include eth0, eth1, etc. See 
ifconfigfor possible devices. - host String
 - The host the PIF is associated with.
 - host
Id String - The ID of the host that the PIF belongs to.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - network String
 - The network the PIF is associated with.
 - pool
Id String - The pool the PIF is associated with.
 - uuid String
 - The uuid of the PIF.
 - vlan Number
 - The VLAN the PIF belongs to.
 
Package Details
- Repository
 - xenorchestra vatesfr/pulumi-xenorchestra
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
xenorchestraTerraform Provider.