1. Packages
  2. Alicloud Provider
  3. API Docs
  4. oos
  5. getTemplates
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.oos.getTemplates

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    // Declare the data source
    const example = alicloud.oos.getTemplates({
        nameRegex: "test",
        tags: {
            Created: "TF",
            For: "template Test",
        },
        shareType: "Private",
        hasTrigger: false,
    });
    export const firstTemplateName = example.then(example => example.templates?.[0]?.templateName);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    # Declare the data source
    example = alicloud.oos.get_templates(name_regex="test",
        tags={
            "Created": "TF",
            "For": "template Test",
        },
        share_type="Private",
        has_trigger=False)
    pulumi.export("firstTemplateName", example.templates[0].template_name)
    
    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 {
    		// Declare the data source
    		example, err := oos.GetTemplates(ctx, &oos.GetTemplatesArgs{
    			NameRegex: pulumi.StringRef("test"),
    			Tags: map[string]interface{}{
    				"Created": "TF",
    				"For":     "template Test",
    			},
    			ShareType:  pulumi.StringRef("Private"),
    			HasTrigger: pulumi.BoolRef(false),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstTemplateName", example.Templates[0].TemplateName)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        // Declare the data source
        var example = AliCloud.Oos.GetTemplates.Invoke(new()
        {
            NameRegex = "test",
            Tags = 
            {
                { "Created", "TF" },
                { "For", "template Test" },
            },
            ShareType = "Private",
            HasTrigger = false,
        });
    
        return new Dictionary<string, object?>
        {
            ["firstTemplateName"] = example.Apply(getTemplatesResult => getTemplatesResult.Templates[0]?.TemplateName),
        };
    });
    
    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) {
            // Declare the data source
            final var example = OosFunctions.getTemplates(GetTemplatesArgs.builder()
                .nameRegex("test")
                .tags(Map.ofEntries(
                    Map.entry("Created", "TF"),
                    Map.entry("For", "template Test")
                ))
                .shareType("Private")
                .hasTrigger(false)
                .build());
    
            ctx.export("firstTemplateName", example.applyValue(getTemplatesResult -> getTemplatesResult.templates()[0].templateName()));
        }
    }
    
    variables:
      # Declare the data source
      example:
        fn::invoke:
          Function: alicloud:oos:getTemplates
          Arguments:
            nameRegex: test
            tags:
              Created: TF
              For: template Test
            shareType: Private
            hasTrigger: false
    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, str]] = 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, pulumi.Input[str]]]] = 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
    File name where to save data source results (after running pulumi preview).
    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, string>
    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
    File name where to save data source results (after running pulumi preview).
    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]string
    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
    File name where to save data source results (after running pulumi preview).
    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,String>
    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
    File name where to save data source results (after running pulumi preview).
    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]: string}
    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
    File name where to save data source results (after running pulumi preview).
    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, str]
    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
    File name where to save data source results (after running pulumi preview).
    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>
    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, string>
    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]string
    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,String>
    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]: string}
    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, str]
    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<String>
    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, string>
    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]string
    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,String>
    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]: string}
    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, str]
    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<String>
    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
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi