Pipelines [Beta]

This contains APIs for performing CRUD operations on Pipelines.

List Pipelines

Returns a list of Pipelines.

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 on each page.

limit
integer <= 100
Default: 30

Pagination: Number of items to return.

search_term
string

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

sort
string

Parameter on the basis of which sorting is done.

Enum: "name" "updated"
order
string

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
module
string

Harness module which is part of the Pipeline.

Enum: "CD" "CI" "CV" "CF" "CE" "STO"
filter_identifier
string

Identifier of a saved Filter.

pipeline_identifiers
Array of strings

List of Pipeline identifiers on the basis of which the Pipelines are filtered.

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

Pipeline Name on the basis of which the Pipelines are filtered.

description
string <= 1024 characters

Pipeline Description on the basis of which the Pipelines are filtered.

tags
Array of strings <= 128 items

Filter tags as a key:value pair.

Examples:
tags=key:value
tags=key
service_names
Array of strings

Service names on the basis of which the Pipelines are filtered. [CD]

env_names
Array of strings

Names of Environments on the basis of which the Pipelines are filtered. [CD]

deployment_type
string

Deployment type on the basis of which the Pipelines are filtered. [CD]

repository
string

Repository name on the basis of which the Pipelines are filtered. [CI]

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Responses
200

Response body for List Pipelines.

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

Create a Pipeline

Creates a Pipeline.

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:
required

Pipeline request body

pipeline_yaml
required
string

Pipeline YAML (to be passed as a String).

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Pipeline identifier

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

Pipeline name

description
string <= 1024 characters

Pipeline description

object <= 128 properties

Pipeline tags

object (Create Git Details)

Contains parameters related to creating an Entity for Git Experience.

Responses
201

Pipeline response body

post/v1/orgs/{org}/projects/{project}/pipelines
Request samples
{
  • "pipeline_yaml": "pipeline:\n identifier: example_pipeline\n name: ExamplePipeline\n allowStageExecutions: false\n stages:\n - stage:\n name: Example Build Stage\n identifier: example_build_stage\n description: ''\n type: Approval\n spec:\n execution:\n steps:\n - step:\n name: Approval Step\n identifier: Approval_Step\n type: HarnessApproval\n timeout: 1d\n spec:\n approvalMessage: |-\n Please review the following information\n and approve the pipeline progression\n includePipelineExecutionHistory: true\n approvers:\n minimumCount: 1\n disallowPipelineExecutor: false\n userGroups: <+input>\n approverInputs: []\n - step:\n type: ShellScript\n name: ShellScript Step\n identifier: ShellScript_Step\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: <+input>\n environmentVariables: []\n outputVariables: []\n executionTarget: {}\n timeout: 10m\n tags: {}\n - stage:\n name: Example Deploy Stage\n identifier: example_deploy_stage\n description: ''\n type: Deployment\n spec:\n serviceConfig:\n serviceRef: <+input>\n serviceDefinition:\n spec:\n variables: []\n type: Kubernetes\n infrastructure:\n environmentRef: <+input>\n infrastructureDefinition:\n type: KubernetesDirect\n spec:\n connectorRef: <+input>\n namespace: <+input>\n releaseName: release-<+INFRA_KEY>\n allowSimultaneousDeployments: false\n execution:\n steps:\n - step:\n name: Rollout Deployment\n identifier: rolloutDeployment\n type: K8sRollingDeploy\n timeout: 10m\n spec:\n skipDryRun: false\n rollbackSteps:\n - step:\n name: Rollback Rollout Deployment\n identifier: rollbackRolloutDeployment\n type: K8sRollingRollback\n timeout: 10m\n spec: {}\n tags: {}\n failureStrategies:\n - onFailure:\n errors:\n - AllErrors\n action:\n type: StageRollback\n",
  • "identifier": "example_pipeline",
  • "name": "ExamplePipeline",
  • "description": "Pipeline Description",
  • "tags": {
    },
  • "git_details": {
    }
}
Response samples
{
  • "identifier": "example_pipeline"
}

Retrieve a Pipeline

Retrieves a Pipeline.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

query Parameters
branch_name
string

Name of the branch (for Git Experience).

template_applied
boolean
Default: false

If true, returns Pipeline YAML with Templates applied on it.

connector_ref
string

Identifier of the Harness Connector used for CRUD operations on the Entity (for Git Experience).

repo_name
string

Name of the repository (for Git Experience).

load_from_fallback_branch
boolean
Default: false

Flag to load the pipeline from the created non default branch

validate_async
boolean
Default: "false"

Flag to tell whether to start an asynchronous validation process or not

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Load-From-Cache
string
Default: false

Flag to enable loading the remote pipeline from git or git cache

Responses
200

Pipeline response body

get/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}
Request samples
Response samples
{
  • "pipeline_yaml": "example_yaml_text",
  • "template_applied_pipeline_yaml": "example_yaml_text_with_template",
  • "identifier": "example_pipeline",
  • "name": "ExamplePipeline",
  • "org": "example_org",
  • "project": "example_project",
  • "description": "Pipeline Description",
  • "tags": {
    },
  • "modules": [
    ],
  • "git_details": {
    },
  • "valid": true,
  • "yaml_error_wrapper": {
    },
  • "cache_response_metadata": {
    },
  • "created": 1234567890,
  • "updated": 1234567890
}

Update a Pipeline

Updates a Pipeline.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema:
required

Pipeline request body

pipeline_yaml
required
string

Pipeline YAML (to be passed as a String).

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Pipeline identifier

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

Pipeline name

description
string <= 1024 characters

Pipeline description

object <= 128 properties

Pipeline tags

object (Update Git Details)

Contains parameters related to updating an Entity for Git Experience.

Responses
200

Pipeline response body

put/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}
Request samples
{
  • "pipeline_yaml": "pipeline:\n identifier: example_pipeline\n name: ExamplePipeline\n allowStageExecutions: false\n stages:\n - stage:\n name: Example Build Stage\n identifier: example_build_stage\n description: ''\n type: Approval\n spec:\n execution:\n steps:\n - step:\n name: Approval Step\n identifier: Approval_Step\n type: HarnessApproval\n timeout: 1d\n spec:\n approvalMessage: |-\n Please review the following information\n and approve the pipeline progression\n includePipelineExecutionHistory: true\n approvers:\n minimumCount: 1\n disallowPipelineExecutor: false\n userGroups: <+input>\n approverInputs: []\n - step:\n type: ShellScript\n name: ShellScript Step\n identifier: ShellScript_Step\n spec:\n shell: Bash\n onDelegate: true\n source:\n type: Inline\n spec:\n script: <+input>\n environmentVariables: []\n outputVariables: []\n executionTarget: {}\n timeout: 10m\n tags: {}\n - stage:\n name: Example Deploy Stage\n identifier: example_deploy_stage\n description: ''\n type: Deployment\n spec:\n serviceConfig:\n serviceRef: <+input>\n serviceDefinition:\n spec:\n variables: []\n type: Kubernetes\n infrastructure:\n environmentRef: <+input>\n infrastructureDefinition:\n type: KubernetesDirect\n spec:\n connectorRef: <+input>\n namespace: <+input>\n releaseName: release-<+INFRA_KEY>\n allowSimultaneousDeployments: false\n execution:\n steps:\n - step:\n name: Rollout Deployment\n identifier: rolloutDeployment\n type: K8sRollingDeploy\n timeout: 10m\n spec:\n skipDryRun: false\n rollbackSteps:\n - step:\n name: Rollback Rollout Deployment\n identifier: rollbackRolloutDeployment\n type: K8sRollingRollback\n timeout: 10m\n spec: {}\n tags: {}\n failureStrategies:\n - onFailure:\n errors:\n - AllErrors\n action:\n type: StageRollback\n",
  • "identifier": "example_pipeline",
  • "name": "ExamplePipeline",
  • "description": "Pipeline Description",
  • "tags": {
    },
  • "git_details": {
    }
}
Response samples
{
  • "identifier": "example_pipeline"
}

Delete a Pipeline

Deletes a Pipeline.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

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}/pipelines/{pipeline}
Request samples
Response samples
{ }

Patch API for pipeline

Patch API for pipeline

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json
pipeline_yaml
string

Pipeline YAML (to be passed as a String).

name
string

Pipeline Name.

desc
string

Pipeline Description.

object <= 128 properties

Pipeline Tags.

object (Update Git Details)

Contains parameters related to updating an Entity for Git Experience.

version
string

Version of pipeline yaml, should be one of "0" or "1"

Responses
200

Pipeline response body

patch/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}
Request samples
application/json
{
  • "pipeline_yaml": "string",
  • "name": "string",
  • "desc": "string",
  • "tags": {
    },
  • "git_details": {
    },
  • "version": "string"
}
Response samples
{
  • "identifier": "example_pipeline"
}

Move Pipeline YAML from inline to remote

Creates a remote entity by fetching pipeline YAML from Harness.

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

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

Parameters related to moving an entity for Git Experience.

pipeline_identifier
string
move_config_operation_type
string (MoveConfigOperationType)

Operation type to move the configuration

Value: "INLINE_TO_REMOTE"
Responses
200

Response body for moving a pipeline configuration.

post/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}/move-config
Request samples
application/json
{
  • "git_details": {
    },
  • "pipeline_identifier": "string",
  • "move_config_operation_type": "INLINE_TO_REMOTE"
}
Response samples
application/json
{
  • "pipeline_identifier": "string"
}

Get Pipeline YAML from Git Repository

Fetches Pipeline YAML from Git Repository and saves a record for it in Harness

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json

Pipeline import request body

object (Import Git Information)

Parameters related to importing an entity for Git.

object (Pipeline Import Request DTO)

Information of Pipeline import request DTO

Responses
200

Response body for pipeline save.

post/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}/import
Request samples
application/json
{
  • "git_import_info": {
    },
  • "pipeline_import_request": {
    }
}
Response samples
application/json
{
  • "identifier": "string",
  • "governance_metadata": [
    ]
}

Update GitMetadata for Remote Pipelines

Update git-metadata in remote pipeline

Securityx-api-key
Request
path Parameters
org
required
string

Organization identifier

project
required
string

Project identifier

pipeline
required
string

Pipeline identifier

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to.

Request Body schema: application/json
connector_ref
string

Harness connector id used for entity CRUD operations

repo_name
string

Name of the repository.

file_path
string

File path of the entity in the repository.

Responses
200

Example response

put/v1/orgs/{org}/projects/{project}/pipelines/{pipeline}/git-metadata
Request samples
application/json
{
  • "connector_ref": "string",
  • "repo_name": "string",
  • "file_path": "string"
}
Response samples
application/json
{
  • "entity_identifier": "string"
}