xenorchestra.XoaNetwork
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as xenorchestra from "@pulumi/xenorchestra";
import * as xenorchestra from "@vates/pulumi-xenorchestra";
const host1 = xenorchestra.getXoaHost({
    nameLabel: "Your host",
});
// Create a single server network private network
const privateNetwork = new xenorchestra.XoaNetwork("private_network", {
    nameLabel: "new network name",
    poolId: host1.then(host1 => host1.poolId),
});
// Create a network with a 22 VLAN tag from the eth0 device
const vlanNetwork = new xenorchestra.XoaNetwork("vlan_network", {
    nameLabel: "new network name",
    poolId: host1.then(host1 => host1.poolId),
    sourcePifDevice: "eth0",
    vlan: 22,
});
import pulumi
import pulumi_xenorchestra as xenorchestra
host1 = xenorchestra.get_xoa_host(name_label="Your host")
# Create a single server network private network
private_network = xenorchestra.XoaNetwork("private_network",
    name_label="new network name",
    pool_id=host1.pool_id)
# Create a network with a 22 VLAN tag from the eth0 device
vlan_network = xenorchestra.XoaNetwork("vlan_network",
    name_label="new network name",
    pool_id=host1.pool_id,
    source_pif_device="eth0",
    vlan=22)
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 {
		host1, err := xenorchestra.GetXoaHost(ctx, &xenorchestra.GetXoaHostArgs{
			NameLabel: "Your host",
		}, nil)
		if err != nil {
			return err
		}
		// Create a single server network private network
		_, err = xenorchestra.NewXoaNetwork(ctx, "private_network", &xenorchestra.XoaNetworkArgs{
			NameLabel: pulumi.String("new network name"),
			PoolId:    pulumi.String(host1.PoolId),
		})
		if err != nil {
			return err
		}
		// Create a network with a 22 VLAN tag from the eth0 device
		_, err = xenorchestra.NewXoaNetwork(ctx, "vlan_network", &xenorchestra.XoaNetworkArgs{
			NameLabel:       pulumi.String("new network name"),
			PoolId:          pulumi.String(host1.PoolId),
			SourcePifDevice: pulumi.String("eth0"),
			Vlan:            pulumi.Int(22),
		})
		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 host1 = Xenorchestra.GetXoaHost.Invoke(new()
    {
        NameLabel = "Your host",
    });
    // Create a single server network private network
    var privateNetwork = new Xenorchestra.XoaNetwork("private_network", new()
    {
        NameLabel = "new network name",
        PoolId = host1.Apply(getXoaHostResult => getXoaHostResult.PoolId),
    });
    // Create a network with a 22 VLAN tag from the eth0 device
    var vlanNetwork = new Xenorchestra.XoaNetwork("vlan_network", new()
    {
        NameLabel = "new network name",
        PoolId = host1.Apply(getXoaHostResult => getXoaHostResult.PoolId),
        SourcePifDevice = "eth0",
        Vlan = 22,
    });
});
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.GetXoaHostArgs;
import com.pulumi.xenorchestra.XoaNetwork;
import com.pulumi.xenorchestra.XoaNetworkArgs;
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 host1 = XenorchestraFunctions.getXoaHost(GetXoaHostArgs.builder()
            .nameLabel("Your host")
            .build());
        // Create a single server network private network
        var privateNetwork = new XoaNetwork("privateNetwork", XoaNetworkArgs.builder()
            .nameLabel("new network name")
            .poolId(host1.applyValue(getXoaHostResult -> getXoaHostResult.poolId()))
            .build());
        // Create a network with a 22 VLAN tag from the eth0 device
        var vlanNetwork = new XoaNetwork("vlanNetwork", XoaNetworkArgs.builder()
            .nameLabel("new network name")
            .poolId(host1.applyValue(getXoaHostResult -> getXoaHostResult.poolId()))
            .sourcePifDevice("eth0")
            .vlan(22)
            .build());
    }
}
resources:
  # Create a single server network private network
  privateNetwork:
    type: xenorchestra:XoaNetwork
    name: private_network
    properties:
      nameLabel: new network name
      poolId: ${host1.poolId}
  # Create a network with a 22 VLAN tag from the eth0 device
  vlanNetwork:
    type: xenorchestra:XoaNetwork
    name: vlan_network
    properties:
      nameLabel: new network name
      poolId: ${host1.poolId}
      sourcePifDevice: eth0
      vlan: 22
variables:
  host1:
    fn::invoke:
      function: xenorchestra:getXoaHost
      arguments:
        nameLabel: Your host
Create XoaNetwork Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new XoaNetwork(name: string, args: XoaNetworkArgs, opts?: CustomResourceOptions);@overload
def XoaNetwork(resource_name: str,
               args: XoaNetworkArgs,
               opts: Optional[ResourceOptions] = None)
@overload
def XoaNetwork(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               name_label: Optional[str] = None,
               pool_id: Optional[str] = None,
               automatic: Optional[bool] = None,
               default_is_locked: Optional[bool] = None,
               mtu: Optional[int] = None,
               name_description: Optional[str] = None,
               nbd: Optional[bool] = None,
               source_pif_device: Optional[str] = None,
               vlan: Optional[int] = None)func NewXoaNetwork(ctx *Context, name string, args XoaNetworkArgs, opts ...ResourceOption) (*XoaNetwork, error)public XoaNetwork(string name, XoaNetworkArgs args, CustomResourceOptions? opts = null)
public XoaNetwork(String name, XoaNetworkArgs args)
public XoaNetwork(String name, XoaNetworkArgs args, CustomResourceOptions options)
type: xenorchestra:XoaNetwork
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args XoaNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args XoaNetworkArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args XoaNetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args XoaNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args XoaNetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var xoaNetworkResource = new Xenorchestra.XoaNetwork("xoaNetworkResource", new()
{
    NameLabel = "string",
    PoolId = "string",
    Automatic = false,
    DefaultIsLocked = false,
    Mtu = 0,
    NameDescription = "string",
    Nbd = false,
    SourcePifDevice = "string",
    Vlan = 0,
});
example, err := xenorchestra.NewXoaNetwork(ctx, "xoaNetworkResource", &xenorchestra.XoaNetworkArgs{
	NameLabel:       pulumi.String("string"),
	PoolId:          pulumi.String("string"),
	Automatic:       pulumi.Bool(false),
	DefaultIsLocked: pulumi.Bool(false),
	Mtu:             pulumi.Int(0),
	NameDescription: pulumi.String("string"),
	Nbd:             pulumi.Bool(false),
	SourcePifDevice: pulumi.String("string"),
	Vlan:            pulumi.Int(0),
})
var xoaNetworkResource = new XoaNetwork("xoaNetworkResource", XoaNetworkArgs.builder()
    .nameLabel("string")
    .poolId("string")
    .automatic(false)
    .defaultIsLocked(false)
    .mtu(0)
    .nameDescription("string")
    .nbd(false)
    .sourcePifDevice("string")
    .vlan(0)
    .build());
xoa_network_resource = xenorchestra.XoaNetwork("xoaNetworkResource",
    name_label="string",
    pool_id="string",
    automatic=False,
    default_is_locked=False,
    mtu=0,
    name_description="string",
    nbd=False,
    source_pif_device="string",
    vlan=0)
const xoaNetworkResource = new xenorchestra.XoaNetwork("xoaNetworkResource", {
    nameLabel: "string",
    poolId: "string",
    automatic: false,
    defaultIsLocked: false,
    mtu: 0,
    nameDescription: "string",
    nbd: false,
    sourcePifDevice: "string",
    vlan: 0,
});
type: xenorchestra:XoaNetwork
properties:
    automatic: false
    defaultIsLocked: false
    mtu: 0
    nameDescription: string
    nameLabel: string
    nbd: false
    poolId: string
    sourcePifDevice: string
    vlan: 0
XoaNetwork Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The XoaNetwork resource accepts the following input properties:
- NameLabel string
- The name label of the network.
- PoolId string
- The pool id that this network should belong to.
- Automatic bool
- DefaultIs boolLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- Mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- NameDescription string
- Nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- SourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- Vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- NameLabel string
- The name label of the network.
- PoolId string
- The pool id that this network should belong to.
- Automatic bool
- DefaultIs boolLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- Mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- NameDescription string
- Nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- SourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- Vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- nameLabel String
- The name label of the network.
- poolId String
- The pool id that this network should belong to.
- automatic Boolean
- defaultIs BooleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu Integer
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription String
- nbd Boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- sourcePif StringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan Integer
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- nameLabel string
- The name label of the network.
- poolId string
- The pool id that this network should belong to.
- automatic boolean
- defaultIs booleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu number
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription string
- nbd boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- sourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan number
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- name_label str
- The name label of the network.
- pool_id str
- The pool id that this network should belong to.
- automatic bool
- default_is_ boollocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- name_description str
- nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- source_pif_ strdevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- nameLabel String
- The name label of the network.
- poolId String
- The pool id that this network should belong to.
- automatic Boolean
- defaultIs BooleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu Number
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription String
- nbd Boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- sourcePif StringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan Number
- The vlan to use for the network. Defaults to 0meaning no VLAN.
Outputs
All input properties are implicitly available as output properties. Additionally, the XoaNetwork resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing XoaNetwork Resource
Get an existing XoaNetwork resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: XoaNetworkState, opts?: CustomResourceOptions): XoaNetwork@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        automatic: Optional[bool] = None,
        default_is_locked: Optional[bool] = None,
        mtu: Optional[int] = None,
        name_description: Optional[str] = None,
        name_label: Optional[str] = None,
        nbd: Optional[bool] = None,
        pool_id: Optional[str] = None,
        source_pif_device: Optional[str] = None,
        vlan: Optional[int] = None) -> XoaNetworkfunc GetXoaNetwork(ctx *Context, name string, id IDInput, state *XoaNetworkState, opts ...ResourceOption) (*XoaNetwork, error)public static XoaNetwork Get(string name, Input<string> id, XoaNetworkState? state, CustomResourceOptions? opts = null)public static XoaNetwork get(String name, Output<String> id, XoaNetworkState state, CustomResourceOptions options)resources:  _:    type: xenorchestra:XoaNetwork    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Automatic bool
- DefaultIs boolLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- Mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- NameDescription string
- NameLabel string
- The name label of the network.
- Nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- PoolId string
- The pool id that this network should belong to.
- SourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- Vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- Automatic bool
- DefaultIs boolLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- Mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- NameDescription string
- NameLabel string
- The name label of the network.
- Nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- PoolId string
- The pool id that this network should belong to.
- SourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- Vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- automatic Boolean
- defaultIs BooleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu Integer
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription String
- nameLabel String
- The name label of the network.
- nbd Boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- poolId String
- The pool id that this network should belong to.
- sourcePif StringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan Integer
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- automatic boolean
- defaultIs booleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu number
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription string
- nameLabel string
- The name label of the network.
- nbd boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- poolId string
- The pool id that this network should belong to.
- sourcePif stringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan number
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- automatic bool
- default_is_ boollocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu int
- The MTU of the network. Defaults to 1500if unspecified.
- name_description str
- name_label str
- The name label of the network.
- nbd bool
- Whether the network should use a network block device. Defaults to falseif unspecified.
- pool_id str
- The pool id that this network should belong to.
- source_pif_ strdevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan int
- The vlan to use for the network. Defaults to 0meaning no VLAN.
- automatic Boolean
- defaultIs BooleanLocked 
- This argument controls whether the network should enforce VIF locking. This defaults to falsewhich means that no filtering rules are applied.
- mtu Number
- The MTU of the network. Defaults to 1500if unspecified.
- nameDescription String
- nameLabel String
- The name label of the network.
- nbd Boolean
- Whether the network should use a network block device. Defaults to falseif unspecified.
- poolId String
- The pool id that this network should belong to.
- sourcePif StringDevice 
- The PIF device (eth0, eth1, etc) that will be used as an input during network creation. This parameter is required if a vlan is specified.
- vlan Number
- The vlan to use for the network. Defaults to 0meaning no VLAN.
Package Details
- Repository
- xenorchestra vatesfr/pulumi-xenorchestra
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the xenorchestraTerraform Provider.
