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

xenorchestra.getHost

Explore with Pulumi AI

xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates
Deprecated: xenorchestra.index/gethost.getHost has been deprecated in favor of xenorchestra.index/getxoahost.getXoaHost

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",
});
const node = new xenorchestra.Vm("node", {affinityHost: host1.then(host1 => host1.id)});
Copy
import pulumi
import pulumi_xenorchestra as xenorchestra

host1 = xenorchestra.get_xoa_host(name_label="Your host")
node = xenorchestra.Vm("node", affinity_host=host1.id)
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 {
		host1, err := xenorchestra.GetXoaHost(ctx, &xenorchestra.GetXoaHostArgs{
			NameLabel: "Your host",
		}, nil)
		if err != nil {
			return err
		}
		_, err = xenorchestra.NewVm(ctx, "node", &xenorchestra.VmArgs{
			AffinityHost: pulumi.String(host1.Id),
		})
		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 host1 = Xenorchestra.GetXoaHost.Invoke(new()
    {
        NameLabel = "Your host",
    });

    var node = new Xenorchestra.Vm("node", new()
    {
        AffinityHost = host1.Apply(getXoaHostResult => getXoaHostResult.Id),
    });

});
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.GetXoaHostArgs;
import com.pulumi.xenorchestra.Vm;
import com.pulumi.xenorchestra.VmArgs;
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());

        var node = new Vm("node", VmArgs.builder()
            .affinityHost(host1.applyValue(getXoaHostResult -> getXoaHostResult.id()))
            .build());

    }
}
Copy
resources:
  node:
    type: xenorchestra:Vm
    properties:
      affinityHost: ${host1.id}
variables:
  host1:
    fn::invoke:
      function: xenorchestra:getXoaHost
      arguments:
        nameLabel: Your host
Copy

Using getHost

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 getHost(args: GetHostArgs, opts?: InvokeOptions): Promise<GetHostResult>
function getHostOutput(args: GetHostOutputArgs, opts?: InvokeOptions): Output<GetHostResult>
Copy
def get_host(name_label: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             opts: Optional[InvokeOptions] = None) -> GetHostResult
def get_host_output(name_label: Optional[pulumi.Input[str]] = None,
             tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetHostResult]
Copy
func GetHost(ctx *Context, args *GetHostArgs, opts ...InvokeOption) (*GetHostResult, error)
func GetHostOutput(ctx *Context, args *GetHostOutputArgs, opts ...InvokeOption) GetHostResultOutput
Copy

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

public static class GetHost 
{
    public static Task<GetHostResult> InvokeAsync(GetHostArgs args, InvokeOptions? opts = null)
    public static Output<GetHostResult> Invoke(GetHostInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetHostResult> getHost(GetHostArgs args, InvokeOptions options)
public static Output<GetHostResult> getHost(GetHostArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: xenorchestra:index/getHost:getHost
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

NameLabel This property is required. string
The name label of the host.
Tags List<string>
The tags (labels) applied to the given entity.
NameLabel This property is required. string
The name label of the host.
Tags []string
The tags (labels) applied to the given entity.
nameLabel This property is required. String
The name label of the host.
tags List<String>
The tags (labels) applied to the given entity.
nameLabel This property is required. string
The name label of the host.
tags string[]
The tags (labels) applied to the given entity.
name_label This property is required. str
The name label of the host.
tags Sequence[str]
The tags (labels) applied to the given entity.
nameLabel This property is required. String
The name label of the host.
tags List<String>
The tags (labels) applied to the given entity.

getHost Result

The following output properties are available:

Cpus Dictionary<string, int>
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
Id string
The provider-assigned unique ID for this managed resource.
Memory double
The memory size of the host.
MemoryUsage double
The memory usage of the host.
NameLabel string
The name label of the host.
PoolId string
Id of the pool that the host belongs to.
Tags List<string>
The tags (labels) applied to the given entity.
Cpus map[string]int
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
Id string
The provider-assigned unique ID for this managed resource.
Memory float64
The memory size of the host.
MemoryUsage float64
The memory usage of the host.
NameLabel string
The name label of the host.
PoolId string
Id of the pool that the host belongs to.
Tags []string
The tags (labels) applied to the given entity.
cpus Map<String,Integer>
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
id String
The provider-assigned unique ID for this managed resource.
memory Double
The memory size of the host.
memoryUsage Double
The memory usage of the host.
nameLabel String
The name label of the host.
poolId String
Id of the pool that the host belongs to.
tags List<String>
The tags (labels) applied to the given entity.
cpus {[key: string]: number}
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
id string
The provider-assigned unique ID for this managed resource.
memory number
The memory size of the host.
memoryUsage number
The memory usage of the host.
nameLabel string
The name label of the host.
poolId string
Id of the pool that the host belongs to.
tags string[]
The tags (labels) applied to the given entity.
cpus Mapping[str, int]
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
id str
The provider-assigned unique ID for this managed resource.
memory float
The memory size of the host.
memory_usage float
The memory usage of the host.
name_label str
The name label of the host.
pool_id str
Id of the pool that the host belongs to.
tags Sequence[str]
The tags (labels) applied to the given entity.
cpus Map<Number>
CPU information about the host. The 'cores' key will contain the number of cpu cores and the 'sockets' key will contain the number of sockets.
id String
The provider-assigned unique ID for this managed resource.
memory Number
The memory size of the host.
memoryUsage Number
The memory usage of the host.
nameLabel String
The name label of the host.
poolId String
Id of the pool that the host belongs to.
tags List<String>
The tags (labels) applied to the given entity.

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