Test Targets
Access and modify Scan Targets
List a collection of Test Targets
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Page number to fetch (starting from 0)
0Example: 4Number of results per page
30Example: 50Resource name
NodeGoatHarness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness personal or service access token
Explicabo tenetur libero.OK response.
BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/targets?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"pagination": {
"link": "",
"page": 4,
"pageSize": 20,
"totalItems": 230,
"totalPages": 12
},
"results": [
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
},
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
},
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
}
]
}Create a new Test Target
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness personal or service access token
Nostrum cupiditate dolorem quod sit molestiae.RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Directory within the Test Target to be scanned
app/srcName of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoOK response.
Resource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
POST /gateway/sto/api/v2/targets?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 175
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"directory": "app/src",
"name": "NodeGoat",
"type": "repository",
"url": "https://github.com/example/repo"
}{
"id": "abcdef1234567890ghijkl"
}Find Test Target by ID
The ID of the Test Target to retrieve
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness personal or service access token
Optio deleniti sed est eos.OK response.
RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Unix timestamp at which the resource was created
1651578240Directory within the Test Target to be scanned
app/srcResource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Unix timestamp at which the resource was most recently modified
1651578240Name of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoBadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/targets/{id}?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
}Update an existing Test Target
The ID of the Test Target to update
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness personal or service access token
Sint sed voluptas aliquam saepe possimus.RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Directory within the Test Target to be scanned
app/srcName of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoOK response.
RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Unix timestamp at which the resource was created
1651578240Directory within the Test Target to be scanned
app/srcResource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Unix timestamp at which the resource was most recently modified
1651578240Name of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoBadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
PUT /gateway/sto/api/v2/targets/{id}?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 175
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"directory": "app/src",
"name": "NodeGoat",
"type": "repository",
"url": "https://github.com/example/repo"
}{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
}Update only certain fields on an existing Test Target
The ID of the Test Target to update
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness personal or service access token
Rerum iusto accusantium id minima mollitia quibusdam.RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Directory within the Test Target to be scanned
app/srcName of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoOK response.
RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
release_.*ID of baseline Target Variant for Issue comparison
abcdef1234567890ghijklPattern: ^([a-zA-Z0-9_-]{22}|)$Unix timestamp at which the resource was created
1651578240Directory within the Test Target to be scanned
app/srcResource identifier
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Unix timestamp at which the resource was most recently modified
1651578240Name of the Test Target
NodeGoatPattern: ^[a-zA-Z0-9_.:/|()-]+$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Test Target's type
repositoryPossible values: URL used to access the Test Target
https://github.com/example/repoBadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
NotFound: Not Found response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
PATCH /gateway/sto/api/v2/targets/{id}?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 175
{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"directory": "app/src",
"name": "NodeGoat",
"type": "repository",
"url": "https://github.com/example/repo"
}{
"baselineRegEx": "release_.*",
"baselineVariantId": "abcdef1234567890ghijkl",
"created": 1651578240,
"directory": "app/src",
"id": "abcdef1234567890ghijkl",
"lastModified": 1651578240,
"name": "NodeGoat",
"orgId": "example_org",
"projectId": "example_project",
"type": "repository",
"url": "https://github.com/example/repo"
}Last updated
Was this helpful?