1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-02-14 20:22:13 +00:00

Update readme

This commit is contained in:
Tlams 2018-02-21 21:30:04 +00:00
parent 2ed77b4001
commit 1abc2b10a0

View file

@ -147,12 +147,27 @@ vi /opt/HyperProxmox/code/scripts/main/private/conf/config
### Init:
``` bash
# Start & generate your key
cd /opt/HyperProxmox/code/scripts/main/
/usr/bin/python3.5 /opt/HyperProxmox/code/scripts/main/startup.py
# Start & generate your key (root user/sudo)
runuser -l hyperproxmox -c '/usr/bin/python3.5 /opt/HyperProxmox/code/scripts/main/startup.py'
< generate a key, with strong passphrase (SAVE IT!) >
OUTPUT:
######################
No key found, auto-generation started ...
Need a passphrase to start the generation:
This action can take some minutes, please wait.
Your new key has been generate !
- Private Key: private/keys/Ragnarok.pvt.key
- Public Key: private/keys/Ragnarok.pvt.key
Passphrase HASH: 10e06b990d44de0091a2(......)5591c161ecc35944fc69c4433a49d10fc6b04a33611
You MUST save your passphrase hash in a security place !
Start API server...
http://127.0.0.1:8080/
######################
```
The HASH will be ask at each start.
Without it, the privite key can be read and the access cannot be load in the memory.
If you loose it, you must delete the keys, delete the different entries in the collection "clusters_conf" in mongoDB database.
### Insert your first cluster (from host)
``` bash
@ -184,3 +199,70 @@ curl -H -XPOST -d '{ "name": "Cluster_1",
![alt text](https://github.com/ThomasGsp/HyperProxmox/blob/master/doc/screenshots/h-nodes.jpg)
![alt text](https://github.com/ThomasGsp/HyperProxmox/blob/master/doc/screenshots/h-vms.jpg)
![alt text](https://github.com/ThomasGsp/HyperProxmox/blob/master/doc/screenshots/h-sto.jpg)
## API Information
### General informations
``` bash
([a-z0-9]+) = MongoID
([0-9]+) = Timestamp
([0-9a-zA-Z\_\-]+) = Cluster/node name
([0-9]+) = vmid
```
### Manage instance status
``` bash
'/api/v1/instance/id/([a-z0-9]+)/status/(start|stop|current|reset|shutdown)' | GET
```
### Cluster management
``` bash
'/api/v1/administration/cluster/(?:[0-9a-zA-Z\_\-]+)' | GET - Return the informations for an specific cluster
'/api/v1/administration/cluster/' | GET - Return all clusters information
'/api/v1/administration/cluster/new' | POST - Inster a new cluster
```
### Cache Data - Mongo data
``` bash
# date/cluster/node/vmid
# Disks mapping
'/api/v1/static/disks/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)/([0-9]+)' | GET - Return the informations for an specific disk
'/api/v1/static/disks/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)/' | GET - Return all disks used in a node
'/api/v1/static/disks/([0-9]+)/([0-9a-zA-Z\_\-]+)/' | GET - Return all disks used in a cluster
'/api/v1/static/disks/([0-9]+)/' | GET - Return all disks
# Storages mapping
'/api/v1/static/storages/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)/' | GET - Return all storage used in a node
'/api/v1/static/storages/([0-9]+)/([0-9a-zA-Z\_\-]+)/' | GET - Return all storages used in a cluster
'/api/v1/static/storages/([0-9]+)/' | GET - Return all storages
# Instances mapping
'/api/v1/static/instances/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)/([0-9]+) | GET - Return the informations for an specific instance
'/api/v1/static/instances/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)/ | GET - Return all instances for a node
'/api/v1/static/instances/([0-9]+)/([0-9a-zA-Z\_\-]+)/ | GET - Return all instances for a cluster
'/api/v1/static/instances/([0-9]+) | GET - Return all instances (the dump can be very big, in a large infrastructure)
# Nodes mapping
'/api/v1/static/(nodes)/([0-9]+)/([0-9a-zA-Z\_\-]+)/([0-9a-zA-Z\_\-]+)' | GET - Return the informations for an specific node
'/api/v1/static/(nodes)/([0-9]+)/([0-9a-zA-Z\_\-]+)/' | GET - Return all nodes for a cluster
'/api/v1/static/(nodes)/([0-9]+)/' | GET - Return all nodes
# cluster mapping
'/api/v1/static/(clusters)/([0-9]+)/(?:[0-9a-zA-Z\_\-]+)' | GET - Return the insformations for a specific cluster
'/api/v1/static/(clusters)/([0-9]+)/' | GET - Return all cluster informations
# date
'/api/v1/static/dates/(all|last)' | GET - Return all or the last date available (generated by the crawler)
# mongoid
'/api/v1/static/(instances|nodes|clusters|storages|disks)/id/([a-z0-9]+)' | GET - Return an information by mongoid
```
### Typical use
``` bash
curl http://127.0.0.1:8080/api/v1/static/nodes/1519040226/Cluster_1/sd-817348
```