add node device path, add service and config templates

This commit is contained in:
2025-02-11 07:11:05 +00:00
parent 1e68449354
commit 3cd9526c8b
3 changed files with 38 additions and 0 deletions

View File

@@ -80,6 +80,20 @@ func Run() {
}
})
router.GET("/nodes/:node/devices", func(c *gin.Context) {
node := c.Param("node")
host, err := cluster.GetHost(node)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err})
return
} else {
c.JSON(http.StatusOK, gin.H{"devices": host.Devices})
return
}
})
router.GET("/nodes/:node/instances/:instance", func(c *gin.Context) {
node := c.Param("node")
vmid, err := strconv.ParseUint(c.Param("instance"), 10, 64)