List host targets
import requests
url = "https://platform.ankra.app/api/v1/org/host-targets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/host-targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/host-targets \
--header 'Authorization: Bearer <token>'{
"host_targets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"environment": "<string>",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"labels": {},
"status": "online",
"agent_version": "<string>",
"hostname": "<string>",
"os": "<string>",
"arch": "<string>",
"supported_job_types": [
"<string>"
],
"policy": {},
"running": [
{
"release": "<string>",
"digest": "<string>",
"activated_at": "2023-11-07T05:31:56Z"
}
],
"last_heartbeat_at": "2023-11-07T05:31:56Z",
"registered_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}Deploy Targets
List host targets
The organisation’s host targets, active ones first and revoked ones after, optionally narrowed to one environment. Requires pipelines.read.
GET
/
api
/
v1
/
org
/
host-targets
List host targets
import requests
url = "https://platform.ankra.app/api/v1/org/host-targets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/host-targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/api/v1/org/host-targets \
--header 'Authorization: Bearer <token>'{
"host_targets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"environment": "<string>",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"labels": {},
"status": "online",
"agent_version": "<string>",
"hostname": "<string>",
"os": "<string>",
"arch": "<string>",
"supported_job_types": [
"<string>"
],
"policy": {},
"running": [
{
"release": "<string>",
"digest": "<string>",
"activated_at": "2023-11-07T05:31:56Z"
}
],
"last_heartbeat_at": "2023-11-07T05:31:56Z",
"registered_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Only host targets registered into this environment.
Pattern:
^[a-z0-9][a-z0-9-]{0,62}$