Clusters

This contains APIs related to Gitops Clusters

Get a Cluster linked to an environment by identifier

Securityx-api-key
Request
path Parameters
identifier
required
string

Cluster 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

environmentIdentifier

agentIdentifier
string

agentIdentifier

deleted
boolean
Default: false

Specify whether cluster is deleted or not

Responses
400

Bad Request

500

Internal Server Error

default

The saved Cluster

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

Unlink a cluster by identifier

Unlink a cluster from an environment by identifier

Securityx-api-key
Request
path Parameters
identifier
required
string

Cluster 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

environmentIdentifier

agentIdentifier
string

agentIdentifier

scope
string

Scope for the gitops cluster

Enum: "ACCOUNT" "ORGANIZATION" "PROJECT"
Responses
400

Bad Request

500

Internal Server Error

default

Returns true if the Cluster is deleted

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

Gets cluster 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 of the clusters

searchTerm
string

The word to be searched and included in the list response

identifiers
Array of strings

List of cluster identifiers

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

scope
string

Scope of linked clusters to be returned, ACCOUNT/ORGANIZATION/PROJECT. Returns all by default if this is not specified

Enum: "ACCOUNT" "ORGANIZATION" "PROJECT"
Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of cluster for a Project

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

Link a Cluster

Link a GitOps cluster to an environment by identifier

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the createCluster to be linked

identifier
string

identifier of the cluster

orgIdentifier
string

organization identifier of the cluster

agentIdentifier
string

agent identifier of the cluster

projectIdentifier
string

project identifier of the cluster

envRef
required
string

environment identifier of the cluster

scope
string

scope at which the cluster exists in harness gitops, project vs org vs account

Enum: "ACCOUNT" "ORGANIZATION" "PROJECT"
Responses
400

Bad Request

500

Internal Server Error

default

Returns the linked Cluster

post/ng/api/gitops/clusters
Request samples
{
  • "identifier": "string",
  • "orgIdentifier": "string",
  • "agentIdentifier": "string",
  • "projectIdentifier": "string",
  • "envRef": "string",
  • "scope": "ACCOUNT"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Link Clusters

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the createCluster to be created

orgIdentifier
string

organization identifier of the cluster

projectIdentifier
string

project identifier of the cluster

envRef
required
string

environment identifier of the cluster

linkAllClusters
boolean

link all clusters

unlinkAllClusters
boolean

unlink all clusters

searchTerm
string

search term if applicable. only valid if linking all clusters

Array of objects (ClusterBasicDTO)

list of cluster identifiers and names

Responses
400

Bad Request

500

Internal Server Error

default

Returns the linked Clusters

post/ng/api/gitops/clusters/batch
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "envRef": "string",
  • "linkAllClusters": true,
  • "unlinkAllClusters": true,
  • "searchTerm": "string",
  • "clusters": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Unlink Clusters

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the createCluster to be created

orgIdentifier
string

organization identifier of the cluster

projectIdentifier
string

project identifier of the cluster

envRef
required
string

environment identifier of the cluster

linkAllClusters
boolean

link all clusters

unlinkAllClusters
boolean

unlink all clusters

searchTerm
string

search term if applicable. only valid if linking all clusters

Array of objects (ClusterBasicDTO)

list of cluster identifiers and names

Responses
400

Bad Request

500

Internal Server Error

default

Returns true if all the Clusters are deleted

post/ng/api/gitops/clusters/batchunlink
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "envRef": "string",
  • "linkAllClusters": true,
  • "unlinkAllClusters": true,
  • "searchTerm": "string",
  • "clusters": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get a cluster managed by an agent by name

Get a cluster managed by agent using name

Securityx-api-key
Request
path Parameters
agentIdentifier
required
string

Agent identifier for entity.

query Parameters
accountIdentifier
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

name
string
fetchScopePrefixedIdentifier
boolean

Indicates whether the identifier of cluster fetched must contain harness scope prefix (account./org.)

Responses
200

A successful response.

default

An unexpected error response.

get/gitops/api/v1/agents/{agentIdentifier}/cluster_byname
Request samples
Response samples
application/json
{
  • "accountIdentifier": "string",
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "agentIdentifier": "string",
  • "identifier": "string",
  • "cluster": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "lastModifiedAt": "2019-08-24T14:15:22Z",
  • "stale": true,
  • "tags": {
    }
}

Get a cluster managed by an agent by URL

Get a cluster managed by agent using URL

Securityx-api-key
Request
path Parameters
agentIdentifier
required
string

Agent identifier for entity.

query Parameters
accountIdentifier
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

server
string
fetchScopePrefixedIdentifier
boolean

Indicates whether the identifier of cluster fetched must contain harness scope prefix (account./org.)

Responses
200

A successful response.

default

An unexpected error response.

get/gitops/api/v1/agents/{agentIdentifier}/cluster_byurl
Request samples
Response samples
application/json
{
  • "accountIdentifier": "string",
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "agentIdentifier": "string",
  • "identifier": "string",
  • "cluster": {
    },
  • "createdAt": "2019-08-24T14:15:22Z",
  • "lastModifiedAt": "2019-08-24T14:15:22Z",
  • "stale": true,
  • "tags": {
    }
}

List returns list of clusters

List clusters.

Securityx-api-key
Request
path Parameters
agentIdentifier
required
string

Agent identifier for entity.

query Parameters
accountIdentifier
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

identifier
string
query.server
string
query.name
string
query.id.type
string

type is the type of the specified cluster identifier ( "server" - default, "name" ).

query.id.value
string

value holds the cluster server URL or cluster name.

query.project
string
Responses
200

A successful response.

default

An unexpected error response.

get/gitops/api/v1/agents/{agentIdentifier}/clusters
Request samples
Response samples
application/json
{
  • "metadata": {
    },
  • "items": [
    ]
}

Create creates a cluster

Create cluster.

Security