1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-03-09 15:40:18 +00:00

Update doc

This commit is contained in:
Tlams 2018-05-01 11:33:33 +01:00
parent 9c47ed7c9f
commit 1599bdad52
8 changed files with 502 additions and 351 deletions

View file

@ -124,10 +124,10 @@ DATETIMESTAMP=$(($(date +%s)-$((86400*$RET))))
* type: purge type (strict = all data before this date)
* date: delete data before this date - in seconds(timestamp)
Currently, just one mod is available: stric.
Currently, just one mod is available: strict.
It's mean that ALL data will be delete before the date.
Some others possibility should be available in the future, like keep one day per week.
[Frontend](03-frontend.md) <-- Previous | Next --> [Usage - First start](05-first_start.md)
[Setup - Frontend](03-frontend.md) <-- Previous | Next --> [Usage - First start](05-first_start.md)

View file

@ -30,6 +30,4 @@ If you loose it, you must delete the keys and delete the different entries in th
Currently there are not system to provide a full reset function. Use MongoDB shell to do it.
[Config](04-configs.md) <-- Previous | Next --> [Usage - Logs](05-first_start.md)
[Setup - Config](04-configs.md) <-- Previous | Next --> [Usage - Logs](05-first_start.md)

View file

@ -0,0 +1,30 @@
# Logs
A log system is available, but not complete.
Format: [DATE] [THREAD_ID] [LEVEL] [TYPE] : JSON-DATA
* DATE = When the log is generated. (If bulk system is activate, date is respected)
* THREAD_ID = Hyperproxmox work with different thread (Core, API, crawler, sub-crawler...). If you wan debug correctly, you can use
grep to follow your thread.
* LEVEL = WARNING, INFO, DEBUG...
* TYPE = Who generate this log
Log example:
```bash
[2018-04-29 15:59] [140273766102784] [ERROR] [HYPERPROXMOX] :
{
"target": "my.promoxserver.com:8006",
"result": "ERROR", "
value": "Cannot get ticket session my.promoxserver.com:8006 (HTTPSConnectionPool(host='my.promoxserver.com:8006', port=8006): Max retries exceeded with url: /api2/json/access/ticket?username=***YOUR_USER***&password=***PWD***(Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9405c83630>, 'Connection to my.promoxserver.com:8006 timed out. (connect timeout=5)')))",
"type": "PYTHON"
}
```
This log show a bad connection to Proxmox server.
User and password are hidden:
```bash
username=***YOUR_USER***&password=***PWD***
```
[Usage - First start](05-first_start.md) <-- Previous | Next --> [Usage - API](07-api.md)

View file

@ -0,0 +1,68 @@
# API Information
### Instance status management
``` bash
'/api/v1/instance/id/<MongoID>/status/(start|stop|current|reset|shutdown)' | GET
```
### Cluster management
``` bash
'/api/v1/administration/cluster/<cluster>' | GET - Return the informations for an specific cluster
| PUT - Update the configurations for an specific cluster
| DELETE - Delete the configuration for an specific cluster
'/api/v1/administration/cluster' | GET - Return all clusters information
| POST - Insert a new cluster
```
### Data
``` bash
'/api/v1/administration/purge' | POST - Delete old data
```
### Cache Data - MongoDB
This data are manage by the crawler, you can't insert or change data yourself
``` bash
# date/cluster/node/vmid
# Disks mapping
'/api/v1/static/disks/<date>/<cluster>/<node>/<vmid>' | GET - Return the informations for an specific disk
'/api/v1/static/disks/<date>/<cluster>/<node>/' | GET - Return all disks used in a node
'/api/v1/static/disks/<date>/<cluster>/' | GET - Return all disks used in a cluster
'/api/v1/static/disks/<date>/' | GET - Return all disks
# Storages mapping
'/api/v1/static/storages/<date>/<cluster>/<node>/' | GET - Return all storage used in a node
'/api/v1/static/storages/<date>/<cluster>/' | GET - Return all storages used in a cluster
'/api/v1/static/storages/<date>/' | GET - Return all storages
# Instances mapping
'/api/v1/static/instances/<date>/<cluster>/<node>/<vmid>' | GET - Return the informations for an specific instance
'/api/v1/static/instances/<date>/<cluster>/<node>/' | GET - Return all instances for a node
'/api/v1/static/instances/<date>/<cluster>/' | GET - Return all instances for a cluster
'/api/v1/static/instances/<date>/' | GET - Return all instances (the dump can be very big, in a large infrastructure)
# Nodes mapping
'/api/v1/static/nodes/<date>/<cluster>/<node>' | GET - Return the informations for an specific node
'/api/v1/static/nodes/<date>/<cluster>/' | GET - Return all nodes for a cluster
'/api/v1/static/nodes/<date>/' | GET - Return all nodes
# cluster mapping
'/api/v1/static/clusters/<date>/<cluster>' | GET - Return the insformations for a specific cluster
'/api/v1/static/clusters/<date>/' | 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/<MongoID>' | 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
```
[Usage - logs](06-logs.md) <-- Previous | Next --> [Usage - General](08-usages.md)

View file

@ -0,0 +1,54 @@
# Usages
## API
Insert your first cluster (from host)
``` bash
# Minimum:
curl -H -XPOST -d '{
"name": "Cluster_name",
"url":"proxmox.cluster.net",
"port": "8006",
"user": "user@pve",
"password": "******",
"template": "",
"storage_disk": "",
"exclude_nodes": [""],
"groups" : [""],
"weight": 1
}' localhost:8080/api/v1/administration/cluster
# Other example:
curl -H -XPOST -d '{
"name": "Cluster_name",
"url":"proxmox.cluster.net",
"port": "8006",
"user": "user@pve",
"password": "******",
"template": "local:vztmpl/debian-9.0-standard_9.0-2_amd64.tar.gz",
"storage_disk": "disks",
"exclude_nodes": ["node_shit1"],
"groups" : ["group1", "group2..."],
"weight": 1
}' localhost:8080/api/v1/administration/cluster
```
* "name": Symbolic cluster name. Should be uniq (string) [VALUE NOT EMPTY REQUIRED]
* "url": Proxmox - Web GUI URL access (string) [VALUE NOT EMPTY REQUIRED]
* "port": Proxmox - Web PORT access (string) [VALUE NOT EMPTY REQUIRED]
* "user": Proxmox - Administrative PVE user (string) [VALUE NOT EMPTY REQUIRED]
* "password": Proxmox - PVE password (string) [VALUE NOT EMPTY REQUIRED]
* "template": Default template for LXC (string)
* "storage_disk": Default shared disk for KVM/LXC (string)
* "exclude_nodes": Do not use this nodes - Not visible (list)
* "groups" : Symbolics groups for this node (list)
* "weight": Weight for the cluster auto-selection (int) [VALUE NOT EMPTY REQUIRED]
![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)
[Usage - api](07-api.md) <-- Previous