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

Infrastructures

This contains APIs related to Infrastructure Definitions

Gets Infrastructure list

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.

environmentIdentifierstringRequired

Environment Identifier for the Entity.

searchTermstringOptional

The word to be searched and included in the list response

infraIdentifiersstring[]Optional

List of InfrastructureIds

deploymentTypestring · enumOptionalPossible values:
deploymentTemplateIdentifierstringOptional

The Identifier of deployment template if infrastructure is of type custom deployment

versionLabelstringOptional

The version label of deployment template if infrastructure is of type custom deployment

sortstring[]Optional

Specifies the sorting criteria of the list. Elements in the list should be of the format "property,order" or "property". Order can take values ASC or DESC for alphabetical ascending and descending orders respectively. If the order is not specified, it takes ASC by default

serviceRefsstring[]Optional

list of service refs required to fetch infrastructures scoped to these service refs

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/infrastructures
GET /gateway/ng/api/infrastructures?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"
    }
  ]
}

Create an Infrastructure in an Environment

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This is the InfrastructureRequest entity defined in Harness

identifierstringOptionalDeprecated

identifier of the infrastructure

orgIdentifierstringOptionalDeprecated

organisation identifier of the infrastructure

projectIdentifierstringOptionalDeprecated

project identifier of the infrastructure

environmentRefstringOptionalDeprecated

environment reference of the infrastructure

namestringOptionalDeprecated

name of the infrastructure

descriptionstringOptionalDeprecated

description of the infrastructure

typestring · enumOptionalDeprecated

type of the infrastructure

Possible values:
yamlstring · min: 1Required

yaml spec of the infrastructure. Just yaml alone is sufficient to create an infrastructure.

serviceDiscoveryEnabledbooleanOptional

Enable Service Discovery for this infrastructure definition. Only supported for Kubernetes infrastructure types with static connectorRef and namespace.

serviceAccountNamestringOptional

ServiceAccount name for the Service Discovery agent creation Optional — null/empty means defalut service discovery path

Responses
400

Bad Request

This is Failure entity as defied in Harness

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

{
  "name": "infrastructure",
  "identifier": "infrastructureId",
  "description": "infrastructure description",
  "tags": {},
  "orgIdentifier": "default",
  "projectIdentifier": "projectIdentifier",
  "environmentRef": "environmentId",
  "deploymentType": "Kubernetes",
  "type": "KubernetesDirect",
  "yaml": "infrastructureDefinition:\n  name: infrastructure\n  identifier: infrastructure\n  description: infrastructure description\n  tags: {}\n  orgIdentifier: default\n  projectIdentifier: projectIdentifier\n  environmentRef: environmentId\n  deploymentType: Kubernetes\n  type: KubernetesDirect\n  spec:\n    connectorRef: connectorId\n    namespace: namespace\n    releaseName: release-<+INFRA_KEY>\n  allowSimultaneousDeployments: false\n"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update an Infrastructure by identifier

put
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This is the InfrastructureRequest entity defined in Harness

identifierstringOptionalDeprecated

identifier of the infrastructure

orgIdentifierstringOptionalDeprecated

organisation identifier of the infrastructure

projectIdentifierstringOptionalDeprecated

project identifier of the infrastructure

environmentRefstringOptionalDeprecated

environment reference of the infrastructure

namestringOptionalDeprecated

name of the infrastructure

descriptionstringOptionalDeprecated

description of the infrastructure

typestring · enumOptionalDeprecated

type of the infrastructure

Possible values:
yamlstring · min: 1Required

yaml spec of the infrastructure. Just yaml alone is sufficient to create an infrastructure.

serviceDiscoveryEnabledbooleanOptional

Enable Service Discovery for this infrastructure definition. Only supported for Kubernetes infrastructure types with static connectorRef and namespace.

serviceAccountNamestringOptional

ServiceAccount name for the Service Discovery agent creation Optional — null/empty means defalut service discovery path

Responses
400

Bad Request

This is Failure entity as defied in Harness

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

{
  "name": "infrastructure",
  "identifier": "infrastructureId",
  "description": "infrastructure description",
  "tags": {},
  "orgIdentifier": "default",
  "projectIdentifier": "projectIdentifier",
  "environmentRef": "environmentId",
  "deploymentType": "Kubernetes",
  "type": "KubernetesDirect",
  "yaml": "infrastructureDefinition:\n  name: infrastructure\n  identifier: infrastructure\n  description: infrastructure description\n  tags: {}\n  orgIdentifier: default\n  projectIdentifier: projectIdentifier\n  environmentRef: environmentId\n  deploymentType: Kubernetes\n  type: KubernetesDirect\n  spec:\n    connectorRef: connectorId\n    namespace: namespace\n    releaseName: release-<+INFRA_KEY>\n  allowSimultaneousDeployments: false\n"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets an Infrastructure by identifier

get
Path parameters
infraIdentifierstringRequired

Infrastructure Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

envId

deletedbooleanOptional

Specify whether Infrastructure 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/infrastructures/{infraIdentifier}
GET /gateway/ng/api/infrastructures/{infraIdentifier}?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"
    }
  ]
}

Delete an Infrastructure by identifier

delete
Path parameters
infraIdentifierstringRequired

Infrastructure Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

Environment Identifier for the Entity.

forceDeletebooleanOptional

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

Default: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/infrastructures/{infraIdentifier}
DELETE /gateway/ng/api/infrastructures/{infraIdentifier}?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"
    }
  ]
}

Import and Create Infrastructure from Git Repository

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

Environment Identifier for the entity

infraIdentifierstringOptional

Infrastructure 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/infrastructures/import
POST /gateway/ng/api/infrastructures/import?accountIdentifier=text&environmentIdentifier=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"
    }
  ]
}

Move infra YAML from inline to remote

post
Path parameters
infraIdentifierstringRequired

Infrastructure Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

envId

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/infrastructures/move-config/{infraIdentifier}
POST /gateway/ng/api/infrastructures/move-config/{infraIdentifier}?accountIdentifier=text&environmentIdentifier=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 infrastructure Entity

put

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

Path parameters
infraIdentifierstringRequired

Infrastructure Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

environmentIdentifierstringRequired

envId

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/infrastructures/{infraIdentifier}/update-git-metadata
PUT /gateway/ng/api/infrastructures/{infraIdentifier}/update-git-metadata?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"
    }
  ]
}

Last updated

Was this helpful?