Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getTemplates

This data source provides a list of OOS Templates in an Alibaba Cloud account according to the specified filters.

NOTE: Available in v1.92.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Oos.GetTemplates.InvokeAsync(new AliCloud.Oos.GetTemplatesArgs
        {
            HasTrigger = false,
            NameRegex = "test",
            ShareType = "Private",
            Tags = 
            {
                { "Created", "TF" },
                { "For", "template Test" },
            },
        }));
        this.FirstTemplateName = example.Apply(example => example.Templates?[0]?.TemplateName);
    }

    [Output("firstTemplateName")]
    public Output<string> FirstTemplateName { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := oos.GetTemplates(ctx, &oos.GetTemplatesArgs{
			HasTrigger: pulumi.BoolRef(false),
			NameRegex:  pulumi.StringRef("test"),
			ShareType:  pulumi.StringRef("Private"),
			Tags: map[string]interface{}{
				"Created": "TF",
				"For":     "template Test",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstTemplateName", example.Templates[0].TemplateName)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.oos.OosFunctions;
import com.pulumi.alicloud.oos.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 = OosFunctions.getTemplates(GetTemplatesArgs.builder()
            .hasTrigger(false)
            .nameRegex("test")
            .shareType("Private")
            .tags(Map.ofEntries(
                Map.entry("Created", "TF"),
                Map.entry("For", "template Test")
            ))
            .build());

        ctx.export("firstTemplateName", example.applyValue(getTemplatesResult -> getTemplatesResult.templates()[0].templateName()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.oos.get_templates(has_trigger=False,
    name_regex="test",
    share_type="Private",
    tags={
        "Created": "TF",
        "For": "template Test",
    })
pulumi.export("firstTemplateName", example.templates[0].template_name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.oos.getTemplates({
    hasTrigger: false,
    nameRegex: "test",
    shareType: "Private",
    tags: {
        Created: "TF",
        For: "template Test",
    },
}));

export const firstTemplateName = example.templates[0].templateName;
variables:
  example:
    Fn::Invoke:
      Function: alicloud:oos:getTemplates
      Arguments:
        hasTrigger: false
        nameRegex: test
        shareType: Private
        tags:
          Created: TF
          For: template Test
outputs:
  firstTemplateName: ${example.templates[0].templateName}

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(category: Optional[str] = None,
                  created_by: Optional[str] = None,
                  created_date: Optional[str] = None,
                  created_date_after: Optional[str] = None,
                  has_trigger: Optional[bool] = None,
                  ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  share_type: Optional[str] = None,
                  sort_field: Optional[str] = None,
                  sort_order: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  template_format: Optional[str] = None,
                  template_type: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTemplatesResult
def get_templates_output(category: Optional[pulumi.Input[str]] = None,
                  created_by: Optional[pulumi.Input[str]] = None,
                  created_date: Optional[pulumi.Input[str]] = None,
                  created_date_after: Optional[pulumi.Input[str]] = None,
                  has_trigger: Optional[pulumi.Input[bool]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  share_type: Optional[pulumi.Input[str]] = None,
                  sort_field: Optional[pulumi.Input[str]] = None,
                  sort_order: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                  template_format: Optional[pulumi.Input[str]] = None,
                  template_type: Optional[pulumi.Input[str]] = 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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:oos/getTemplates:getTemplates
  arguments:
    # arguments dictionary

The following arguments are supported:

Category string

The category of template.

CreatedBy string

The creator of the template.

CreatedDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

CreatedDateAfter string

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

HasTrigger bool

Is it triggered successfully.

Ids List<string>

A list of OOS Template ids. Each element in the list is same as template_name.

NameRegex string

A regex string to filter the results by the template_name.

OutputFile string
ShareType string

The sharing type of the template. Valid values: Private, Public.

SortField string

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

SortOrder string

Sort order. Valid values: Ascending, Descending. Default to Descending

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

TemplateFormat string

The format of the template. Valid values: JSON, YAML.

TemplateType string

The type of OOS Template.

Category string

The category of template.

CreatedBy string

The creator of the template.

CreatedDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

CreatedDateAfter string

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

HasTrigger bool

Is it triggered successfully.

Ids []string

A list of OOS Template ids. Each element in the list is same as template_name.

NameRegex string

A regex string to filter the results by the template_name.

OutputFile string
ShareType string

The sharing type of the template. Valid values: Private, Public.

SortField string

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

SortOrder string

Sort order. Valid values: Ascending, Descending. Default to Descending

Tags map[string]interface{}

A mapping of tags to assign to the resource.

TemplateFormat string

The format of the template. Valid values: JSON, YAML.

TemplateType string

The type of OOS Template.

category String

The category of template.

createdBy String

The creator of the template.

createdDate String

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

createdDateAfter String

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

hasTrigger Boolean

Is it triggered successfully.

ids List<String>

A list of OOS Template ids. Each element in the list is same as template_name.

nameRegex String

A regex string to filter the results by the template_name.

outputFile String
shareType String

The sharing type of the template. Valid values: Private, Public.

sortField String

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

sortOrder String

Sort order. Valid values: Ascending, Descending. Default to Descending

tags Map<String,Object>

A mapping of tags to assign to the resource.

templateFormat String

The format of the template. Valid values: JSON, YAML.

templateType String

The type of OOS Template.

category string

The category of template.

createdBy string

The creator of the template.

createdDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

createdDateAfter string

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

hasTrigger boolean

Is it triggered successfully.

ids string[]

A list of OOS Template ids. Each element in the list is same as template_name.

nameRegex string

A regex string to filter the results by the template_name.

outputFile string
shareType string

The sharing type of the template. Valid values: Private, Public.

sortField string

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

sortOrder string

Sort order. Valid values: Ascending, Descending. Default to Descending

tags {[key: string]: any}

A mapping of tags to assign to the resource.

templateFormat string

The format of the template. Valid values: JSON, YAML.

templateType string

The type of OOS Template.

category str

The category of template.

created_by str

The creator of the template.

created_date str

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

created_date_after str

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

has_trigger bool

Is it triggered successfully.

ids Sequence[str]

A list of OOS Template ids. Each element in the list is same as template_name.

name_regex str

A regex string to filter the results by the template_name.

output_file str
share_type str

The sharing type of the template. Valid values: Private, Public.

sort_field str

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

sort_order str

Sort order. Valid values: Ascending, Descending. Default to Descending

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

template_format str

The format of the template. Valid values: JSON, YAML.

template_type str

The type of OOS Template.

category String

The category of template.

createdBy String

The creator of the template.

createdDate String

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

createdDateAfter String

Create a template whose time is greater than or equal to the specified time. The format is: YYYY-MM-DDThh:mm:ssZ.

hasTrigger Boolean

Is it triggered successfully.

ids List<String>

A list of OOS Template ids. Each element in the list is same as template_name.

nameRegex String

A regex string to filter the results by the template_name.

outputFile String
shareType String

The sharing type of the template. Valid values: Private, Public.

sortField String

Sort field. Valid values: TotalExecutionCount, Popularity, TemplateName and CreatedDate. Default to TotalExecutionCount.

sortOrder String

Sort order. Valid values: Ascending, Descending. Default to Descending

tags Map<Any>

A mapping of tags to assign to the resource.

templateFormat String

The format of the template. Valid values: JSON, YAML.

templateType String

The type of OOS Template.

getTemplates Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of OOS Template ids. Each element in the list is same as template_name.

Names List<string>

(Available in v1.114.0+) A list of OOS Template names.

Templates List<Pulumi.AliCloud.Oos.Outputs.GetTemplatesTemplate>

A list of OOS Templates. Each element contains the following attributes:

Category string
CreatedBy string
CreatedDate string
CreatedDateAfter string
HasTrigger bool
NameRegex string
OutputFile string
ShareType string
SortField string
SortOrder string
Tags Dictionary<string, object>
TemplateFormat string
TemplateType string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of OOS Template ids. Each element in the list is same as template_name.

Names []string

(Available in v1.114.0+) A list of OOS Template names.

Templates []GetTemplatesTemplate

A list of OOS Templates. Each element contains the following attributes:

Category string
CreatedBy string
CreatedDate string
CreatedDateAfter string
HasTrigger bool
NameRegex string
OutputFile string
ShareType string
SortField string
SortOrder string
Tags map[string]interface{}
TemplateFormat string
TemplateType string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of OOS Template ids. Each element in the list is same as template_name.

names List<String>

(Available in v1.114.0+) A list of OOS Template names.

templates List<GetTemplatesTemplate>

A list of OOS Templates. Each element contains the following attributes:

category String
createdBy String
createdDate String
createdDateAfter String
hasTrigger Boolean
nameRegex String
outputFile String
shareType String
sortField String
sortOrder String
tags Map<String,Object>
templateFormat String
templateType String
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of OOS Template ids. Each element in the list is same as template_name.

names string[]

(Available in v1.114.0+) A list of OOS Template names.

templates GetTemplatesTemplate[]

A list of OOS Templates. Each element contains the following attributes:

category string
createdBy string
createdDate string
createdDateAfter string
hasTrigger boolean
nameRegex string
outputFile string
shareType string
sortField string
sortOrder string
tags {[key: string]: any}
templateFormat string
templateType string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of OOS Template ids. Each element in the list is same as template_name.

names Sequence[str]

(Available in v1.114.0+) A list of OOS Template names.

templates Sequence[GetTemplatesTemplate]

A list of OOS Templates. Each element contains the following attributes:

category str
created_by str
created_date str
created_date_after str
has_trigger bool
name_regex str
output_file str
share_type str
sort_field str
sort_order str
tags Mapping[str, Any]
template_format str
template_type str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of OOS Template ids. Each element in the list is same as template_name.

names List<String>

(Available in v1.114.0+) A list of OOS Template names.

templates List<Property Map>

A list of OOS Templates. Each element contains the following attributes:

category String
createdBy String
createdDate String
createdDateAfter String
hasTrigger Boolean
nameRegex String
outputFile String
shareType String
sortField String
sortOrder String
tags Map<Any>
templateFormat String
templateType String

Supporting Types

GetTemplatesTemplate

Category string

The category of template.

CreatedBy string

The creator of the template.

CreatedDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

Description string

Description of the OOS Template.

HasTrigger bool

Is it triggered successfully.

Id string

ID of the OOS Template. The value is same as template_name.

ShareType string

The sharing type of the template. Valid values: Private, Public.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

TemplateFormat string

The format of the template. Valid values: JSON, YAML.

TemplateId string

ID of the OOS Template resource.

TemplateName string

Name of the OOS Template.

TemplateType string

The type of OOS Template.

TemplateVersion string

Version of the OOS Template.

UpdatedBy string

The user who updated the template.

UpdatedDate string

The time when the template was updated.

Category string

The category of template.

CreatedBy string

The creator of the template.

CreatedDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

Description string

Description of the OOS Template.

HasTrigger bool

Is it triggered successfully.

Id string

ID of the OOS Template. The value is same as template_name.

ShareType string

The sharing type of the template. Valid values: Private, Public.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

TemplateFormat string

The format of the template. Valid values: JSON, YAML.

TemplateId string

ID of the OOS Template resource.

TemplateName string

Name of the OOS Template.

TemplateType string

The type of OOS Template.

TemplateVersion string

Version of the OOS Template.

UpdatedBy string

The user who updated the template.

UpdatedDate string

The time when the template was updated.

category String

The category of template.

createdBy String

The creator of the template.

createdDate String

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

description String

Description of the OOS Template.

hasTrigger Boolean

Is it triggered successfully.

id String

ID of the OOS Template. The value is same as template_name.

shareType String

The sharing type of the template. Valid values: Private, Public.

tags Map<String,Object>

A mapping of tags to assign to the resource.

templateFormat String

The format of the template. Valid values: JSON, YAML.

templateId String

ID of the OOS Template resource.

templateName String

Name of the OOS Template.

templateType String

The type of OOS Template.

templateVersion String

Version of the OOS Template.

updatedBy String

The user who updated the template.

updatedDate String

The time when the template was updated.

category string

The category of template.

createdBy string

The creator of the template.

createdDate string

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

description string

Description of the OOS Template.

hasTrigger boolean

Is it triggered successfully.

id string

ID of the OOS Template. The value is same as template_name.

shareType string

The sharing type of the template. Valid values: Private, Public.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

templateFormat string

The format of the template. Valid values: JSON, YAML.

templateId string

ID of the OOS Template resource.

templateName string

Name of the OOS Template.

templateType string

The type of OOS Template.

templateVersion string

Version of the OOS Template.

updatedBy string

The user who updated the template.

updatedDate string

The time when the template was updated.

category str

The category of template.

created_by str

The creator of the template.

created_date str

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

description str

Description of the OOS Template.

has_trigger bool

Is it triggered successfully.

id str

ID of the OOS Template. The value is same as template_name.

share_type str

The sharing type of the template. Valid values: Private, Public.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

template_format str

The format of the template. Valid values: JSON, YAML.

template_id str

ID of the OOS Template resource.

template_name str

Name of the OOS Template.

template_type str

The type of OOS Template.

template_version str

Version of the OOS Template.

updated_by str

The user who updated the template.

updated_date str

The time when the template was updated.

category String

The category of template.

createdBy String

The creator of the template.

createdDate String

The template whose creation time is less than or equal to the specified time. The format is: YYYY-MM-DDThh:mm::ssZ.

description String

Description of the OOS Template.

hasTrigger Boolean

Is it triggered successfully.

id String

ID of the OOS Template. The value is same as template_name.

shareType String

The sharing type of the template. Valid values: Private, Public.

tags Map<Any>

A mapping of tags to assign to the resource.

templateFormat String

The format of the template. Valid values: JSON, YAML.

templateId String

ID of the OOS Template resource.

templateName String

Name of the OOS Template.

templateType String

The type of OOS Template.

templateVersion String

Version of the OOS Template.

updatedBy String

The user who updated the template.

updatedDate String

The time when the template was updated.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.