add node device path, add service and config templates

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

@ -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)

@ -0,0 +1,13 @@
{
"listenPort": 80,
"pve": {
"url": "http://<proxmox host>/api2/json",
"token": {
"user": "proxmoxaas-api",
"realm": "pam",
"id": "token",
"uuid": "<secret-uuid>"
}
},
"rebuildInterval": 60
}

@ -0,0 +1,11 @@
[Unit]
Description=proxmoxaas-fabric
After=network.target
[Service]
WorkingDirectory=/<path to dir>
ExecStart=/<path to dir>/proxmoxaas-fabric
Restart=always
RestartSec=10
Type=simple
[Install]
WantedBy=default.target