1. Packages
  2. Opennebula Provider
  3. API Docs
  4. getTemplate
opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula

opennebula.getTemplate

Explore with Pulumi AI

opennebula logo
opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula

    Use this data source to retrieve the template information for a given name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opennebula from "@pulumi/opennebula";
    
    const example = opennebula.getTemplate({
        name: "My_Template",
    });
    
    import pulumi
    import pulumi_opennebula as opennebula
    
    example = opennebula.get_template(name="My_Template")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opennebula/opennebula"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opennebula.LookupTemplate(ctx, &opennebula.LookupTemplateArgs{
    			Name: pulumi.StringRef("My_Template"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opennebula = Pulumi.Opennebula;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Opennebula.GetTemplate.Invoke(new()
        {
            Name = "My_Template",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opennebula.OpennebulaFunctions;
    import com.pulumi.opennebula.inputs.GetTemplateArgs;
    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 example = OpennebulaFunctions.getTemplate(GetTemplateArgs.builder()
                .name("My_Template")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: opennebula:getTemplate
          arguments:
            name: My_Template
    

    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(cpu: Optional[float] = None,
                     has_cpu: Optional[bool] = None,
                     has_memory: Optional[bool] = None,
                     has_vcpu: Optional[bool] = None,
                     id: Optional[float] = None,
                     memory: Optional[float] = None,
                     name: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     vcpu: Optional[float] = None,
                     opts: Optional[InvokeOptions] = None) -> GetTemplateResult
    def get_template_output(cpu: Optional[pulumi.Input[float]] = None,
                     has_cpu: Optional[pulumi.Input[bool]] = None,
                     has_memory: Optional[pulumi.Input[bool]] = None,
                     has_vcpu: Optional[pulumi.Input[bool]] = None,
                     id: Optional[pulumi.Input[float]] = None,
                     memory: Optional[pulumi.Input[float]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                     vcpu: Optional[pulumi.Input[float]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetTemplateResult]
    func LookupTemplate(ctx *Context, args *LookupTemplateArgs, opts ...InvokeOption) (*LookupTemplateResult, error)
    func LookupTemplateOutput(ctx *Context, args *LookupTemplateOutputArgs, opts ...InvokeOption) LookupTemplateResultOutput

    > Note: This function is named LookupTemplate 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: opennebula:index/getTemplate:getTemplate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Cpu double
    Amount of CPU shares assigned to the VM.
    HasCpu bool
    Indicate if a CPU value has been defined.
    HasMemory bool
    Indicate if a memory value has been defined.
    HasVcpu bool
    Indicate if a VCPU value has been defined.
    Id double
    ID of the template.
    Memory double
    Amount of RAM assigned to the VM in MB.
    Name string
    The OpenNebula template to retrieve information for.
    Tags Dictionary<string, string>
    Template tags (Key = Value).
    Vcpu double
    Number of CPU cores presented to the VM.
    Cpu float64
    Amount of CPU shares assigned to the VM.
    HasCpu bool
    Indicate if a CPU value has been defined.
    HasMemory bool
    Indicate if a memory value has been defined.
    HasVcpu bool
    Indicate if a VCPU value has been defined.
    Id float64
    ID of the template.
    Memory float64
    Amount of RAM assigned to the VM in MB.
    Name string
    The OpenNebula template to retrieve information for.
    Tags map[string]string
    Template tags (Key = Value).
    Vcpu float64
    Number of CPU cores presented to the VM.
    cpu Double
    Amount of CPU shares assigned to the VM.
    hasCpu Boolean
    Indicate if a CPU value has been defined.
    hasMemory Boolean
    Indicate if a memory value has been defined.
    hasVcpu Boolean
    Indicate if a VCPU value has been defined.
    id Double
    ID of the template.
    memory Double
    Amount of RAM assigned to the VM in MB.
    name String
    The OpenNebula template to retrieve information for.
    tags Map<String,String>
    Template tags (Key = Value).
    vcpu Double
    Number of CPU cores presented to the VM.
    cpu number
    Amount of CPU shares assigned to the VM.
    hasCpu boolean
    Indicate if a CPU value has been defined.
    hasMemory boolean
    Indicate if a memory value has been defined.
    hasVcpu boolean
    Indicate if a VCPU value has been defined.
    id number
    ID of the template.
    memory number
    Amount of RAM assigned to the VM in MB.
    name string
    The OpenNebula template to retrieve information for.
    tags {[key: string]: string}
    Template tags (Key = Value).
    vcpu number
    Number of CPU cores presented to the VM.
    cpu float
    Amount of CPU shares assigned to the VM.
    has_cpu bool
    Indicate if a CPU value has been defined.
    has_memory bool
    Indicate if a memory value has been defined.
    has_vcpu bool
    Indicate if a VCPU value has been defined.
    id float
    ID of the template.
    memory float
    Amount of RAM assigned to the VM in MB.
    name str
    The OpenNebula template to retrieve information for.
    tags Mapping[str, str]
    Template tags (Key = Value).
    vcpu float
    Number of CPU cores presented to the VM.
    cpu Number
    Amount of CPU shares assigned to the VM.
    hasCpu Boolean
    Indicate if a CPU value has been defined.
    hasMemory Boolean
    Indicate if a memory value has been defined.
    hasVcpu Boolean
    Indicate if a VCPU value has been defined.
    id Number
    ID of the template.
    memory Number
    Amount of RAM assigned to the VM in MB.
    name String
    The OpenNebula template to retrieve information for.
    tags Map<String>
    Template tags (Key = Value).
    vcpu Number
    Number of CPU cores presented to the VM.

    getTemplate Result

    The following output properties are available:

    Cpu double
    Amount of CPU shares assigned to the VM.
    Disks List<GetTemplateDisk>
    Disk parameters
    Memory double
    Amount of RAM assigned to the VM in MB.
    Nics List<GetTemplateNic>
    NIC parameters
    Vcpu double
    Number of CPU cores presented to the VM.
    Vmgroups List<GetTemplateVmgroup>
    VM group parameters
    HasCpu bool
    HasMemory bool
    HasVcpu bool
    Id double
    ID of the template.
    Name string
    Name of the template.
    Tags Dictionary<string, string>
    Tags of the template (Key = Value).
    Cpu float64
    Amount of CPU shares assigned to the VM.
    Disks []GetTemplateDisk
    Disk parameters
    Memory float64
    Amount of RAM assigned to the VM in MB.
    Nics []GetTemplateNic
    NIC parameters
    Vcpu float64
    Number of CPU cores presented to the VM.
    Vmgroups []GetTemplateVmgroup
    VM group parameters
    HasCpu bool
    HasMemory bool
    HasVcpu bool
    Id float64
    ID of the template.
    Name string
    Name of the template.
    Tags map[string]string
    Tags of the template (Key = Value).
    cpu Double
    Amount of CPU shares assigned to the VM.
    disks List<GetTemplateDisk>
    Disk parameters
    memory Double
    Amount of RAM assigned to the VM in MB.
    nics List<GetTemplateNic>
    NIC parameters
    vcpu Double
    Number of CPU cores presented to the VM.
    vmgroups List<GetTemplateVmgroup>
    VM group parameters
    hasCpu Boolean
    hasMemory Boolean
    hasVcpu Boolean
    id Double
    ID of the template.
    name String
    Name of the template.
    tags Map<String,String>
    Tags of the template (Key = Value).
    cpu number
    Amount of CPU shares assigned to the VM.
    disks GetTemplateDisk[]
    Disk parameters
    memory number
    Amount of RAM assigned to the VM in MB.
    nics GetTemplateNic[]
    NIC parameters
    vcpu number
    Number of CPU cores presented to the VM.
    vmgroups GetTemplateVmgroup[]
    VM group parameters
    hasCpu boolean
    hasMemory boolean
    hasVcpu boolean
    id number
    ID of the template.
    name string
    Name of the template.
    tags {[key: string]: string}
    Tags of the template (Key = Value).
    cpu float
    Amount of CPU shares assigned to the VM.
    disks Sequence[GetTemplateDisk]
    Disk parameters
    memory float
    Amount of RAM assigned to the VM in MB.
    nics Sequence[GetTemplateNic]
    NIC parameters
    vcpu float
    Number of CPU cores presented to the VM.
    vmgroups Sequence[GetTemplateVmgroup]
    VM group parameters
    has_cpu bool
    has_memory bool
    has_vcpu bool
    id float
    ID of the template.
    name str
    Name of the template.
    tags Mapping[str, str]
    Tags of the template (Key = Value).
    cpu Number
    Amount of CPU shares assigned to the VM.
    disks List<Property Map>
    Disk parameters
    memory Number
    Amount of RAM assigned to the VM in MB.
    nics List<Property Map>
    NIC parameters
    vcpu Number
    Number of CPU cores presented to the VM.
    vmgroups List<Property Map>
    VM group parameters
    hasCpu Boolean
    hasMemory Boolean
    hasVcpu Boolean
    id Number
    ID of the template.
    name String
    Name of the template.
    tags Map<String>
    Tags of the template (Key = Value).

    Supporting Types

    GetTemplateDisk

    Cache string
    DevPrefix string
    Discard string
    Driver string
    ImageId double
    Io string
    Size double
    Target string
    VolatileFormat string
    VolatileType string
    Cache string
    DevPrefix string
    Discard string
    Driver string
    ImageId float64
    Io string
    Size float64
    Target string
    VolatileFormat string
    VolatileType string
    cache String
    devPrefix String
    discard String
    driver String
    imageId Double
    io String
    size Double
    target String
    volatileFormat String
    volatileType String
    cache string
    devPrefix string
    discard string
    driver string
    imageId number
    io string
    size number
    target string
    volatileFormat string
    volatileType string
    cache String
    devPrefix String
    discard String
    driver String
    imageId Number
    io String
    size Number
    target String
    volatileFormat String
    volatileType String

    GetTemplateNic

    Dns string
    Gateway string
    Ip string
    Mac string
    Method string
    Model string
    Network string
    NetworkId double
    NetworkModeAuto bool
    PhysicalDevice string
    SchedRank string
    SchedRequirements string
    SecurityGroups List<double>
    VirtioQueues string
    Dns string
    Gateway string
    Ip string
    Mac string
    Method string
    Model string
    Network string
    NetworkId float64
    NetworkModeAuto bool
    PhysicalDevice string
    SchedRank string
    SchedRequirements string
    SecurityGroups []float64
    VirtioQueues string
    dns String
    gateway String
    ip String
    mac String
    method String
    model String
    network String
    networkId Double
    networkModeAuto Boolean
    physicalDevice String
    schedRank String
    schedRequirements String
    securityGroups List<Double>
    virtioQueues String
    dns string
    gateway string
    ip string
    mac string
    method string
    model string
    network string
    networkId number
    networkModeAuto boolean
    physicalDevice string
    schedRank string
    schedRequirements string
    securityGroups number[]
    virtioQueues string
    dns String
    gateway String
    ip String
    mac String
    method String
    model String
    network String
    networkId Number
    networkModeAuto Boolean
    physicalDevice String
    schedRank String
    schedRequirements String
    securityGroups List<Number>
    virtioQueues String

    GetTemplateVmgroup

    Role string
    VmgroupId double
    Role string
    VmgroupId float64
    role String
    vmgroupId Double
    role string
    vmgroupId number
    role str
    vmgroup_id float
    role String
    vmgroupId Number

    Package Details

    Repository
    opennebula opennebula/terraform-provider-opennebula
    License
    Notes
    This Pulumi package is based on the opennebula Terraform Provider.
    opennebula logo
    opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula