Infrastructures

This contains APIs related to Infrastructure Definitions

Gets Infrastructure 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: 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.

environmentIdentifier
required
string

Environment Identifier for the Entity.

searchTerm
string

The word to be searched and included in the list response

infraIdentifiers
Array of strings

List of InfrastructureIds

deploymentType
string
Enum: "Kubernetes" "NativeHelm" "Ssh" "WinRm" "ServerlessAwsLambda" "AzureWebApp" "AzureFunction" "CustomDeployment" "ECS" "Elastigroup" "TAS" "Asg" "GoogleCloudFunctions" "AwsLambda" "AWS_SAM" "SERVICE_YAML_V1_TYPE" "GoogleCloudRun"
deploymentTemplateIdentifier
string

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

versionLabel
string

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

sort
Array of strings

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

serviceRefs
Array of strings

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

Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Infrastructure for an Environment

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

Update an Infrastructure by identifier

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
required

Details of the Infrastructure to be updated

identifier
string
Deprecated

identifier of the infrastructure

orgIdentifier
string
Deprecated

organisation identifier of the infrastructure

projectIdentifier
string
Deprecated

project identifier of the infrastructure

environmentRef
string
Deprecated

environment reference of the infrastructure

name
string
Deprecated

name of the infrastructure

description
string
Deprecated

description of the infrastructure

object
Deprecated

tags associated with the infrastructure

type
string
Deprecated

type of the infrastructure

Enum: "KubernetesDirect" "KubernetesGcp" "KubernetesAzure" "Pdc" "SshWinRmAzure" "ServerlessAwsLambda" "AzureWebApp" "AzureFunction" "SshWinRmAws" "CustomDeployment" "ECS" "Elastigroup" "TAS" "Asg" "GoogleCloudFunctions" "AWS_SAM" "AwsLambda" "KubernetesAws" "KubernetesRancher" "GoogleCloudRun"
yaml
required
string

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

Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Infrastructure

put/ng/api/infrastructures
Request samples

Sample Infrastructure payload

{
  • "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"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create an Infrastructure in an Environment

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
required

Details of the Infrastructure to be created

identifier
string
Deprecated

identifier of the infrastructure

orgIdentifier
string
Deprecated

organisation identifier of the infrastructure

projectIdentifier
string
Deprecated

project identifier of the infrastructure

environmentRef
string
Deprecated

environment reference of the infrastructure

name
string
Deprecated

name of the infrastructure

description
string
Deprecated

description of the infrastructure

object
Deprecated

tags associated with the infrastructure

type
string
Deprecated

type of the infrastructure

Enum: "KubernetesDirect" "KubernetesGcp" "KubernetesAzure" "Pdc" "SshWinRmAzure" "ServerlessAwsLambda" "AzureWebApp" "AzureFunction" "SshWinRmAws" "CustomDeployment" "ECS" "Elastigroup" "TAS" "Asg" "GoogleCloudFunctions" "AWS_SAM" "AwsLambda" "KubernetesAws" "KubernetesRancher" "GoogleCloudRun"
yaml
required
string

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

Responses
400

Bad Request

500

Internal Server Error

default

Returns the created Infrastructure

post/ng/api/infrastructures
Request samples

Sample Infrastructure payload

{
  • "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"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets an Infrastructure by identifier

Securityx-api-key
Request
path Parameters
infraIdentifier
required
string

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

environmentIdentifier
required
string

envId

deleted
boolean
Default: false

Specify whether Infrastructure is deleted or not

Responses
400

Bad Request

500

Internal Server Error

default

The saved Infrastructure

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

Delete an Infrastructure by identifier

Securityx-api-key
Request
path Parameters
infraIdentifier
required
string

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

environmentIdentifier
required
string

Environment Identifier for the Entity.

forceDelete
boolean
Default: false

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

Responses
400

Bad Request

500

Internal Server Error

default

Returns true if the Infrastructure is deleted

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

Import and Create Infrastructure 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
required
string

Environment Identifier for the entity

infraIdentifier
string

Infrastructure 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 Infrastructure from Git Repository and saves a record for it in Harness

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

Move infra YAML from inline to remote

Securityx-api-key
Request
path Parameters
infraIdentifier
required
string

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

environmentIdentifier
required
string

envId

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

moveConfigType
required
string

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

Enum: "INLINE_TO_REMOTE" "REMOTE_TO_INLINE"
Responses
400

Bad Request

500

Internal Server Error

default

Move infra YAML from inline to remote

post/ng/api/infrastructures/move-config/{infraIdentifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update git-metadata in remote infrastructure Entity

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

Securityx-api-key
Request
path Parameters
infraIdentifier
required
string

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

environmentIdentifier
required
string

envId

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

500

Internal Server Error

default

Returns identifier of updated infrastructure

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