pve-manager/PVE/API2
Thomas Lamprecht b4b39b55f8 api: ceph osd: factor out getting PSS stat & improve error handling
Do not crowd the higher level API endpoint handler code directly with
some rather low level procfs parsing code, rather factor that out in a
helper. Make said helper private for now so that anybody wanting to
use cannot do so, and thus increase the chance that said dev will
actually think about if this makes sense as is as a general interface.

Avoid fatal die's for the odd case that the smaps_rollup file cannot
be opened, or the even less likely case where PSS stats cannot be
found in the content.

The former could happen due to the general TOCTOU race here, i.e., the
PID we get from systemctl service status parsing isn't guaranteed to
exist anymore when we read from procfs, and if, it's actually not
guaranteed to still be the OSD - but we cannot easily use pidfd's
here and OSD stops are not something that happens frequently, but in
anyway avoid that such a thing fails the whole API call only because a
single metric is affected.

In the long rung it might be better to add a "errors" array to the
response, so that the user can be informed about such an (odd) thing
happening.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-04 14:44:33 +02:00
..
Ceph api: ceph osd: factor out getting PSS stat & improve error handling 2023-09-04 14:44:33 +02:00
Cluster api: notification: make the 'mail-to-root' target visible to any user 2023-08-16 11:11:24 +02:00
Hardware makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
ACME.pm api: ACME revoke: do not abort if CA is just expired 2020-08-19 18:52:48 +02:00
ACMEAccount.pm api: acme: fix API index entry for challenge-schema 2021-05-05 15:52:49 +02:00
ACMEPlugin.pm ACME: add comment for implicit standalone plugin fallback 2020-05-07 13:53:05 +02:00
APT.pm api: apt: send notification via new notification module 2023-08-16 11:10:12 +02:00
Backup.pm api: backup: refactor backup permission check 2023-07-27 10:40:17 +02:00
Capabilities.pm api: move cpu path into qemu/capabilities 2021-06-09 11:29:34 +02:00
Ceph.pm api ceph: fix directory endpoint index 2023-06-21 09:32:49 +02:00
Certificates.pm fix #2771: relax cert API endpoints permissions 2020-06-17 14:00:43 +02:00
Cluster.pm api: prepare api handler module for notification config 2023-08-16 11:10:15 +02:00
HAConfig.pm use new ha infrastructure 2015-04-03 08:36:59 +02:00
Hardware.pm api: add resource map api endpoints for PCI and USB 2023-06-16 16:25:42 +02:00
Makefile makefile: convert to use simple parenthesis 2023-05-29 18:24:00 +02:00
Network.pm api2: network: improve code readability 2023-06-07 17:04:29 +02:00
NodeConfig.pm api: fill in nodeconfig schema 2022-03-17 14:24:20 +01:00
Nodes.pm fix whitespaces 2023-08-04 13:54:34 +02:00
Pool.pm fix #474: api: allow transfer from container/vms 2023-08-14 12:26:28 +02:00
Replication.pm api: replication: send notifications via new notification module 2023-08-16 11:10:14 +02:00
ReplicationConfig.pm fix iteration over hash without keys 2020-11-20 15:34:27 +01:00
Services.pm api/services: add pvescheduler to the service list 2021-11-12 16:17:36 +01:00
Subscription.pm website: update external links to www.proxmox.com 2023-08-23 10:09:25 +02:00
Tasks.pm fix #4521: api/tasks: replace upid as filename for task log downloads 2023-02-09 17:18:52 +01:00
VZDump.pm vzdump: send notifications via new notification module 2023-08-16 11:10:10 +02:00