xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates
xenorchestra.getXoaTemplate
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 template = xenorchestra.getXoaTemplate({
nameLabel: "Ubuntu Bionic Beaver 18.04",
});
const demo_vm = new xenorchestra.Vm("demo-vm", {template: template.then(template => template.id)});
import pulumi
import pulumi_xenorchestra as xenorchestra
template = xenorchestra.get_xoa_template(name_label="Ubuntu Bionic Beaver 18.04")
demo_vm = xenorchestra.Vm("demo-vm", template=template.id)
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 {
template, err := xenorchestra.GetXoaTemplate(ctx, &xenorchestra.GetXoaTemplateArgs{
NameLabel: "Ubuntu Bionic Beaver 18.04",
}, nil)
if err != nil {
return err
}
_, err = xenorchestra.NewVm(ctx, "demo-vm", &xenorchestra.VmArgs{
Template: pulumi.String(template.Id),
})
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 template = Xenorchestra.GetXoaTemplate.Invoke(new()
{
NameLabel = "Ubuntu Bionic Beaver 18.04",
});
var demo_vm = new Xenorchestra.Vm("demo-vm", new()
{
Template = template.Apply(getXoaTemplateResult => getXoaTemplateResult.Id),
});
});
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.GetXoaTemplateArgs;
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 template = XenorchestraFunctions.getXoaTemplate(GetXoaTemplateArgs.builder()
.nameLabel("Ubuntu Bionic Beaver 18.04")
.build());
var demo_vm = new Vm("demo-vm", VmArgs.builder()
.template(template.applyValue(getXoaTemplateResult -> getXoaTemplateResult.id()))
.build());
}
}
resources:
demo-vm:
type: xenorchestra:Vm
properties:
template: ${template.id}
variables:
template:
fn::invoke:
function: xenorchestra:getXoaTemplate
arguments:
nameLabel: Ubuntu Bionic Beaver 18.04
Using getXoaTemplate
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 getXoaTemplate(args: GetXoaTemplateArgs, opts?: InvokeOptions): Promise<GetXoaTemplateResult>
function getXoaTemplateOutput(args: GetXoaTemplateOutputArgs, opts?: InvokeOptions): Output<GetXoaTemplateResult>
def get_xoa_template(name_label: Optional[str] = None,
pool_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetXoaTemplateResult
def get_xoa_template_output(name_label: Optional[pulumi.Input[str]] = None,
pool_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetXoaTemplateResult]
func GetXoaTemplate(ctx *Context, args *GetXoaTemplateArgs, opts ...InvokeOption) (*GetXoaTemplateResult, error)
func GetXoaTemplateOutput(ctx *Context, args *GetXoaTemplateOutputArgs, opts ...InvokeOption) GetXoaTemplateResultOutput
> Note: This function is named GetXoaTemplate
in the Go SDK.
public static class GetXoaTemplate
{
public static Task<GetXoaTemplateResult> InvokeAsync(GetXoaTemplateArgs args, InvokeOptions? opts = null)
public static Output<GetXoaTemplateResult> Invoke(GetXoaTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetXoaTemplateResult> getXoaTemplate(GetXoaTemplateArgs args, InvokeOptions options)
public static Output<GetXoaTemplateResult> getXoaTemplate(GetXoaTemplateArgs args, InvokeOptions options)
fn::invoke:
function: xenorchestra:index/getXoaTemplate:getXoaTemplate
arguments:
# arguments dictionary
The following arguments are supported:
- name_
label str - The name of the template to look up.
- pool_
id str - The id of the pool that the template belongs to.
getXoaTemplate Result
The following output properties are available:
- id str
- The provider-assigned unique ID for this managed resource.
- name_
label str - The name of the template to look up.
- uuid str
- The uuid of the template.
- pool_
id str - The id of the pool that the template belongs to.
Package Details
- Repository
- xenorchestra vatesfr/pulumi-xenorchestra
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
xenorchestra
Terraform Provider.