Skip to content
Snippets Groups Projects

Resolve "Write API documentation"

Merged Arie Peterson requested to merge 2-write-api-documentation into master
All threads resolved!
1 file
+ 53
1
Compare changes
  • Side-by-side
  • Inline
+ 53
1
API Documentation
API Documentation
=================
=================
Coming soon!
End points:
 
 
Encryption:
 
 
TODO: document post data
 
 
``GET /encryption``
 
Returns the status of the encryption (whether or not you have an encrypted
 
partition)
 
``POST /encryption/init``
 
Encrypts the disk with a password if there are no encrypted disks
 
 
Post data: ``{"password": password}``
 
``POST /encryption/unlock``
 
Decrypts the disk using a password and boots the machine
 
 
Post data: ``{"password": password}``
 
``POST /encryption/remove``
 
Brings the VPS in a state where the disk is not encrypted and booting does not
 
require a password (does not change the initrd to a "regular" initrd)
 
 
Post data: ``{"password": password}``
 
``POST /encryption/selfdestruct``
 
Removes the encryption master key, effectively deleting the encrypted data
 
permanently.
 
 
Encryption keys
 
 
``GET /encryption/keys``
 
List luks password slots
 
``POST/PUT /encryption/keys/{slot}``
 
Add/change a luks slot to a new password. {slot} corresponds to a slot id
 
listed by ``GET /encryption/keys``.
 
 
Post data: ``{"password": password, "new-password": new-password}``
 
``DELETE /encryption/keys/{slot}``
 
Delete a password from a luks slot
 
 
SSH keys with access to the initrd:
 
 
``GET /ssh/keys``
 
List SSH keys in the ``/root/authorized_keys`` file
 
``POST/ssh/keys``
 
Add a key to the authorized_keys file
 
 
Post data: ``{"ssh-key": ssh-key}``
 
``PUT /ssh/keys/{id}``
 
Change a key in the authorized_keys file
 
 
Post data: ``{"ssh-key": ssh-key}``
 
``DELETE /ssh/keys/{key}``
 
Delete the key with id {key} from the autorized_keys file
 
Loading