Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi
harness.platform.getTemplate
Explore with Pulumi AI
Data source for retrieving a Harness pipeline.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
//For account level template
const example = harness.platform.getTemplate({
identifier: "identifier",
version: "version",
});
//For org level template
const example1 = harness.platform.getTemplate({
identifier: "identifier",
version: "version",
orgId: "org_id",
});
//For project level template
const example2 = harness.platform.getTemplate({
identifier: "identifier",
version: "version",
orgId: "org_id",
projectId: "project_id",
});
import pulumi
import pulumi_harness as harness
#For account level template
example = harness.platform.get_template(identifier="identifier",
version="version")
#For org level template
example1 = harness.platform.get_template(identifier="identifier",
version="version",
org_id="org_id")
#For project level template
example2 = harness.platform.get_template(identifier="identifier",
version="version",
org_id="org_id",
project_id="project_id")
package main
import (
"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// For account level template
_, err := platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
Identifier: pulumi.StringRef("identifier"),
Version: pulumi.StringRef("version"),
}, nil)
if err != nil {
return err
}
// For org level template
_, err = platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
Identifier: pulumi.StringRef("identifier"),
Version: pulumi.StringRef("version"),
OrgId: pulumi.StringRef("org_id"),
}, nil)
if err != nil {
return err
}
// For project level template
_, err = platform.LookupTemplate(ctx, &platform.LookupTemplateArgs{
Identifier: pulumi.StringRef("identifier"),
Version: pulumi.StringRef("version"),
OrgId: pulumi.StringRef("org_id"),
ProjectId: pulumi.StringRef("project_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
//For account level template
var example = Harness.Platform.GetTemplate.Invoke(new()
{
Identifier = "identifier",
Version = "version",
});
//For org level template
var example1 = Harness.Platform.GetTemplate.Invoke(new()
{
Identifier = "identifier",
Version = "version",
OrgId = "org_id",
});
//For project level template
var example2 = Harness.Platform.GetTemplate.Invoke(new()
{
Identifier = "identifier",
Version = "version",
OrgId = "org_id",
ProjectId = "project_id",
});
});
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) {
//For account level template
final var example = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
.identifier("identifier")
.version("version")
.build());
//For org level template
final var example1 = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
.identifier("identifier")
.version("version")
.orgId("org_id")
.build());
//For project level template
final var example2 = PlatformFunctions.getTemplate(GetTemplateArgs.builder()
.identifier("identifier")
.version("version")
.orgId("org_id")
.projectId("project_id")
.build());
}
}
variables:
#For account level template
example:
fn::invoke:
Function: harness:platform:getTemplate
Arguments:
identifier: identifier
version: version
#For org level template
example1:
fn::invoke:
Function: harness:platform:getTemplate
Arguments:
identifier: identifier
version: version
orgId: org_id
#For project level template
example2:
fn::invoke:
Function: harness:platform:getTemplate
Arguments:
identifier: identifier
version: version
orgId: org_id
projectId: project_id
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 dictionary
The following arguments are supported:
- 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 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 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.
- []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 pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.