import requests
url = "https://platform.ankra.app/api/v1/org/host-targets/{host_target_id}"
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/{host_target_id}', 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/{host_target_id} \
--header 'Authorization: Bearer <token>'{
"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"
}Get a host target
One host target with its derived status and what the host last reported about itself. Requires pipelines.read.
import requests
url = "https://platform.ankra.app/api/v1/org/host-targets/{host_target_id}"
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/{host_target_id}', 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/{host_target_id} \
--header 'Authorization: Bearer <token>'{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
The host target.
A host outside Kubernetes registered to receive deployments. The members a host reports about itself are null until it first reports them.
The name of the environment the host is registered into.
^[a-z0-9][a-z0-9-]{0,62}$Show child attributes
Show child attributes
Derived on read from the last heartbeat: online within 90 seconds of it, offline after, and unknown for a host that never checked in. A revoked host that has checked in reads offline.
online, offline, unknown The host owner's release allow-list as the host last reported it; null until it reports.
The releases the host last reported as running; null until it reports.
Show child attributes
Show child attributes