65 lines
1.5 KiB
Plaintext
65 lines
1.5 KiB
Plaintext
API Endpoints:
|
|
|
|
1. GET /info
|
|
- Returns current system info and thresholds.
|
|
- Response: {
|
|
uptime: datetime,
|
|
cpu: float,
|
|
ram: float,
|
|
disk: float,
|
|
cpu_threshold: int,
|
|
ram_threshold: int,
|
|
disk_threshold: int,
|
|
cpu_normal: bool,
|
|
ram_normal: bool,
|
|
disk_normal: bool
|
|
}
|
|
|
|
2. GET /limits
|
|
- Returns current threshold limits.
|
|
- Response: {
|
|
cpu_threshold: int,
|
|
ram_threshold: int,
|
|
disk_threshold: int
|
|
}
|
|
|
|
3. POST /limits
|
|
- Sets new threshold limits.
|
|
- Body: {
|
|
cpu_threshold: int,
|
|
ram_threshold: int,
|
|
disk_threshold: int
|
|
}
|
|
- Response: {
|
|
cpu: int,
|
|
ram: int,
|
|
disk: int
|
|
}
|
|
|
|
4. GET /overages
|
|
- Returns a list of overage events.
|
|
- Response: [
|
|
{
|
|
id: int,
|
|
cpu_overage: int,
|
|
ram_overage: int,
|
|
disk_overage: int,
|
|
timestamp: datetime
|
|
},
|
|
...
|
|
]
|
|
|
|
5. GET /overages/{overage_id}
|
|
- Returns a specific overage event by ID.
|
|
- Response: {
|
|
id: int,
|
|
cpu_overage: int,
|
|
ram_overage: int,
|
|
disk_overage: int,
|
|
timestamp: datetime
|
|
}
|
|
|
|
6. DELETE /overages/{overage_id}
|
|
- Deletes a specific overage event by ID.
|
|
- Response: { detail: "Overage event deleted" }
|