opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula
opennebula.getTemplates
Explore with Pulumi AI
opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula
Use this data source to retrieve templates information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opennebula from "@pulumi/opennebula";
const example = opennebula.getTemplates({
hasCpu: true,
nameRegex: "test.*",
order: "ASC",
sortOn: "register_date",
});
import pulumi
import pulumi_opennebula as opennebula
example = opennebula.get_templates(has_cpu=True,
name_regex="test.*",
order="ASC",
sort_on="register_date")
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.GetTemplates(ctx, &opennebula.GetTemplatesArgs{
HasCpu: pulumi.BoolRef(true),
NameRegex: pulumi.StringRef("test.*"),
Order: pulumi.StringRef("ASC"),
SortOn: pulumi.StringRef("register_date"),
}, 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.GetTemplates.Invoke(new()
{
HasCpu = true,
NameRegex = "test.*",
Order = "ASC",
SortOn = "register_date",
});
});
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.GetTemplatesArgs;
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.getTemplates(GetTemplatesArgs.builder()
.hasCpu(true)
.nameRegex("test.*")
.order("ASC")
.sortOn("register_date")
.build());
}
}
variables:
example:
fn::invoke:
function: opennebula:getTemplates
arguments:
hasCpu: true
nameRegex: test.*
order: ASC
sortOn: register_date
Templates attributes
id
- ID of the template.name
- Name of the template.cpu
- Amount of CPU shares assigned to the VM.vcpu
- Number of CPU cores presented to the VM.memory
- Amount of RAM assigned to the VM in MB.disk
- Disk parametersnic
- NIC parametersvmgroup
- VM group parametersregister_date
- Creation date of the templatetags
- Tags of the template (Key = Value).
Using getTemplates
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 getTemplates(args: GetTemplatesArgs, opts?: InvokeOptions): Promise<GetTemplatesResult>
function getTemplatesOutput(args: GetTemplatesOutputArgs, opts?: InvokeOptions): Output<GetTemplatesResult>
def get_templates(cpu: Optional[float] = None,
has_cpu: Optional[bool] = None,
has_memory: Optional[bool] = None,
has_vcpu: Optional[bool] = None,
id: Optional[str] = None,
memory: Optional[float] = None,
name_regex: Optional[str] = None,
order: Optional[str] = None,
sort_on: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
vcpu: Optional[float] = None,
opts: Optional[InvokeOptions] = None) -> GetTemplatesResult
def get_templates_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[str]] = None,
memory: Optional[pulumi.Input[float]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
order: Optional[pulumi.Input[str]] = None,
sort_on: 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[GetTemplatesResult]
func GetTemplates(ctx *Context, args *GetTemplatesArgs, opts ...InvokeOption) (*GetTemplatesResult, error)
func GetTemplatesOutput(ctx *Context, args *GetTemplatesOutputArgs, opts ...InvokeOption) GetTemplatesResultOutput
> Note: This function is named GetTemplates
in the Go SDK.
public static class GetTemplates
{
public static Task<GetTemplatesResult> InvokeAsync(GetTemplatesArgs args, InvokeOptions? opts = null)
public static Output<GetTemplatesResult> Invoke(GetTemplatesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTemplatesResult> getTemplates(GetTemplatesArgs args, InvokeOptions options)
public static Output<GetTemplatesResult> getTemplates(GetTemplatesArgs args, InvokeOptions options)
fn::invoke:
function: opennebula:index/getTemplates:getTemplates
arguments:
# arguments dictionary
The following arguments are supported:
- Cpu double
- 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 string
- Memory double
- Amount of RAM assigned to the VM in MB.
- Name
Regex string - Filter templates by name with a RE2 regular expression.
- Order string
- Ordering of the sort: ASC or DESC.
- Sort
On string - 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.
- 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 string
- Memory float64
- Amount of RAM assigned to the VM in MB.
- Name
Regex string - Filter templates by name with a RE2 regular expression.
- Order string
- Ordering of the sort: ASC or DESC.
- Sort
On string - 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.
- has
Cpu Boolean - Indicate if a CPU value has been defined.
- has
Memory Boolean - Indicate if a memory value has been defined.
- has
Vcpu Boolean - Indicate if a VCPU value has been defined.
- id String
- memory Double
- Amount of RAM assigned to the VM in MB.
- name
Regex String - Filter templates by name with a RE2 regular expression.
- order String
- Ordering of the sort: ASC or DESC.
- sort
On String - 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.
- has
Cpu boolean - Indicate if a CPU value has been defined.
- has
Memory boolean - Indicate if a memory value has been defined.
- has
Vcpu boolean - Indicate if a VCPU value has been defined.
- id string
- memory number
- Amount of RAM assigned to the VM in MB.
- name
Regex string - Filter templates by name with a RE2 regular expression.
- order string
- Ordering of the sort: ASC or DESC.
- sort
On string - {[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 str
- memory float
- Amount of RAM assigned to the VM in MB.
- name_
regex str - Filter templates by name with a RE2 regular expression.
- order str
- Ordering of the sort: ASC or DESC.
- sort_
on str - 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.
- has
Cpu Boolean - Indicate if a CPU value has been defined.
- has
Memory Boolean - Indicate if a memory value has been defined.
- has
Vcpu Boolean - Indicate if a VCPU value has been defined.
- id String
- memory Number
- Amount of RAM assigned to the VM in MB.
- name
Regex String - Filter templates by name with a RE2 regular expression.
- order String
- Ordering of the sort: ASC or DESC.
- sort
On String - Map<String>
- Template tags (Key = Value).
- vcpu Number
- Number of CPU cores presented to the VM.
getTemplates Result
The following output properties are available:
- cpu float
- id str
- memory float
- templates
Sequence[Get
Templates Template] - For each filtered template, this section collect a list of attributes. See templates attributes
- vcpu float
- has_
cpu bool - has_
memory bool - has_
vcpu bool - name_
regex str - order str
- sort_
on str - Mapping[str, str]
Supporting Types
GetTemplatesTemplate
- Cpu double
- Amount of CPU shares assigned to the VM.
- Disks
List<Get
Templates Template Disk> - Id double
- Memory double
- Amount of RAM assigned to the VM in MB.
- Name string
- Nics
List<Get
Templates Template Nic> - Register
Date double - Dictionary<string, string>
- Template tags (Key = Value).
- Vcpu double
- Number of CPU cores presented to the VM.
- Vmgroups
List<Get
Templates Template Vmgroup>
- Cpu float64
- Amount of CPU shares assigned to the VM.
- Disks
[]Get
Templates Template Disk - Id float64
- Memory float64
- Amount of RAM assigned to the VM in MB.
- Name string
- Nics
[]Get
Templates Template Nic - Register
Date float64 - map[string]string
- Template tags (Key = Value).
- Vcpu float64
- Number of CPU cores presented to the VM.
- Vmgroups
[]Get
Templates Template Vmgroup
- cpu Double
- Amount of CPU shares assigned to the VM.
- disks
List<Get
Templates Template Disk> - id Double
- memory Double
- Amount of RAM assigned to the VM in MB.
- name String
- nics
List<Get
Templates Template Nic> - register
Date Double - Map<String,String>
- Template tags (Key = Value).
- vcpu Double
- Number of CPU cores presented to the VM.
- vmgroups
List<Get
Templates Template Vmgroup>
- cpu number
- Amount of CPU shares assigned to the VM.
- disks
Get
Templates Template Disk[] - id number
- memory number
- Amount of RAM assigned to the VM in MB.
- name string
- nics
Get
Templates Template Nic[] - register
Date number - {[key: string]: string}
- Template tags (Key = Value).
- vcpu number
- Number of CPU cores presented to the VM.
- vmgroups
Get
Templates Template Vmgroup[]
- cpu float
- Amount of CPU shares assigned to the VM.
- disks
Sequence[Get
Templates Template Disk] - id float
- memory float
- Amount of RAM assigned to the VM in MB.
- name str
- nics
Sequence[Get
Templates Template Nic] - register_
date float - Mapping[str, str]
- Template tags (Key = Value).
- vcpu float
- Number of CPU cores presented to the VM.
- vmgroups
Sequence[Get
Templates Template Vmgroup]
- cpu Number
- Amount of CPU shares assigned to the VM.
- disks List<Property Map>
- id Number
- memory Number
- Amount of RAM assigned to the VM in MB.
- name String
- nics List<Property Map>
- register
Date Number - Map<String>
- Template tags (Key = Value).
- vcpu Number
- Number of CPU cores presented to the VM.
- vmgroups List<Property Map>
GetTemplatesTemplateDisk
- Cache string
- Dev
Prefix string - Discard string
- Driver string
- Image
Id double - Io string
- Size double
- Target string
- Volatile
Format string - Volatile
Type string
- Cache string
- Dev
Prefix string - Discard string
- Driver string
- Image
Id float64 - Io string
- Size float64
- Target string
- Volatile
Format string - Volatile
Type string
- cache String
- dev
Prefix String - discard String
- driver String
- image
Id Double - io String
- size Double
- target String
- volatile
Format String - volatile
Type String
- cache string
- dev
Prefix string - discard string
- driver string
- image
Id number - io string
- size number
- target string
- volatile
Format string - volatile
Type string
- cache str
- dev_
prefix str - discard str
- driver str
- image_
id float - io str
- size float
- target str
- volatile_
format str - volatile_
type str
- cache String
- dev
Prefix String - discard String
- driver String
- image
Id Number - io String
- size Number
- target String
- volatile
Format String - volatile
Type String
GetTemplatesTemplateNic
- Dns string
- Gateway string
- Ip string
- Mac string
- Method string
- Model string
- Network string
- Network
Id double - Network
Mode boolAuto - Physical
Device string - Sched
Rank string - Sched
Requirements string - Security
Groups List<double> - Virtio
Queues string
- Dns string
- Gateway string
- Ip string
- Mac string
- Method string
- Model string
- Network string
- Network
Id float64 - Network
Mode boolAuto - Physical
Device string - Sched
Rank string - Sched
Requirements string - Security
Groups []float64 - Virtio
Queues string
- dns String
- gateway String
- ip String
- mac String
- method String
- model String
- network String
- network
Id Double - network
Mode BooleanAuto - physical
Device String - sched
Rank String - sched
Requirements String - security
Groups List<Double> - virtio
Queues String
- dns string
- gateway string
- ip string
- mac string
- method string
- model string
- network string
- network
Id number - network
Mode booleanAuto - physical
Device string - sched
Rank string - sched
Requirements string - security
Groups number[] - virtio
Queues string
- dns str
- gateway str
- ip str
- mac str
- method str
- model str
- network str
- network_
id float - network_
mode_ boolauto - physical_
device str - sched_
rank str - sched_
requirements str - security_
groups Sequence[float] - virtio_
queues str
- dns String
- gateway String
- ip String
- mac String
- method String
- model String
- network String
- network
Id Number - network
Mode BooleanAuto - physical
Device String - sched
Rank String - sched
Requirements String - security
Groups List<Number> - virtio
Queues String
GetTemplatesTemplateVmgroup
- role str
- vmgroup_
id float
Package Details
- Repository
- opennebula opennebula/terraform-provider-opennebula
- License
- Notes
- This Pulumi package is based on the
opennebula
Terraform Provider.
opennebula 1.4.1 published on Monday, Apr 14, 2025 by opennebula