REST API
On-line documentation for the API is available at /api/docs
.
Authentication
Authentication is managed at /etc/warewulf/auth.conf
. This is a
YAML formatted file with a single key: users:
, that is a list of user names
and passwords able to authenticate to the API.
Warning
Because warewulfd
runs as root
by default, and because warewulfd
can run effectively arbitrary code via overlay templates, API access is
tantamount to root
access on the Warewulf server. For this reason, the
API is only accessible via localhost by default. Still, handle API
credentials with care.
users:
- name: admin
password hash: $2b$05$5QVWDpiWE7L4SDL9CYdi3O/l6HnbNOLoXgY2sa1bQQ7aSBKdSqvsC
Passwords are stored as bcrypt2 hashses, which can be generated with mkpasswd
.
$ mkpasswd --method=bcrypt
Password: # admin
$2b$05$5QVWDpiWE7L4SDL9CYdi3O/l6HnbNOLoXgY2sa1bQQ7aSBKdSqvsC
Node
GET /api/nodes/
: Get nodesPOST /api/nodes/overlays/build
: Build all overlaysDELETE /api/nodes/{id}
: Delete an existing nodeGET /api/nodes/{id}
: Get a nodePATCH /api/nodes/{id}
: Update an existing nodePUT /api/nodes/{id}
: Add a nodeGET /api/nodes/{id}/fields
: Get node fieldsPOST /api/nodes/{id}/overlays/build
: Build overlays for a nodeGET /api/nodes/{id}/raw
: Get a raw node
Profile
GET /api/profiles/
: Get node profilesDELETE /api/profiles/{id}
: Delete an existing profileGET /api/profiles/{id}
: Get a node profilePATCH /api/profiles/{id}
: Update an existing profilePUT /api/profiles/{id}
: Add a profile
Image
GET /api/images
: Get all imagesDELETE /api/images/{name}
: Delete an imageGET /api/images/{name}
: Get an imagePATCH /api/images/{name}
: Update or rename an imagePOST /api/images/{name}/build
: Build an imagePOST /api/images/{name}/import
: Import an image
Overlay
GET /api/overlays/
: Get overlaysDELETE /api/overlays/{name}
: Delete an overlayGET /api/overlays/{name}
: Get an overlayPUT /api/overlays/{name}
: Create an overlayGET /api/overlays/{name}/file
: Get an overlay file