Hello,
We are trying to determine whether our devices are online from the Landscape API. On the new dashboard there is such a thing (see the status column):
How does the frontend calculate this value? In the get_computer endpoint we get these values, if we include the “alerts”:
{
"count": 22,
"results": [
{
"id": 70310329,
"title": "00afce94-7c10-d461-7384-107c61d47383",
"comment": "",
"hostname": "00afce94-7c10-d461-7384-107c61d47383",
"total_memory": 7814,
"total_swap": 0,
"reboot_required_flag": false,
"update_manager_prompt": "normal",
"clone_id": null,
"secrets_name": null,
"last_exchange_time": "2024-10-28T15:50:01Z",
"last_ping_time": "2024-10-28T16:43:11Z",
"tags": [],
"access_group": "global",
"distribution": "22",
"distribution_info": {
"description": "Ubuntu Core 22",
"distributor": "Ubuntu Core",
"release": "22",
"code_name": "ubuntu-core"
},
"cloud_instance_metadata": {},
"vm_info": "",
"container_info": "",
"default_child": null,
"ubuntu_pro_info": {
"_doc": "Content provided in json response is currently considered Experimental and may change",
"_schema_version": "0.1",
"account": {
"created_at": "",
"external_account_ids": [],
"id": "",
"name": ""
},
"attached": false,
"config": {
"contract_url": "https://contracts.canonical.com",
"data_dir": "/var/lib/ubuntu-advantage",
"log_file": "/var/log/ubuntu-advantage.log",
"log_level": "debug",
"security_url": "https://ubuntu.com/security",
"ua_config": {
"apt_news": false,
"apt_news_url": "https://motd.ubuntu.com/aptnews.json",
"global_apt_http_proxy": null,
"global_apt_https_proxy": null,
"http_proxy": null,
"https_proxy": null,
"metering_timer": 14400,
"ua_apt_http_proxy": null,
"ua_apt_https_proxy": null,
"update_messaging_timer": 21600
}
},
"config_path": "/etc/ubuntu-advantage/uaclient.conf",
"contract": {
"created_at": "",
"id": "",
"name": "",
"products": [
"landscape"
],
"tech_support_level": "n/a"
},
"effective": "2024-10-25T12:23:42.637574+00:00",
"environment_vars": [],
"errors": [],
"execution_details": "No Ubuntu Pro operations are running",
"execution_status": "inactive",
"expires": "2024-11-24T12:23:42.637574+00:00",
"features": {},
"machine_id": null,
"notices": [],
"result": "success",
"services": [
{
"available": "yes",
"description": "Management and administration tool for Ubuntu",
"description_override": null,
"name": "landscape"
}
],
"simulated": false,
"version": "31.1",
"warnings": []
},
"livepatch_info": null,
"ubuntu_pro_reboot_required_info": null,
"num_child": 0,
"cloud_init": {},
"is_wsl_instance": false,
"children": [],
"is_default_child": null,
"parent": null,
"alerts": [
{
"type": "ComputerOfflineAlert",
"summary": "Offline",
"severity": "warning"
}
]
}
],
"next": "/api/v2/computers?limit=1&with_alerts=true&offset=1",
"previous": null
}
What data is used? Ping time? Exchange time? Minimum of both? Or the lack of “offline” alerts? Something else?
Tagging @mikecw