add node device path, add service and config templates
This commit is contained in:
parent
1e68449354
commit
3cd9526c8b
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) {
|
router.GET("/nodes/:node/instances/:instance", func(c *gin.Context) {
|
||||||
node := c.Param("node")
|
node := c.Param("node")
|
||||||
vmid, err := strconv.ParseUint(c.Param("instance"), 10, 64)
|
vmid, err := strconv.ParseUint(c.Param("instance"), 10, 64)
|
||||||
|
13
configs/template.config.json
Normal file
13
configs/template.config.json
Normal file
@ -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
|
||||||
|
}
|
11
init/proxmoxaas-fabric.service
Normal file
11
init/proxmoxaas-fabric.service
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user