Harness v0.0.6 published on Saturday, Jul 1, 2023 by lbrlabs
harness.platform.getTemplate
Explore with Pulumi AI
Data source for retrieving a Harness pipeline.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() => 
{
    var example = Harness.Platform.GetTemplate.Invoke(new()
    {
        Identifier = "identifier",
        Version = "version",
    });
    var example1 = Harness.Platform.GetTemplate.Invoke(new()
    {
        Identifier = "identifier",
        OrgId = "org_id",
        Version = "version",
    });
    var example2 = Harness.Platform.GetTemplate.Invoke(new()
    {
        Identifier = "identifier",
        OrgId = "org_id",
        ProjectId = "project_id",
        Version = "version",
    });
});
package main
import (
	"github.com/lbrlabs/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
			Identifier: pulumi.StringRef("identifier"),
			Version:    pulumi.StringRef("version"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
			Identifier: pulumi.StringRef("identifier"),
			OrgId:      pulumi.StringRef("org_id"),
			Version:    pulumi.StringRef("version"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
			Identifier: pulumi.StringRef("identifier"),
			OrgId:      pulumi.StringRef("org_id"),
			ProjectId:  pulumi.StringRef("project_id"),
			Version:    pulumi.StringRef("version"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.PlatformFunctions;
import com.pulumi.harness.platform.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 = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
            .identifier("identifier")
            .version("version")
            .build());
        final var example1 = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
            .identifier("identifier")
            .orgId("org_id")
            .version("version")
            .build());
        final var example2 = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
            .identifier("identifier")
            .orgId("org_id")
            .projectId("project_id")
            .version("version")
            .build());
    }
}
import pulumi
import pulumi_harness as harness
example = harness.platform.get_template(identifier="identifier",
    version="version")
example1 = harness.platform.get_template(identifier="identifier",
    org_id="org_id",
    version="version")
example2 = harness.platform.get_template(identifier="identifier",
    org_id="org_id",
    project_id="project_id",
    version="version")
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const example = harness.platform.getTemplate({
    identifier: "identifier",
    version: "version",
});
const example1 = harness.platform.getTemplate({
    identifier: "identifier",
    orgId: "org_id",
    version: "version",
});
const example2 = harness.platform.getTemplate({
    identifier: "identifier",
    orgId: "org_id",
    projectId: "project_id",
    version: "version",
});
variables:
  example:
    fn::invoke:
      Function: harness:platform:getTemplate
      Arguments:
        identifier: identifier
        version: version
  example1:
    fn::invoke:
      Function: harness:platform:getTemplate
      Arguments:
        identifier: identifier
        orgId: org_id
        version: version
  example2:
    fn::invoke:
      Function: harness:platform:getTemplate
      Arguments:
        identifier: identifier
        orgId: org_id
        projectId: project_id
        version: version
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(branch_name: Optional[str] = None,
                 child_type: Optional[str] = None,
                 git_details: Optional[GetTemplateGitDetails] = None,
                 identifier: Optional[str] = None,
                 is_stable: Optional[bool] = None,
                 name: Optional[str] = None,
                 org_id: Optional[str] = None,
                 project_id: Optional[str] = None,
                 scope: Optional[str] = None,
                 version: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetTemplateResult
def get_template_output(branch_name: Optional[pulumi.Input[str]] = None,
                 child_type: Optional[pulumi.Input[str]] = None,
                 git_details: Optional[pulumi.Input[GetTemplateGitDetailsArgs]] = None,
                 identifier: Optional[pulumi.Input[str]] = None,
                 is_stable: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 org_id: Optional[pulumi.Input[str]] = None,
                 project_id: Optional[pulumi.Input[str]] = None,
                 scope: Optional[pulumi.Input[str]] = None,
                 version: Optional[pulumi.Input[str]] = 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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: harness:platform/getTemplate:getTemplate
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Branch
Name string - Version Label for Template.
 - Child
Type string - Defines child template type.
 - Git
Details Lbrlabs.Pulumi Package. Harness. Platform. Inputs. Get Template Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - Identifier string
 - Unique identifier of the resource.
 - Is
Stable bool - True if given version for template to be set as stable.
 - Name string
 - Name of the resource.
 - Org
Id string - Unique identifier of the organization.
 - Project
Id string - Unique identifier of the project.
 - Scope string
 - Scope of template.
 - Version string
 - Version Label for Template.
 
- Branch
Name string - Version Label for Template.
 - Child
Type string - Defines child template type.
 - Git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - Identifier string
 - Unique identifier of the resource.
 - Is
Stable bool - True if given version for template to be set as stable.
 - Name string
 - Name of the resource.
 - Org
Id string - Unique identifier of the organization.
 - Project
Id string - Unique identifier of the project.
 - Scope string
 - Scope of template.
 - Version string
 - Version Label for Template.
 
- branch
Name String - Version Label for Template.
 - child
Type String - Defines child template type.
 - git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier String
 - Unique identifier of the resource.
 - is
Stable Boolean - True if given version for template to be set as stable.
 - name String
 - Name of the resource.
 - org
Id String - Unique identifier of the organization.
 - project
Id String - Unique identifier of the project.
 - scope String
 - Scope of template.
 - version String
 - Version Label for Template.
 
- branch
Name string - Version Label for Template.
 - child
Type string - Defines child template type.
 - git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier string
 - Unique identifier of the resource.
 - is
Stable boolean - True if given version for template to be set as stable.
 - name string
 - Name of the resource.
 - org
Id string - Unique identifier of the organization.
 - project
Id string - Unique identifier of the project.
 - scope string
 - Scope of template.
 - version string
 - Version Label for Template.
 
- branch_
name str - Version Label for Template.
 - child_
type str - Defines child template type.
 - git_
details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier str
 - Unique identifier of the resource.
 - is_
stable bool - True if given version for template to be set as stable.
 - name str
 - Name of the resource.
 - org_
id str - Unique identifier of the organization.
 - project_
id str - Unique identifier of the project.
 - scope str
 - Scope of template.
 - version str
 - Version Label for Template.
 
- branch
Name String - Version Label for Template.
 - child
Type String - Defines child template type.
 - git
Details Property Map - Contains parameters related to creating an Entity for Git Experience.
 - identifier String
 - Unique identifier of the resource.
 - is
Stable Boolean - True if given version for template to be set as stable.
 - name String
 - Name of the resource.
 - org
Id String - Unique identifier of the organization.
 - project
Id String - Unique identifier of the project.
 - scope String
 - Scope of template.
 - version String
 - Version Label for Template.
 
getTemplate Result
The following output properties are available:
- Connector
Ref string - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - Description string
 - Description of the resource.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Store
Type string - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - List<string>
 - Tags to associate with the resource.
 - Template
Yaml string - Yaml for creating new Template.
 - Branch
Name string - Version Label for Template.
 - Child
Type string - Defines child template type.
 - Git
Details Lbrlabs.Pulumi Package. Harness. Platform. Outputs. Get Template Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - Identifier string
 - Unique identifier of the resource.
 - Is
Stable bool - True if given version for template to be set as stable.
 - Name string
 - Name of the resource.
 - Org
Id string - Unique identifier of the organization.
 - Project
Id string - Unique identifier of the project.
 - Scope string
 - Scope of template.
 - Version string
 - Version Label for Template.
 
- Connector
Ref string - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - Description string
 - Description of the resource.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Store
Type string - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - []string
 - Tags to associate with the resource.
 - Template
Yaml string - Yaml for creating new Template.
 - Branch
Name string - Version Label for Template.
 - Child
Type string - Defines child template type.
 - Git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - Identifier string
 - Unique identifier of the resource.
 - Is
Stable bool - True if given version for template to be set as stable.
 - Name string
 - Name of the resource.
 - Org
Id string - Unique identifier of the organization.
 - Project
Id string - Unique identifier of the project.
 - Scope string
 - Scope of template.
 - Version string
 - Version Label for Template.
 
- connector
Ref String - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - description String
 - Description of the resource.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - store
Type String - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - List<String>
 - Tags to associate with the resource.
 - template
Yaml String - Yaml for creating new Template.
 - branch
Name String - Version Label for Template.
 - child
Type String - Defines child template type.
 - git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier String
 - Unique identifier of the resource.
 - is
Stable Boolean - True if given version for template to be set as stable.
 - name String
 - Name of the resource.
 - org
Id String - Unique identifier of the organization.
 - project
Id String - Unique identifier of the project.
 - scope String
 - Scope of template.
 - version String
 - Version Label for Template.
 
- connector
Ref string - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - description string
 - Description of the resource.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - store
Type string - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - string[]
 - Tags to associate with the resource.
 - template
Yaml string - Yaml for creating new Template.
 - branch
Name string - Version Label for Template.
 - child
Type string - Defines child template type.
 - git
Details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier string
 - Unique identifier of the resource.
 - is
Stable boolean - True if given version for template to be set as stable.
 - name string
 - Name of the resource.
 - org
Id string - Unique identifier of the organization.
 - project
Id string - Unique identifier of the project.
 - scope string
 - Scope of template.
 - version string
 - Version Label for Template.
 
- connector_
ref str - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - description str
 - Description of the resource.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - store_
type str - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - Sequence[str]
 - Tags to associate with the resource.
 - template_
yaml str - Yaml for creating new Template.
 - branch_
name str - Version Label for Template.
 - child_
type str - Defines child template type.
 - git_
details GetTemplate Git Details  - Contains parameters related to creating an Entity for Git Experience.
 - identifier str
 - Unique identifier of the resource.
 - is_
stable bool - True if given version for template to be set as stable.
 - name str
 - Name of the resource.
 - org_
id str - Unique identifier of the organization.
 - project_
id str - Unique identifier of the project.
 - scope str
 - Scope of template.
 - version str
 - Version Label for Template.
 
- connector
Ref String - Identifier of the Harness Connector used for CRUD operations on the Entity.
 - description String
 - Description of the resource.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - store
Type String - Specifies whether the Entity is to be stored in Git or not. Possible values: INLINE, REMOTE.
 - List<String>
 - Tags to associate with the resource.
 - template
Yaml String - Yaml for creating new Template.
 - branch
Name String - Version Label for Template.
 - child
Type String - Defines child template type.
 - git
Details Property Map - Contains parameters related to creating an Entity for Git Experience.
 - identifier String
 - Unique identifier of the resource.
 - is
Stable Boolean - True if given version for template to be set as stable.
 - name String
 - Name of the resource.
 - org
Id String - Unique identifier of the organization.
 - project
Id String - Unique identifier of the project.
 - scope String
 - Scope of template.
 - version String
 - Version Label for Template.
 
Supporting Types
GetTemplateGitDetails   
- Last
Commit stringId  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - Last
Object stringId  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - Branch
Name string - Name of the branch.
 - File
Path string - File path of the Entity in the repository.
 - File
Url string - File url of the Entity in the repository.
 - Repo
Name string - Name of the repository.
 - Repo
Url string - Repo url of the Entity in the repository.
 
- Last
Commit stringId  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - Last
Object stringId  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - Branch
Name string - Name of the branch.
 - File
Path string - File path of the Entity in the repository.
 - File
Url string - File url of the Entity in the repository.
 - Repo
Name string - Name of the repository.
 - Repo
Url string - Repo url of the Entity in the repository.
 
- last
Commit StringId  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - last
Object StringId  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - branch
Name String - Name of the branch.
 - file
Path String - File path of the Entity in the repository.
 - file
Url String - File url of the Entity in the repository.
 - repo
Name String - Name of the repository.
 - repo
Url String - Repo url of the Entity in the repository.
 
- last
Commit stringId  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - last
Object stringId  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - branch
Name string - Name of the branch.
 - file
Path string - File path of the Entity in the repository.
 - file
Url string - File url of the Entity in the repository.
 - repo
Name string - Name of the repository.
 - repo
Url string - Repo url of the Entity in the repository.
 
- last_
commit_ strid  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - last_
object_ strid  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - branch_
name str - Name of the branch.
 - file_
path str - File path of the Entity in the repository.
 - file_
url str - File url of the Entity in the repository.
 - repo_
name str - Name of the repository.
 - repo_
url str - Repo url of the Entity in the repository.
 
- last
Commit StringId  - Last commit identifier (for Git Repositories other than Github). To be provided only when updating Pipeline.
 - last
Object StringId  - Last object identifier (for Github). To be provided only when updating Pipeline.
 - branch
Name String - Name of the branch.
 - file
Path String - File path of the Entity in the repository.
 - file
Url String - File url of the Entity in the repository.
 - repo
Name String - Name of the repository.
 - repo
Url String - Repo url of the Entity in the repository.
 
Package Details
- Repository
 - harness lbrlabs/pulumi-harness
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
harnessTerraform Provider.