2.8 KiB
2.8 KiB
ProxmoxAAS API - REST API for ProxmoxAAS Dashboard
ProxmoxAAS API provides functionality for the Dashboard by providing a proxy API for the Proxmox API, and an API for requesting resources within a defined quota.
Installation
Prerequisites
- ProxmoxAAS-Dashboard
- Proxmox VE Cluster (v7.0+)
- Reverse proxy server which can proxy the dashboard and API
- FQDN
- Server with NodeJS (v18.0+) and NPM installed
Configuring API Token and Permissions
In the Proxmox web GUI, perform the following steps:
- Add a new user
proxmoxaas-apito Proxmox VE - Create a new API token for the user
proxmoxaas-apiand copy the secret key to a safe location - Create a new role
proxmoxaas-apiwith at least the following permissions:- VM.* except VM.Clone, VM.Console, VM.Monitor, VM.PowerMgmt, VM.Snapshot, VM.Snapshot.Rollback
- Datastore.Allocate, Datastore.AllocateSpace, Datastore.AllocateTemplate, Datastore.Audit
- User.Modify
- Pool.Audit
- SDN.Use (if instances use SDN networks)
- Sys.Audit
- Add a new API Token Permission with path:
/, select the API token created previously, and role:proxmoxaas-api - Add a new User Permission with path:
/, select theproxmoxaas-apiuser, and role:proxmoxaas-api - To prevent users from bypassing the API provided methods, create a new role
PAAS-Clientwith only the following permssions:- Datastore.Audit
- Pool.Audit
- VM.Audit
- VM.Console
- VM.PowerMgmt
Installation - API
- Clone this repo onto the
ProxmoxAAS-APIhost - Run
npm installto initiaze the package requirements - Copy
template.config.jsonasconfig.jsonand modify the following values:- In
application:- hostname - the ProxmoxAAS-Dashboard URL, ie
paas.domain.net - domain - the base domain for the dashboard and proxmox, ie
domain.net - listenPort - the port you want the API to listen on, ie
8081
- hostname - the ProxmoxAAS-Dashboard URL, ie
- In
backends/pve/config:- url: the URI to the Proxmox API, ie
https://pve.domain.net/api2/json - fabric: the URL to the ProxmoxAAS-Fabric, ie
https://fabric.local - token: the
proxmoxaas-apiuser(name), authentication realm (pam), token id, and token secrey key (uuid) - root (Optional): In order to allow users to customize instance pcie devices, the API must use the root credentials for privilege elevation. Provide the root username, ie.
root@pam, and root user password
- url: the URI to the Proxmox API, ie
- In
backends/access_manager/config:- url: url to a access-mamanger-api server API ie.
http://access.local
- url: url to a access-mamanger-api server API ie.
- In
useriso:- node: host of storage with user accessible iso files
- storage: name of storage with user accessible iso files
- In
backups:- storage: name of storage for instance backups
- In
- Start the service using
node ., or call the provided shell script, or use the provided systemctl service script