Domaines, ports dedies et load balancing
Les quotas WebGate sont verifies cote API. Les backends load balancing utilisent vps_name.
Routes WebGate
| Methode | URL | Permission |
|---|---|---|
| GET | /v1/services/webgate |
webgate.read |
|
Parametres URL
Aucun Body JSON
Aucun Reponse
Retourne quotas, usage, domaines, ports dedies et load balancers actifs. |
||
| POST | /v1/services/webgate/domains |
webgate.manage |
|
Body JSON
{
"domain_name": "app.example.com",
"vps_name": "VPS-0000"
}
|
||
| DELETE | /v1/services/webgate/domains/{domain_name} |
webgate.manage |
|
Parametres URL
Body JSON
Aucun |
||
| POST | /v1/services/webgate/dedicated-ports |
webgate.manage |
|
Body JSON
{
"vps_name": "VPS-0000",
"protocol": "tcp",
"target_port": 80
}
|
||
| DELETE | /v1/services/webgate/dedicated-ports/{external_port} |
webgate.manage |
|
Parametres URL
Body JSON
Aucun |
||
| POST | /v1/services/webgate/load-balancers |
webgate.manage |
|
Body JSON
{
"domain_name": "api.example.com",
"mode": "roundrobin",
"sticky_mode": "cookie",
"health_check_path": "/health",
"redirect_https": true,
"websocket_enabled": true,
"backends": [
{"vps_name": "VPS-0000", "target_port": 80},
{"vps_name": "VPS-0001", "target_port": 80}
]
}
|
||
| DELETE | /v1/services/webgate/load-balancers/{domain_name} |
webgate.manage |
|
Parametres URL
Body JSON
Aucun |
||
Creer un domaine WebGate
{
"domain_name": "app.example.com",
"vps_name": "VPS-0000"
}
Creer un port dedie
{
"vps_name": "VPS-0000",
"protocol": "tcp",
"target_port": 80
}
Protocoles acceptes: tcp, http. Le port externe WebGate est attribue automatiquement de facon aleatoire dans la plage 30000-60000.
Creer un load balancer
{
"domain_name": "api.example.com",
"mode": "roundrobin",
"sticky_mode": "cookie",
"health_check_path": "/health",
"redirect_https": true,
"websocket_enabled": true,
"dedicated_port_id": 0,
"backends": [
{
"vps_name": "VPS-0000",
"target_port": 80,
"weight": 100,
"is_backup": false
},
{
"vps_name": "VPS-0001",
"target_port": 80,
"weight": 100,
"is_backup": false
}
]
}
Exemples cURL
Lecture etat WebGate
curl -X GET https://api.vps1euro.fr/v1/services/webgate \ -H "Authorization: Bearer YOUR_API_KEY"
Creation load balancer
curl -X POST https://api.vps1euro.fr/v1/services/webgate/load-balancers \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain_name":"api.example.com",
"mode":"leastconn",
"sticky_mode":"source",
"health_check_path":"/health",
"redirect_https":true,
"websocket_enabled":true,
"backends":[
{"vps_name":"VPS-0000","target_port":80},
{"vps_name":"VPS-0001","target_port":80}
]
}'