Scm

Contains APIs related to Scm

Lists Branches by given Git Sync Config Id

Request
Security:
ApiKey (readwrite)
query Parameters
yamlGitConfigIdentifier
string

Git Sync Config Id

accountIdentifier
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

page
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

size
integer <int32>
Default: 50

The number of the elements to fetch

searchTerm
string
Default: ""

Search Term

Responses
400

Bad Request

500

Internal Server Error

default

This contains a list of Branches specific to Git Sync Config Id

get/ng/api/scm/listBranchesByGitConfig
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/scm/listBranchesByGitConfig?yamlGitConfigIdentifier=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&page=0&size=50&searchTerm=' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Lists Branches of given Repo by referenced Connector Identifier

Request
Security:
ApiKey (readwrite)
query Parameters
connectorIdentifierRef
string

Connector Identifier Reference

accountIdentifier
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

repoURL
string

Repo Url

page
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

size
integer <int32>
Default: 50

The number of the elements to fetch

searchTerm
string
Default: ""

Search Term

Responses
400

Bad Request

500

Internal Server Error

default

This contains a list of Branches specific to Referenced Connector Id

get/ng/api/scm/listRepoBranches
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/scm/listRepoBranches?connectorIdentifierRef=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&repoURL=string&page=0&size=50&searchTerm=' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets Git File Content

Request
Security:
ApiKey (readwrite)
query Parameters
yamlGitConfigIdentifier
required
string

Git Sync Config Id

accountIdentifier
required
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

filePath
required
string

File Path

branch
string

Branch Name

commitId
string

Commit Id

Responses
400

Bad Request

500

Internal Server Error

default

Git File Content including: object Id and content

get/ng/api/scm/fileContent
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/scm/fileContent?yamlGitConfigIdentifier=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&filePath=string&branch=string&commitId=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Checks if Saas is possible for given Repo Url

Request
Security:
ApiKey (readwrite)
query Parameters
repoURL
string

Repo Url

Responses
400

Bad Request

500

Internal Server Error

default

True if Saas is possible for given Repo Url

post/ng/api/scm/isSaasGit
Request samples
curl -i -X POST \
  'https://app.harness.io/gateway/ng/api/scm/isSaasGit?repoURL=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

creates a Pull Request

Request
Security:
ApiKey (readwrite)
Request Body schema:

Details to create a PR

sourceBranch
required
string

Branch on which changes are done

targetBranch
required
string

Branch on which changes need to be merged

title
required
string

PR title

yamlGitConfigRef
required
string

Git Sync Config Id

accountIdentifier
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

useUserFromToken
boolean

Specifies which token to use. If True, the SCM token will be used, else the Git Connector token will be used

Responses
400

Bad Request

500

Internal Server Error

default

Successfully created a PR

post/ng/api/scm/createPR
Request samples
{
  • "sourceBranch": "string",
  • "targetBranch": "string",
  • "title": "string",
  • "yamlGitConfigRef": "string",
  • "accountIdentifier": "string",
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "useUserFromToken": true
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}