Pipeline

This contains pipeline APIs for files as provided as runtime input during pipeline execution

Download file from GCS using filePath

Download file from GCS using filePath

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

filePath
required
string

filePath

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Download file from GCS using filePath

get/pipeline/api/input-file/download-file
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Returns a file uploaded or filtered based on the fileIdentifier provided for a given nodeExecutionId

Returns a file uploaded or filtered based on the fileIdentifier provided for a given nodeExecutionId

Securityx-api-key
Request
path Parameters
planExecutionId
required
string

The Pipeline Execution Id

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

nodeExecutionId
required
string

Step execution Id of upload step

fileName
required
string
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns a file uploaded or filtered based on the fileIdentifier provided for a given planExecutionId

get/pipeline/api/input-file/file/{planExecutionId}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create a PipelineDeprecated

Creates a Pipeline

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

File Path of the Entity.

isNewBranch
boolean
Default: false

Checks the new branch

baseBranch
string

Name of the default branch.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

storeType
string

Tells whether the Entity is to be saved on Git or not

Enum: "INLINE" "REMOTE"
repoName
string

Name of the repository.

isHarnessCodeRepo
boolean

Is Harness code repo enabled

Request Body schema:
required

Pipeline YAML

string
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns created pipeline

post/pipeline/api/pipelines
Request samples
"string"
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create a Pipeline

Creates a Pipeline

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

File Path of the Entity.

isNewBranch
boolean
Default: false

Checks the new branch

baseBranch
string

Name of the default branch.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

storeType
string

Tells whether the Entity is to be saved on Git or not

Enum: "INLINE" "REMOTE"
repoName
string

Name of the repository.

isHarnessCodeRepo
boolean

Is Harness code repo enabled

public
boolean
Default: false
Request Body schema: application/yaml
required

Pipeline YAML

string
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns created pipeline with metadata

post/pipeline/api/pipelines/v2
Request samples
application/yaml

Sample Pipeline YAML with One Build Stage and One Deploy Stage

pipeline:
    name: Sample Pipeline
    identifier: Sample_Pipeline
    allowStageExecutions: false
    projectIdentifier: Temp
    orgIdentifier: default
    tags: {}
    stages:
        - stage:
              name: Sample Stage
              identifier: Sample_Stage
              description: ""
              type: Approval
              spec:
                  execution:
                      steps:
                          - step:
                                name: Approval Step
                                identifier: Approval_Step
                                type: HarnessApproval
                                timeout: 1d
                                spec:
                                    approvalMessage: |-
                                        Please review the following information
                                        and approve the pipeline progression
                                    includePipelineExecutionHistory: true
                                    approvers:
                                        minimumCount: 1
                                        disallowPipelineExecutor: false
                                        userGroups: <+input>
                                    approverInputs: []
                          - step:
                                type: ShellScript
                                name: ShellScript Step
                                identifier: ShellScript_Step
                                spec:
                                    shell: Bash
                                    onDelegate: true
                                    source:
                                        type: Inline
                                        spec:
                                            script: <+input>
                                    environmentVariables: []
                                    outputVariables: []
                                    executionTarget: {}
                                timeout: 10m
              tags: {}
        - stage:
              name: Sample Deploy Stage
              identifier: Sample_Deploy_Stage
              description: ""
              type: Deployment
              spec:
                  serviceConfig:
                      serviceRef: <+input>
                      serviceDefinition:
                          spec:
                              variables: []
                          type: Kubernetes
                  infrastructure:
                      environmentRef: <+input>
                      infrastructureDefinition:
                          type: KubernetesDirect
                          spec:
                              connectorRef: <+input>
                              namespace: <+input>
                              releaseName: release-<+INFRA_KEY>
                      allowSimultaneousDeployments: false
                  execution:
                      steps:
                          - step:
                                name: Rollout Deployment
                                identifier: rolloutDeployment
                                type: K8sRollingDeploy
                                timeout: 10m
                                spec:
                                    skipDryRun: false
                      rollbackSteps:
                          - step:
                                name: Rollback Rollout Deployment
                                identifier: rollbackRolloutDeployment
                                type: K8sRollingRollback
                                timeout: 10m
                                spec: {}
              tags: {}
              failureStrategies:
                  - onFailure:
                        errors:
                            - AllErrors
                        action:
                            type: StageRollback
Response samples
No sample

Fetch a Pipeline

Returns a Pipeline by Identifier

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepo
boolean

if true, return all the default entities

getTemplatesResolvedPipeline
boolean
Default: false

This is a boolean value. If true, returns Templates resolved Pipeline YAML in the response else returns null.

loadFromFallbackBranch
boolean
Default: false
validateAsync
boolean
Default: false
header Parameters
Load-From-Cache
string
Default: false
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns pipeline YAML

get/pipeline/api/pipelines/{pipelineIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update a PipelineDeprecated

Updates a Pipeline by Identifier

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

Commit Message to use for the merge commit.

lastObjectId
string

Its required field during update call request. It can be fetched from the response of GET API call for the entity

resolvedConflictCommitId
string

If the entity is git-synced, this parameter represents the commit id against which file conflicts are resolved

baseBranch
string

Name of the default branch.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

lastCommitId
string

last commit id of the file

isNewBranch
boolean
Default: false

Checks the new branch

isHarnessCodeRepo
boolean

Is Harness code repo enabled

header Parameters
If-Match
string

Version of Entity to match

Request Body schema:
required

Pipeline YAML to be updated

string
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns updated pipeline

put/pipeline/api/pipelines/{pipelineIdentifier}
Request samples
"string"
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete a Pipeline

Deletes a Pipeline by Identifier

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

Commit Message to use for the merge commit.

lastObjectId
string

Last Object Id

header Parameters
If-Match
string

Version of Entity to match

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Boolean status whether request was successful or not

delete/pipeline/api/pipelines/{pipelineIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

List Pipelines

Returns List of Pipelines in the Given Project

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

page
integer <int32>
Default: 0

Page Index of the results to fetch.Default Value: 0

size
integer <int32>
Default: 25

Results per page

sort
Array of strings

Sort criteria for the elements.

searchTerm
string

Search term to filter out pipelines based on pipeline name, identifier, tags.

module
string
filterIdentifier
string
branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepo
boolean

if true, return all the default entities

getDistinctFromBranches
boolean

Boolean flag to get distinct pipelines from all branches.

Request Body schema: application/json

This is the body for the filter properties for listing pipelines.

object

Filter tags as a key-value pair.

filterType
required
string

This specifies the corresponding Entity of the filter.

Enum: "Connector" "Secret" "DelegateProfile" "Delegate" "PipelineSetup" "PipelineExecution" "Deployment" "Audit" "Template" "Trigger" "EnvironmentGroup" "FileStore" "CCMRecommendation" "Anomaly" "Environment" "RuleExecution" "Override" "InputSet" "Webhook"
Array of objects (NGTag)

This is the list of the Pipeline Tags on which the filter will be applied.

pipelineIdentifiers
Array of strings

This is the list of the Pipeline Identifiers on which the filter will be applied.

name
string

This is the Pipeline Name on which the filter will be applied.

description
string

This is the Pipeline Description on which the filter will be applied.

object

These are the Module Properties on which the filter will be applied.

repoName
string

This is the Pipeline repo filter on which the filter will be applied.

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Paginated list of pipelines.

post/pipeline/api/pipelines/list
Request samples
application/json

Sample List Pipeline JSON Payload

{
  • "filterType": "PipelineSetup"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Fetch Pipeline Summary

Returns Pipeline Summary by Identifier

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepo
boolean

if true, return all the default entities

loadFromFallbackBranch
boolean
Default: false
header Parameters
Load-From-Cache
string
Default: false
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns Pipeline Summary having pipelineIdentifier as specified in request

get/pipeline/api/pipelines/summary/{pipelineIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Import and Create Pipeline from Git Repository

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

repoName
required
string

Name of the repository.

branch
required
string

Name of the branch.

filePath
required
string

File Path of the Entity.

isForceImport
boolean
Default: false

isForceImport

isHarnessCodeRepo
boolean

Is Harness code repo enabled

Request Body schema:
pipelineName
string

Expected Name of the Pipeline to be imported

pipelineDescription
string

Expected Description of the Pipeline to be imported

version
string

YAML Version of the Pipeline

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Import and Create Pipeline from Git Repository and saves a record for it in Harness

post/pipeline/api/pipelines/import
Request samples
{
  • "pipelineName": "string",
  • "pipelineDescription": "string",
  • "version": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Import and Create Pipeline from Git RepositoryDeprecated

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

repoName
required
string

Name of the repository.

branch
required
string

Name of the branch.

filePath
required
string

File Path of the Entity.

isForceImport
boolean
Default: false

isForceImport

isHarnessCodeRepo
boolean

Is Harness code repo enabled

Request Body schema:
pipelineName
string

Expected Name of the Pipeline to be imported

pipelineDescription
string

Expected Description of the Pipeline to be imported

version
string

YAML Version of the Pipeline

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Import and Create Pipeline from Git Repository and saves a record for it in Harness

post/pipeline/api/pipelines/import/{pipelineIdentifier}
Request samples
{
  • "pipelineName": "string",
  • "pipelineDescription": "string",
  • "version": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update git-metadata in remote pipeline Entity

Update git-metadata in remote pipeline and returns the identifier of updated pipeline

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

repoName
string

Name of the repository.

filePath
string

File Path of the Entity.

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns identifier of updated pipeline

put/pipeline/api/pipelines/{pipelineIdentifier}/update-git-metadata
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update a Pipeline

Updates a Pipeline by Identifier

Securityx-api-key
Request
path Parameters
pipelineIdentifier
required
string

Pipeline Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

projectIdentifier
required
string

Project Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

Commit Message to use for the merge commit.

lastObjectId
string

Its required field during update call request. It can be fetched from the response of GET API call for the entity

resolvedConflictCommitId
string

If the entity is git-synced, this parameter represents the commit id against which file conflicts are resolved

baseBranch
string

Name of the default branch.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

lastCommitId
string

last commit id of the file

isNewBranch
boolean
Default: false

Checks the new branch

isHarnessCodeRepo
boolean

Is Harness code repo enabled

public
boolean
Default: false
header Parameters
If-Match
string

Version of Entity to match

Request Body schema: application/yaml
required

Pipeline YAML to be updated

string
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns updated pipeline with metadata

put/pipeline/api/pipelines/v2/{pipelineIdentifier}
Request samples
application/yaml

Sample Pipeline YAML with One Build Stage and One Deploy Stage

pipeline:
    name: Sample Pipeline
    identifier: Sample_Pipeline
    allowStageExecutions: false
    projectIdentifier: Temp
    orgIdentifier: default
    tags: {}
    stages:
        - stage:
              name: Sample Stage
              identifier: Sample_Stage
              description: ""
              type: Approval
              spec:
                  execution:
                      steps:
                          - step:
                                name: Approval Step
                                identifier: Approval_Step
                                type: HarnessApproval
                                timeout: 1d
                                spec:
                                    approvalMessage: |-
                                        Please review the following information
                                        and approve the pipeline progression
                                    includePipelineExecutionHistory: true
                                    approvers:
                                        minimumCount: 1
                                        disallowPipelineExecutor: false
                                        userGroups: <+input>
                                    approverInputs: []
                          - step:
                                type: ShellScript
                                name: ShellScript Step
                                identifier: ShellScript_Step
                                spec:
                                    shell: Bash
                                    onDelegate: true
                                    source:
                                        type: Inline
                                        spec:
                                            script: <+input>
                                    environmentVariables: []
                                    outputVariables: []
                                    executionTarget: {}
                                timeout: 10m
              tags: {}
        - stage:
              name: Sample Deploy Stage
              identifier: Sample_Deploy_Stage
              description: ""
              type: Deployment
              spec:
                  serviceConfig:
                      serviceRef: <+input>
                      serviceDefinition:
                          spec:
                              variables: []
                          type: Kubernetes
                  infrastructure:
                      environmentRef: <+input>
                      infrastructureDefinition:
                          type: KubernetesDirect
                          spec:
                              connectorRef: <+input>
                              namespace: <+input>
                              releaseName: release-<+INFRA_KEY>
                      allowSimultaneousDeployments: false
                  execution:
                      steps:
                          - step:
                                name: Rollout Deployment
                                identifier: rolloutDeployment
                                type: K8sRollingDeploy
                                timeout: 10m
                                spec:
                                    skipDryRun: false
                      rollbackSteps:
                          - step:
                                name: Rollback Rollout Deployment
                                identifier: rollbackRolloutDeployment
                                type: K8sRollingRollback
                                timeout: 10m
                                spec: {}
              tags: {}
              failureStrategies:
                  - onFailure:
                        errors:
                            - AllErrors
                        action:
                            type: StageRollback
Response samples
No sample