add node device path, add service and config templates
This commit is contained in:
14
app/app.go
14
app/app.go
@@ -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)
|
||||
|
Reference in New Issue
Block a user