Project Templates [Beta]

This contains APIs for Project-scoped Templates.

Update Git details

Update Git details for multiple version.

Securityx-api-key
Request
path Parameters
template
required
string

Template Identifier

org
required
string

Organization Identifier

project
required
string

Project Identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json
Array
version
string
object (GitDetailsMetadata)

Git Details

Responses
200

Template GitMetadata response

put/v1/orgs/{org}/projects/{project}/templates/git-metadata/{template}
Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "status": true
}

Create Template

Creates a Template in the Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization Identifier

project
required
string

Project Identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:

Templates Create Request Body

template_yaml
string

Yaml for creating new Template

identifier
string <= 128 characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Template identifier

name
string <= 128 characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Template name

label
string <= 128 characters

Template version label

description
string <= 1024 characters

Pipeline description

object <= 128 properties

Template tags

object (Create Git Details)

Contains parameters related to creating an Entity for Git Experience.

is_stable
boolean

True if given version for template to be set as stable

comments
string

Specify comment with respect to changes

Responses
201

Template Response Body

post/v1/orgs/{org}/projects/{project}/templates
Request samples
{
  • "template_yaml": "template:\n name: Example_template\n identifier: example_template\n versionLabel: v1\n type: Stage\n tags: {}\n spec:\n type: Custom\n spec:\n execution:\n steps:\n - step:\n type: ShellScript\n name: ss1\n identifier: ss1\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: exit 1\n environmentVariables: []\n outputVariables: []\n timeout: 10m\n",
  • "git_details": {
    },
  • "is_stable": true,
  • "comments": "sample_comment"
}
Response samples
{
  • "account": "example_account",
  • "org": "example_organization",
  • "project": "example_project",
  • "identifier": "example_template",
  • "name": "Example_template",
  • "description": "string",
  • "tags": {
    },
  • "yaml": "template:\n name: Example_template\n identifier: example_template\n versionLabel: v1\n type: Stage\n tags: {}\n spec:\n type: Custom\n spec:\n execution:\n steps:\n - step:\n type: ShellScript\n name: ss1\n identifier: ss1\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: exit 1\n environmentVariables: []\n outputVariables: []\n timeout: 10m\n",
  • "version_label": "example_version",
  • "entity_type": "Stage",
  • "child_type": "example_child_type",
  • "scope": "org",
  • "version": 1234567890,
  • "git_details": {
    },
  • "updated": 1234567890,
  • "store_type": "INLINE",
  • "connector_ref": "example_connector_ref",
  • "stable_template": true
}

Get Templates List

Retrieves list of Template with meta-data at Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization Identifier

project
required
string

Project Identifier

query Parameters
page
integer
Default: 0

Pagination page number strategy: Specify the page number within the paginated collection related to the number of items in each page

limit
integer
Default: 30

Pagination: Number of items to return

sort
string

Parameter on the basis of which sorting is done.

Enum: "identifier" "name" "updated"
order
string

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
search_term
string

This would be used to filter resources having attributes matching with search term.

type
string

Template List Type

Enum: "STABLE_TEMPLATE" "LAST_UPDATES_TEMPLATE" "ALL"
recursive
boolean
Default: false

Specify true if all accessible Templates are to be included

names
Array of strings unique

Template names for filtering

identifiers
Array of strings unique

Template Ids for Filtering

description
string

Filter properties description

entity_types
Array of strings unique

Type of Template

Items Enum: "Step" "Stage" "Pipeline" "CustomDeployment" "MonitoredService" "SecretManager"
child_types
Array of strings unique

Child types describe the type of Step or stage

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Template Lists Meta Data Response

get/v1/orgs/{org}/projects/{project}/templates
Request samples
Response samples
[
  • {
    }
]

Get Stable Template

Retrieves stable version of Template at Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization Identifier

project
required
string

Project Identifier

template
required
string

Template Identifier

query Parameters
include_yaml
boolean

Use it to get Template along with Input Set YAML

branch_name
string

Name of the branch

parent_entity_connector_ref
string

Connector ref of parent template if its remote

parent_entity_repo_name
string

Repo name of parent template if its remote

parent_entity_account_id
string

Account name of parent template if its remote

parent_entity_org_id
string

Organization name of parent template if its remote

parent_entity_project_id
string

Project name of parent entity if its remote

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Template With Input reference

get/v1/orgs/{org}/projects/{project}/templates/{template}
Request samples
Response samples
{
  • "template": {
    },
  • "inputs": "example"
}

Retrieve a Template

Retrieves particular version of Template at Project scope.

Securityx-api-key
Request
path Parameters
project
required
string

Project Identifier

template
required
string

Template Identifier

org
required
string

Organization Identifier

version
required
string

Version Label for Template

query Parameters
include_yaml
boolean

Use it to get Template along with Input Set YAML

branch_name
string

Name of the branch

parent_entity_connector_ref
string

Connector ref of parent template if its remote

parent_entity_repo_name
string

Repo name of parent template if its remote

parent_entity_account_id
string

Account name of parent template if its remote

parent_entity_org_id
string

Organization name of parent template if its remote

parent_entity_project_id
string

Project name of parent entity if its remote

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Template With Input reference

get/v1/orgs/{org}/projects/{project}/templates/{template}/versions/{version}
Request samples
Response samples
{
  • "template": {
    },
  • "inputs": "example"
}

Update Template

Updates particular version of Template at Project scope.

Securityx-api-key
Request
path Parameters
project
required
string

Project Identifier

template
required
string

Template Identifier

org
required
string

Organization Identifier

version
required
string

Version Label for Template

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:

Templates Update Request Body

template_yaml
string

Yaml for updating existing Template

identifier
string <= 128 characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Template identifier

name
string <= 128 characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Template name

label
string <= 128 characters

Template version label

description
string <= 1024 characters

Pipeline description

object <= 128 properties

Template tags

object (GitUpdateDetails)

Contains parameters related to Updating an Entity for Git Experience.

comments
string

Specify comment with respect to changes

Responses
200

Template Response Body

put/v1/orgs/{org}/projects/{project}/templates/{template}/versions/{version}
Request samples
{
  • "template_yaml": "template:\n name: Example_template\n identifier: example_template\n versionLabel: v1\n type: Stage\n tags: {}\n spec:\n type: Custom\n spec:\n execution:\n steps:\n - step:\n type: ShellScript\n name: ss1\n identifier: ss1\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: exit 1\n environmentVariables: []\n outputVariables: []\n timeout: 10m\n",
  • "git_details": {
    },
  • "comments": "sample_comments"
}
Response samples
{
  • "account": "example_account",
  • "org": "example_organization",
  • "project": "example_project",
  • "identifier": "example_template",
  • "name": "Example_template",
  • "description": "string",
  • "tags": {
    },
  • "yaml": "template:\n name: Example_template\n identifier: example_template\n versionLabel: v1\n type: Stage\n tags: {}\n spec:\n type: Custom\n spec:\n execution:\n steps:\n - step:\n type: ShellScript\n name: ss1\n identifier: ss1\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: exit 1\n environmentVariables: []\n outputVariables: []\n timeout: 10m\n",
  • "version_label": "example_version",
  • "entity_type": "Stage",
  • "child_type": "example_child_type",
  • "scope": "org",
  • "version": 1234567890,
  • "git_details": {
    },
  • "updated": 1234567890,
  • "store_type": "INLINE",
  • "connector_ref": "example_connector_ref",
  • "stable_template": true
}

Delete Template

Deletes particular version of Template at Project scope.

Securityx-api-key
Request
path Parameters
project
required
string

Project Identifier

template
required
string

Template Identifier

org
required
string

Organization Identifier

version
required
string

Version Label for Template

query Parameters
comments
string

Specify comment with respect to changes

forceDelete
boolean
Default: false

Enable this field to force delete a template

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
204

No Content

400

Bad Request

delete/v1/orgs/{org}/projects/{project}/templates/{template}/versions/{version}
Request samples
Response samples
{ }

Update Stable Template

Updates the stable version of Template at Project scope.

Securityx-api-key
Request
path Parameters
org
required
string

Organization Identifier

project
required
string

Project Identifier

template
required
string

Template Identifier

version
required
string

Version Label for Template

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:

Templates Fetch Request Body

branch_name
string

Name of the branch.

parent_entity_connector_ref
string

Connector ref of parent template if its remote

parent_entity_repo_name
string

Repo name of parent template if its remote

parent_entity_account_id
string

Account name of parent template if its remote

parent_entity_org_id
string

Organization name of parent template if its remote

parent_entity_project_id
string

Project name of parent entity if its remote

comments
string

Specify comment with respect to changes

Responses
200

Template stable version update Response

put/v1/orgs/{org}/projects/{project}/templates/{template}/versions/{version}/stable
Request samples
{
  • "branch_name": "branch",
  • "parent_entity_connector_ref": "example_connector_ref",
  • "parent_entity_repo_name": "example_repo_name",
  • "parent_entity_account_id": "example_account_id",
  • "parent_entity_org_id": "example_org_id",
  • "parent_entity_project_id": "example_project_id",
  • "comments": "sample_comments"
}
Response samples
{
  • "stable_version": "example_version"
}

Import Template

Import template at a project level

Securityx-api-key
Request
path Parameters
org
required
string

Organization Identifier

project
required
string

Project Identifier

template
required
string

Template Identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json
object (Git Import Details)

Contains parameters related to importing an Entity for Git Experience.

object (Template Import Request DTO)

Information of Tempalte import request DTO

Responses
200

Example response

post/v1/orgs/{org}/projects/{project}/templates/{template}/import
Request samples
application/json
{
  • "git_import_details": {
    },
  • "template_import_request": {
    }
}
Response samples
application/json
{
  • "template_identifier": "string",
  • "template_version": "string"
}