Get machine resource metrics
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/metrics \
--header 'Authorization: Bearer <token>'[
{
"timestamp": "2023-11-07T05:31:56Z",
"cpu_percent": 123,
"cpu_count": 123,
"mem_used_bytes": 123,
"mem_total_bytes": 123,
"disk_used_bytes": 123,
"disk_total_bytes": 123,
"network_rx_bytes": 123,
"network_tx_bytes": 123
}
]{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Machines
Get machine resource metrics
Returns CPU, memory, and network usage for the machine.
GET
/
v1
/
machines
/
{id}
/
metrics
Get machine resource metrics
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/metrics \
--header 'Authorization: Bearer <token>'[
{
"timestamp": "2023-11-07T05:31:56Z",
"cpu_percent": 123,
"cpu_count": 123,
"mem_used_bytes": 123,
"mem_total_bytes": 123,
"disk_used_bytes": 123,
"disk_total_bytes": 123,
"network_rx_bytes": 123,
"network_tx_bytes": 123
}
]{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Response
Machine metrics