Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Environments

This contains APIs related to Environments

Check for allowed-values in the Environments

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2/check-allowed-values
POST /gateway/ng/api/environmentsV2/check-allowed-values?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets Environment list for a project

get
Query parameters
pageinteger · int32Optional

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

Default: 0
sizeinteger · int32Optional

Results per page

Default: 100
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

searchTermstringOptional

The word to be searched and included in the list response

envIdentifiersstring[]Optional

List of EnvironmentIds

sortstring[]Optional

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/environmentsV2
GET /gateway/ng/api/environmentsV2?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create an Environment

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This is the Environment entity defined in Harness

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

identifierstringOptional

Identifier of the Environment.

namestringOptional

Name of the Environment.

descriptionstringOptional

Description of the entity

colorstringOptional

Color of the Environment.

typestring · enumRequired

Specify the environment type whether production or Preproduction.

Possible values:
yamlstringOptional

Yaml of this entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2
POST /gateway/ng/api/environmentsV2?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 200

{
  "orgIdentifier": "text",
  "projectIdentifier": "text",
  "identifier": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "name": "text",
  "description": "text",
  "color": "text",
  "type": "PreProduction",
  "yaml": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update an Environment by identifier

put
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Header parameters
If-MatchstringOptional
Body

This is the Environment entity defined in Harness

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

identifierstringOptional

Identifier of the Environment.

namestringOptional

Name of the Environment.

descriptionstringOptional

Description of the entity

colorstringOptional

Color of the Environment.

typestring · enumRequired

Specify the environment type whether production or Preproduction.

Possible values:
yamlstringOptional

Yaml of this entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/environmentsV2
PUT /gateway/ng/api/environmentsV2?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 200

{
  "orgIdentifier": "text",
  "projectIdentifier": "text",
  "identifier": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "name": "text",
  "description": "text",
  "color": "text",
  "type": "PreProduction",
  "yaml": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create Environments in batch with partial success support

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Bodyobject · EnvironmentRequest[]

This is the Environment entity defined in Harness

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

identifierstringOptional

Identifier of the Environment.

namestringOptional

Name of the Environment.

descriptionstringOptional

Description of the entity

colorstringOptional

Color of the Environment.

typestring · enumRequired

Specify the environment type whether production or Preproduction.

Possible values:
yamlstringOptional

Yaml of this entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2/batch
POST /gateway/ng/api/environmentsV2/batch?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 202

[
  {
    "orgIdentifier": "text",
    "projectIdentifier": "text",
    "identifier": "text",
    "tags": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "name": "text",
    "description": "text",
    "color": "text",
    "type": "PreProduction",
    "yaml": "text"
  }
]
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets an Environment by identifier

get
Path parameters
environmentIdentifierstringRequired

Environment Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

deletedbooleanOptional

Specify whether Environment is deleted or not

Default: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/environmentsV2/{environmentIdentifier}
GET /gateway/ng/api/environmentsV2/{environmentIdentifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete an Environment by identifier

delete
Path parameters
environmentIdentifierstringRequired

Environment Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

forceDeletebooleanOptional

If true, the Entity will be forced delete, without checking any references/usages

Default: false
Header parameters
If-MatchstringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/environmentsV2/{environmentIdentifier}
DELETE /gateway/ng/api/environmentsV2/{environmentIdentifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets Service Overrides list

get
Query parameters
pageinteger · int32Optional

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

Default: 0
sizeinteger · int32Optional

Results per page

Default: 500
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

Environment Identifier for the Entity.

serviceIdentifierstringOptional

Service Identifier for the Entity.

sortstring[]Optional

Specifies the sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/environmentsV2/serviceOverrides
GET /gateway/ng/api/environmentsV2/serviceOverrides?accountIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

upsert a Service Override for an Environment

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This is the Service Override Request entity defined in Harness

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringOptional

Environment Identifier for the Entity.

serviceIdentifierstringOptional

Service Identifier for the Entity.

yamlstringOptional

Yaml for the Service Override entity

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2/serviceOverrides
POST /gateway/ng/api/environmentsV2/serviceOverrides?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "orgIdentifier": "text",
  "projectIdentifier": "text",
  "environmentIdentifier": "text",
  "serviceIdentifier": "text",
  "yaml": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete a ServiceOverride entity

delete
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringOptional

Environment Identifier for the Entity.

serviceIdentifierstringOptional

Service Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/environmentsV2/serviceOverrides
DELETE /gateway/ng/api/environmentsV2/serviceOverrides?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Import and Create Environment from Git Repository

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringOptional

Environment Identifier for the entity

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

repoNamestringRequired

Name of the repository.

branchstringRequired

Name of the branch.

filePathstringRequired

File Path of the Entity.

isForceImportbooleanOptional

isForceImport

Default: false
isHarnessCodeRepobooleanOptional

Is Harness code repo enabled

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2/import
POST /gateway/ng/api/environmentsV2/import?accountIdentifier=text&repoName=text&branch=text&filePath=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets Environment Access list

get
Query parameters
pageinteger · int32Optional

page

Default: 0
sizeinteger · int32Optional

size

Default: 100
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

searchTermstringOptional

The word to be searched and included in the list response

envIdentifiersstring[]Optional

List of EnvironmentIds

envGroupIdentifierstringOptional

Environment group identifier

typestring · enumOptional

Environment type for the entity

Possible values:
sortstring[]Optional

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/environmentsV2/list/access
GET /gateway/ng/api/environmentsV2/list/access?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Move environment YAML from inline to remote

post
Path parameters
environmentIdentifierstringRequired

Environment Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

repoNamestringOptional

Name of the repository.

branchstringOptional

Name of the branch.

filePathstringOptional

File Path of the Entity.

commitMsgstringOptional

Commit Message to use for the merge commit.

isNewBranchbooleanOptional

Checks the new branch

Default: false
baseBranchstringOptional

Name of the default branch.

isHarnessCodeRepobooleanOptional

Is Harness code repo enabled

Default: false
moveConfigTypestring · enumRequired

Tells weather the entity has to be moved from inline to remote or remote to inline

Possible values:
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/environmentsV2/move-config/{environmentIdentifier}
POST /gateway/ng/api/environmentsV2/move-config/{environmentIdentifier}?accountIdentifier=text&moveConfigType=INLINE_TO_REMOTE HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update git-metadata in remote environment Entity

put

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

Path parameters
environmentIdentifierstringRequired

Environment Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

repoNamestringOptional

Name of the repository.

filePathstringOptional

File Path of the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/environmentsV2/{environmentIdentifier}/update-git-metadata
PUT /gateway/ng/api/environmentsV2/{environmentIdentifier}/update-git-metadata?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Upsert an Environment by identifier

put
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Header parameters
If-MatchstringOptional
Body

This is the Environment entity defined in Harness

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

identifierstringOptional

Identifier of the Environment.

namestringOptional

Name of the Environment.

descriptionstringOptional

Description of the entity

colorstringOptional

Color of the Environment.

typestring · enumRequired

Specify the environment type whether production or Preproduction.

Possible values:
yamlstringOptional

Yaml of this entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/environmentsV2/upsert
PUT /gateway/ng/api/environmentsV2/upsert?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 200

{
  "orgIdentifier": "text",
  "projectIdentifier": "text",
  "identifier": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "name": "text",
  "description": "text",
  "color": "text",
  "type": "PreProduction",
  "yaml": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?