-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No docs exist for LB #208
Comments
There's also no API documentation yet either, but there is Go client tooling already. This is pretty much what the documentation would look like right now if it was added. (click to expand)
Load BalancersListing Load BalancersTo list all the load balancers you can run [protosam@nullhost]$ civo loadbalancer ls
+--------------------------------------+----------------------------------+-------------+--------------+-----------+----------------------------------------------------+
| ID | Name | Algorithm | Public IP | State | Backends |
+--------------------------------------+----------------------------------+-------------+--------------+-----------+----------------------------------------------------+
| 30005345-35z1-4f4b-8a4d-3a0691958d4c | clusterName-svcNamespace-svcName | round_robin | XXX.X.XXX.XX | available | 192.168.1.4, 192.168.1.2, 192.168.1.4, 192.168.1.2 |
+--------------------------------------+----------------------------------+-------------+--------------+-----------+----------------------------------------------------+ Running [protosam@nullhost]$ civo loadbalancer show 30005345-35z1-4f4b-8a4d-3a0691958d4c
+--------------------------------------+----------------------------------+-------------+--------------+-----------+--------------------------------------------------+----------------------------------------------------+
| ID | Name | Algorithm | Public IP | State | DNS Entry | Backends |
+--------------------------------------+----------------------------------+-------------+--------------+-----------+--------------------------------------------------+----------------------------------------------------+
| 30005345-35z1-4f4b-8a4d-3a0691958d4c | clusterName-svcNamespace-svcName | round_robin | XXX.X.XXX.XX | available | 30005345-35z1-4f4b-8a4d-3a0691958d4c.lb.civo.com | 192.168.1.4, 192.168.1.2, 192.168.1.4, 192.168.1.2 |
+--------------------------------------+----------------------------------+-------------+--------------+-----------+--------------------------------------------------+----------------------------------------------------+ If you need to know how to use the API in the meantime, here's some curl examples. (click to expand)## List Load Balancers ```sh [protosam@nullhost]$ curl -s -H "Authorization: bearer " https://api.civo.com/v2/loadbalancers/ | jq ``` Show Load Balancer by ID[protosam@nullhost]$ curl -s -H "Authorization: bearer <api-key>" https://api.civo.com/v2/loadbalancers/<load-balancer-id> | jq Create Load Balancer[protosam@nullhost]$ curl -X POST -H "Authorization: bearer <api-key>" https://api.civo.com/v2/loadbalancers \
-H 'Content-Type: application/json' \
-d '{
"name": "somelb",
"algorithm": "round_robin",
"backends":[
{
"ip": "192.168.1.4",
"protocol": "TCP",
"source_port": 80,
"target_port": 31961
}
]
}'
{"id":"403e7bbf-7bb2-43e5-861d-6668f0d955e0","name":"somelb","algorithm":"round_robin","backends":[{"ip":"192.168.1.4","protocol":"TCP","source_port":80,"target_port":31961}],"public_ip":"","private_ip":"","firewall_id":"9668d6a5-39fc-4b61-a8a6-a5c491580ea0","state":""}
[protosam@nullhost]$ civo loadbalancers show 403e7bbf-7bb2-43e5-861d-6668f0d955e0
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+
| ID | Name | Algorithm | Public IP | State | DNS Entry | Backends |
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+
| 403e7bbf-7bb2-43e5-861d-6668f0d955e0 | somelb | round_robin | 212.2.247.249 | available | 403e7bbf-7bb2-43e5-861d-6668f0d955e0.lb.civo.com | 192.168.1.4 |
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+ Update a Load Balancer[protosam@nullhost]$ curl -X PUT -H "Authorization: bearer <api-key>" https://api.civo.com/v2/loadbalancers/403e7bbf-7bb2-43e5-861d-6668f0d955e0 \
-H 'Content-Type: application/json' \
-d '{
"algorithm": "round_robin",
"backends":[
{
"ip": "192.168.1.1",
"protocol": "TCP",
"source_port": 80,
"target_port": 31961
}
]
}'
{"id":"403e7bbf-7bb2-43e5-861d-6668f0d955e0","name":"somelb","algorithm":"round_robin","backends":[{"ip":"192.168.1.1","protocol":"TCP","source_port":80,"target_port":31961}],"public_ip":"212.2.247.249","private_ip":"192.168.1.3","firewall_id":"9668d6a5-39fc-4b61-a8a6-a5c491580ea0","state":"available"}
[protosam@nullhost]$ civo loadbalancers show 403e7bbf-7bb2-43e5-861d-6668f0d955e0
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+
| ID | Name | Algorithm | Public IP | State | DNS Entry | Backends |
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+
| 403e7bbf-7bb2-43e5-861d-6668f0d955e0 | somelb | round_robin | 212.2.247.249 | available | 403e7bbf-7bb2-43e5-861d-6668f0d955e0.lb.civo.com | 192.168.1.1 |
+--------------------------------------+--------+-------------+---------------+-----------+--------------------------------------------------+-------------+ Delete a Load Balancer[protosam@nullhost]$ curl -X DELETE -H "Authorization: bearer <api-key>" https://api.civo.com/v2/loadbalancers/403e7bbf-7bb2-43e5-861d-6668f0d955e0
{"result":"success"} Edit: |
Thanks for the feedback @protosam! Will raise this with the team and the docs should be updated soon 😄 |
@haardikdharma10 I made a PR adding the docs file for Load Balancer #222. |
Thanks @Ujjwal2421. Commented 😄 |
Currently, in CLI repo's README, no docs are mentioned for load balancers and hence https://github.com/civo/cli/blob/master/README.md#load-balancers doesn't redirect to the desired heading as it doesn't exist.
The text was updated successfully, but these errors were encountered: