Variables

This contains APIs related to Variables as defined in Harness.

Fetches the list of Variables.

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.

searchTerm
string

This would be used to filter Variables. Any Variable having the specified string in its Name or ID would be filtered.

includeVariablesFromEverySubScope
boolean
Default: false

Specify whether or not to include all the Variables accessible at the scope. For eg if set as true, at the Project scope we will get org and account Variable also in the response.

pageIndex
integer <int32>
Default: 0

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

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

Page Token of the next results to fetch.Default Value: ''

Responses
400

Bad Request

500

Internal server error

default

Returns the list of Variable.

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

Updates the Variable.

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema: application/json
required

Details of the variable to update.

object (VariableDTO)
Responses
400

Bad Request

500

Internal server error

default

Returns the updated Variable.

put/ng/api/variables
Request samples
application/json
{
  • "variable": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a Variable.

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema: application/json
required

Details of the Variable to create.

object (VariableDTO)
Responses
400

Bad Request

500

Internal server error

default

Returns the created Variable.

post/ng/api/variables
Request samples
application/json
{
  • "variable": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get the Variable by scope identifiers and variable identifier.

Securityx-api-key
Request
path Parameters
identifier
required
string

Variable ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the variable with the requested scope identifiers and variable identifier.

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

Deletes Variable by ID.

Securityx-api-key
Request
path Parameters
identifier
required
string

Variable ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

It returns true if the Variable is deleted successfully and false if the Variable is not deleted.

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

Get list of Variable by scope identifiers and variable identifiers.

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.

searchTerm
string

This would be used to filter Variables. Any Variable having the specified string in its Name or ID would be filtered.

includeVariablesFromEverySubScope
boolean
Default: false

Specify whether or not to include all the Variables accessible at the scope. For eg if set as true, at the Project scope we will get org and account Variable also in the response.

pageIndex
integer <int32>
Default: 0

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

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

Page Token of the next results to fetch.Default Value: ''

Request Body schema: application/json

Specifies the variables to list

identifiers
Array of strings
Responses
400

Bad Request

500

Internal server error

default

Returns the variable with the requested scope identifiers and variable identifier.

post/ng/api/variables/list
Request samples
application/json
{
  • "identifiers": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}