Services

This contains APIs related to Services

Gets Service 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> <= 1000
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

serviceIdentifiers
Array of strings

List of ServicesIds

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

type
string
Enum: "Kubernetes" "NativeHelm" "Ssh" "WinRm" "ServerlessAwsLambda" "AzureWebApp" "AzureFunction" "CustomDeployment" "ECS" "Elastigroup" "TAS" "Asg" "GoogleCloudFunctions" "AwsLambda" "AWS_SAM" "SERVICE_YAML_V1_TYPE" "GoogleCloudRun"
gitOpsEnabled
boolean
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

includeAllServicesAccessibleAtScope
boolean
Default: false

Specify true if all accessible Services are to be included

Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Services for a Project

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

Update a Service by identifier

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

branch
string

Name of the branch.

repoIdentifier
string

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolder
string

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePath
string

File Path of the Entity.

commitMsg
string

Commit Message to use for the merge commit.

lastObjectId
string

Its required field during update call request. It can be fetched from the response of GET API call for the entity

resolvedConflictCommitId
string

If the entity is git-synced, this parameter represents the commit id against which file conflicts are resolved

baseBranch
string

Name of the default branch.

connectorRef
string

Identifier of Connector needed for CRUD operations on the respective Entity

lastCommitId
string

last commit id of the file

isNewBranch
boolean
Default: false

Checks the new branch

isHarnessCodeRepo
boolean

Is Harness code repo enabled

header Parameters
If-Match
string
Request Body schema:
required

Details of the Service to be updated

identifier
string

Identifier of the Service Request.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

name
string

Name of the Service Request.

description
string

Description of the entity

object

Tags

yaml
string

YAML for the Service Request

Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Service

put/ng/api/servicesV2
Request samples

Sample Service payload

{
  • "name": "serviceName",
  • "identifier": "serviceId",
  • "tags": { },
  • "projectIdentifier": "s",
  • "orgIdentifier": "default",
  • "yaml": "service:\n name: serviceName\n identifier: serviceId\n tags: {}\n serviceDefinition:\n spec:\n artifacts:\n primary:\n primaryArtifactRef: artifactName\n sources:\n - spec:\n connectorRef: connectorId\n imagePath: imagePath\n tag: tagId\n identifier: artifactName\n type: DockerRegistry\n type: Kubernetes\n"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create a Service

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
required

Details of the Service to be created

identifier
string

Identifier of the Service Request.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

name
string

Name of the Service Request.

description
string

Description of the entity

object

Tags

yaml
string

YAML for the Service Request

Responses
400

Bad Request

500

Internal Server Error

default

Returns the created Service

post/ng/api/servicesV2
Request samples

Sample Service payload

{
  • "name": "serviceName",
  • "identifier": "serviceId",
  • "tags": { },
  • "projectIdentifier": "s",
  • "orgIdentifier": "default",
  • "yaml": "service:\n name: serviceName\n identifier: serviceId\n tags: {}\n serviceDefinition:\n spec:\n artifacts:\n primary:\n primaryArtifactRef: artifactName\n sources:\n - spec:\n connectorRef: connectorId\n imagePath: imagePath\n tag: tagId\n identifier: artifactName\n type: DockerRegistry\n type: Kubernetes\n"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create Services

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:

Details of the Services to be created, maximum 1000 services can be created.

Array ([ 0 .. 1000 ] items)
identifier
string

Identifier of the Service Request.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

name
string

Name of the Service Request.

description
string

Description of the entity

object

Tags

yaml
string

YAML for the Service Request

Responses
400

Bad Request

500

Internal Server Error

default

Returns the created Services

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

Gets a Service by identifier

Securityx-api-key
Request
path Parameters
serviceIdentifier
required
string

Service 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 Service is deleted or not

Responses
400

Bad Request

500

Internal Server Error

default

The saved Service

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

Delete a Service by identifier

Securityx-api-key
Request
path Parameters
serviceIdentifier
required
string

Service 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 Service is deleted

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

Retrieving the list of Kubernetes Command Options

Securityx-api-key
Request
query Parameters
serviceSpecType
required
string
stepType
string
Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Kubernetes Command Options

get/ng/api/servicesV2/k8s/command-flags
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Retrieving the list of Kustomize Command Flags

Securityx-api-key
Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Kustomize Command Flags

get/ng/api/servicesV2/kustomize/command-flags
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Retrieving the list of actions available for service hooks

Securityx-api-key
Request
query Parameters
serviceSpecType
required
string
Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of actions available for service hooks

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

Get Service YAML 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.

serviceIdentifier
string

Service 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

Fetches Service YAML from Git Repository and saves a record for it in Harness

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

Gets Service Access 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.

searchTerm
string

The word to be searched and included in the list response

serviceIdentifiers
Array of strings [ 0 .. 1000 ] items

List of ServicesIds

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

type
string
Enum: "Kubernetes" "NativeHelm" "Ssh" "WinRm" "ServerlessAwsLambda" "AzureWebApp" "AzureFunction" "CustomDeployment" "ECS" "Elastigroup" "TAS" "Asg" "GoogleCloudFunctions" "AwsLambda" "AWS_SAM" "SERVICE_YAML_V1_TYPE" "GoogleCloudRun"
gitOpsEnabled
boolean
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

deploymentMetadataYaml
string
includeAllServicesAccessibleAtScope
boolean
Default: false

Specify true if all accessible Services are to be included

Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Services for a Project that are accessible

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

Move Service YAML from inline to remote

Securityx-api-key
Request
path Parameters
serviceIdentifier
required
string

Service 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

moveConfigType
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

Fetches Service YAML from Harness DB and creates a remote entity

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

Update git-metadata in remote service Entity

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

Securityx-api-key
Request
path Parameters
serviceIdentifier
required
string

Service Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
required
string

Organization Identifier for the Entity.

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

filePath
string

File Path of the Entity.

Responses
400

Bad Request

500

Internal Server Error

default

Returns identifier of updated Service

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

Upsert a Service by identifier

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

header Parameters
If-Match
string
Request Body schema:
required

Details of the Service to be upserted

identifier
string

Identifier of the Service Request.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

name
string

Name of the Service Request.

description
string

Description of the entity

object

Tags

yaml
string

YAML for the Service Request

Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Service

put/ng/api/servicesV2/upsert
Request samples

Sample Service payload

{
  • "name": "serviceName",
  • "identifier": "serviceId",
  • "tags": { },
  • "projectIdentifier": "s",
  • "orgIdentifier": "default",
  • "yaml": "service:\n name: serviceName\n identifier: serviceId\n tags: {}\n serviceDefinition:\n spec:\n artifacts:\n primary:\n primaryArtifactRef: artifactName\n sources:\n - spec:\n connectorRef: connectorId\n imagePath: imagePath\n tag: tagId\n identifier: artifactName\n type: DockerRegistry\n type: Kubernetes\n"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}