1. Packages
  2. Xen Orchestra
  3. API Docs
  4. getXoaPif
xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates

xenorchestra.getXoaPif

Explore with Pulumi AI

xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates

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),
}]});
Copy
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,
}])
Copy
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
	})
}
Copy
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),
            },
        },
    });

});
Copy
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());

    }
}
Copy
resources:
  demo-vm:
    type: xenorchestra:Vm
    properties:
      networks:
        - networkId: ${eth0.network}
variables:
  eth0:
    fn::invoke:
      function: xenorchestra:getXoaPif
      arguments:
        device: eth0
        vlan: -1
Copy

Using getXoaPif

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 getXoaPif(args: GetXoaPifArgs, opts?: InvokeOptions): Promise<GetXoaPifResult>
function getXoaPifOutput(args: GetXoaPifOutputArgs, opts?: InvokeOptions): Output<GetXoaPifResult>
Copy
def get_xoa_pif(device: Optional[str] = None,
                host_id: Optional[str] = None,
                vlan: Optional[int] = None,
                opts: Optional[InvokeOptions] = None) -> GetXoaPifResult
def get_xoa_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[GetXoaPifResult]
Copy
func GetXoaPif(ctx *Context, args *GetXoaPifArgs, opts ...InvokeOption) (*GetXoaPifResult, error)
func GetXoaPifOutput(ctx *Context, args *GetXoaPifOutputArgs, opts ...InvokeOption) GetXoaPifResultOutput
Copy

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

public static class GetXoaPif 
{
    public static Task<GetXoaPifResult> InvokeAsync(GetXoaPifArgs args, InvokeOptions? opts = null)
    public static Output<GetXoaPifResult> Invoke(GetXoaPifInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetXoaPifResult> getXoaPif(GetXoaPifArgs args, InvokeOptions options)
public static Output<GetXoaPifResult> getXoaPif(GetXoaPifArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: xenorchestra:index/getXoaPif:getXoaPif
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Device This property is required. string
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
Vlan This property is required. int
The VLAN the PIF belongs to.
HostId string
The ID of the host that the PIF belongs to.
Device This property is required. string
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
Vlan This property is required. int
The VLAN the PIF belongs to.
HostId string
The ID of the host that the PIF belongs to.
device This property is required. String
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
vlan This property is required. Integer
The VLAN the PIF belongs to.
hostId String
The ID of the host that the PIF belongs to.
device This property is required. string
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
vlan This property is required. number
The VLAN the PIF belongs to.
hostId string
The ID of the host that the PIF belongs to.
device This property is required. str
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
vlan This property is required. int
The VLAN the PIF belongs to.
host_id str
The ID of the host that the PIF belongs to.
device This property is required. String
The name of the network device. Examples include eth0, eth1, etc. See ifconfig for possible devices.
vlan This property is required. Number
The VLAN the PIF belongs to.
hostId String
The ID of the host that the PIF belongs to.

getXoaPif 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 ifconfig for possible devices.
Host string
The host the PIF is associated with.
HostId 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.
PoolId 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 ifconfig for possible devices.
Host string
The host the PIF is associated with.
HostId 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.
PoolId 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 ifconfig for possible devices.
host String
The host the PIF is associated with.
hostId 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.
poolId 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 ifconfig for possible devices.
host string
The host the PIF is associated with.
hostId 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.
poolId 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 ifconfig for 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 ifconfig for possible devices.
host String
The host the PIF is associated with.
hostId 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.
poolId 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 xenorchestra Terraform Provider.
xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates