Push workload data from agent
POST
/k8s/agents/push
const url = 'https://shoehorn.example.com/api/v1/k8s/agents/push';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cluster_id":"example","workloads":[{"name":"example","namespace":"example","kind":"Deployment","labels":{"additionalProperty":"example"},"annotations":{"additionalProperty":"example"},"replicas":1,"ready_replicas":1,"images":["example"],"conditions":[{"type":"example","status":"example","reason":"example"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://shoehorn.example.com/api/v1/k8s/agents/push \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cluster_id": "example", "workloads": [ { "name": "example", "namespace": "example", "kind": "Deployment", "labels": { "additionalProperty": "example" }, "annotations": { "additionalProperty": "example" }, "replicas": 1, "ready_replicas": 1, "images": [ "example" ], "conditions": [ { "type": "example", "status": "example", "reason": "example" } ] } ] }'Called by the K8s agent to push discovered workloads. Authenticated via agent bearer token (not session auth).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
cluster_id
required
string
workloads
required
Array<object>
object
name
string
namespace
string
kind
string
labels
object
key
additional properties
string
annotations
object
key
additional properties
string
replicas
integer
ready_replicas
integer
images
Array<string>
conditions
Array<object>
object
type
string
status
string
reason
string
Responses
Section titled “ Responses ”Workloads received