xenorchestra v1.5.2 published on Monday, Mar 10, 2025 by Vates
xenorchestra.getTemplate
Explore with Pulumi AI
Deprecated: xenorchestra.index/gettemplate.getTemplate has been deprecated in favor of xenorchestra.index/getxoatemplate.getXoaTemplate
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 getTemplate
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 getTemplate(args: GetTemplateArgs, opts?: InvokeOptions): Promise<GetTemplateResult>
function getTemplateOutput(args: GetTemplateOutputArgs, opts?: InvokeOptions): Output<GetTemplateResult>
def get_template(name_label: Optional[str] = None,
pool_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTemplateResult
def get_template_output(name_label: Optional[pulumi.Input[str]] = None,
pool_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTemplateResult]
func GetTemplate(ctx *Context, args *GetTemplateArgs, opts ...InvokeOption) (*GetTemplateResult, error)
func GetTemplateOutput(ctx *Context, args *GetTemplateOutputArgs, opts ...InvokeOption) GetTemplateResultOutput
> Note: This function is named GetTemplate
in the Go SDK.
public static class GetTemplate
{
public static Task<GetTemplateResult> InvokeAsync(GetTemplateArgs args, InvokeOptions? opts = null)
public static Output<GetTemplateResult> Invoke(GetTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
public static Output<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
fn::invoke:
function: xenorchestra:index/getTemplate:getTemplate
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.
getTemplate 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.