| 263 | |
| 264 | |
| 265 | def collection_routes(): |
| 266 | endpoints = [] |
| 267 | for key in ["monitors", "sslcerts", "watchdog"]: |
| 268 | endpoints.extend([ |
| 269 | {"method": "GET", "path": f"/api/{key}", "auth": True}, |
| 270 | {"method": "POST", "path": f"/api/{key}", "auth": True, "body": f"{COLLECTIONS[key]['item']} JSON"}, |
| 271 | {"method": "PUT", "path": f"/api/{key}/{{index-or-name}}", "auth": True, "body": f"{COLLECTIONS[key]['item']} JSON"}, |
| 272 | {"method": "DELETE", "path": f"/api/{key}/{{index-or-name}}", "auth": True}, |
| 273 | ]) |
| 274 | return endpoints |
| 275 | |
| 276 | |
| 277 | def api_schema(): |