Environments

This contains APIs related to Environments

Gets Environment list for a project

Securityx-api-key
Request
query Parameters
page
integer <int32>
Default: 0

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

size
integer <int32>
Default: 100

Results per page

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

searchTerm
string

The word to be searched and included in the list response

envIdentifiers
Array of strings

List of EnvironmentIds

sort
Array of strings

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

500

Internal Server Error

default

Returns the list of Environments for a Project

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

Update an Environment by identifier

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

header Parameters
If-Match
string
Request Body schema:

Details of the Environment to be updated

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

identifier
string

Identifier of the Environment.

object

Tags

name
string

Name of the Environment.

description
string

Description of the entity

color
string

Color of the Environment.

type
required
string

Specify the environment type whether production or Preproduction.

Enum: "PreProduction" "Production"
yaml
string

Yaml of this entity.

Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Environment

put/ng/api/environmentsV2
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "yaml": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create an Environment

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the Environment to be created

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

identifier
string

Identifier of the Environment.

object

Tags

name
string

Name of the Environment.

description
string

Description of the entity

color
string

Color of the Environment.

type
required
string

Specify the environment type whether production or Preproduction.

Enum: "PreProduction" "Production"
yaml
string

Yaml of this entity.

Responses
400

Bad Request

500

Internal Server Error

default

Returns the created Environment

post/ng/api/environmentsV2
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "yaml": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets an Environment by identifier

Securityx-api-key
Request
path Parameters
environmentIdentifier
required
string

Environment Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

deleted
boolean
Default: false

Specify whether Environment is deleted or not

Responses
400

Bad Request

500

Internal Server Error

default

The saved Environment

get/ng/api/environmentsV2/{environmentIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete an Environment by identifier

Securityx-api-key
Request
path Parameters
environmentIdentifier
required
string

Environment Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

forceDelete
boolean
Default: false

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

header Parameters
If-Match
string
Responses
400

Bad Request

500

Internal Server Error

default

Returns true if the Environment is deleted

delete/ng/api/environmentsV2/{environmentIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets Service Overrides list

Securityx-api-key
Request
query Parameters
page
integer <int32>
Default: 0

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

size
integer <int32>
Default: 500

Results per page

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

environmentIdentifier
required
string

Environment Identifier for the Entity.

serviceIdentifier
string

Service Identifier for the Entity.

sort
Array of strings

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

500

Internal Server Error

default

Returns the list of Service Overrides for an Environment.serviceIdentifier, if passed, can be used to get the overrides for that particular Service in the Environment

get/ng/api/environmentsV2/serviceOverrides
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

upsert a Service Override for an Environment

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the Service Override to be upserted

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

environmentIdentifier
string

Environment Identifier for the Entity.

serviceIdentifier
string

Service Identifier for the Entity.

yaml
string

Yaml for the Service Override entity

Responses
400

Bad Request

500

Internal Server Error

default

Upsert ( Create/Update ) a Service Override in an Environment.

post/ng/api/environmentsV2/serviceOverrides
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "environmentIdentifier": "string",
  • "serviceIdentifier": "string",
  • "yaml": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete a ServiceOverride entity

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

environmentIdentifier
string

Environment Identifier for the Entity.

serviceIdentifier
string

Service Identifier for the Entity.

Responses
400

Bad Request

500

Internal Server Error

default

Returns true if the Service Override is deleted

delete/ng/api/environmentsV2/serviceOverrides
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Import and Create Environment from Git Repository

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

environmentIdentifier
string

Environment 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

Responses
400

Bad Request

500

Internal Server Error

default

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

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

Gets Environment Access list

Securityx-api-key
Request
query Parameters
page
integer <int32>
Default: 0

page

size
integer <int32>
Default: 100

size

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

searchTerm
string

The word to be searched and included in the list response

envIdentifiers
Array of strings

List of EnvironmentIds

envGroupIdentifier
string

Environment group identifier

sort
Array of strings

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

500

Internal Server Error

default

Returns the list of Environments that are accessible

get/ng/api/environmentsV2/list/access
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Move environment YAML from inline to remote

Securityx-api-key
Request
path Parameters
environmentIdentifier
required
string

Environment Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
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.

branch
string

Name of the branch.

filePath
string

File Path of the Entity.

commitMsg
string

Commit Message to use for the merge commit.

isNewBranch
boolean
Default: false

Checks the new branch

baseBranch
string

Name of the default branch.

isHarnessCodeRepo
boolean
Default: false

Is Harness code repo enabled