1
0
Fork 0

add some examples

development
Kevin Wojkovich 2024-12-25 23:00:40 -06:00
parent 3326f446c9
commit a750029834
1 changed files with 41 additions and 0 deletions

View File

@ -68,6 +68,47 @@ $ pip install -r requirements.txt
$ fastapi run server.py --host 0.0.0.0 --port 8000 $ fastapi run server.py --host 0.0.0.0 --port 8000
``` ```
# Examples
## Add multiple A records for the 'ceph.lan' service
```sh
$ read -s -p "enter your api key: " TOKEN
$ export $TOKEN
$ for num in {1..60}; do result=$(curl -s -H "x-api-token:$TOKEN" "http://localhost:8000/service/ceph.lan/10.10.10.1$num" -X POST); done;
$ host ceph.lan
ceph.lan has address 10.10.10.116
ceph.lan has address 10.10.10.132
ceph.lan has address 10.10.10.11
ceph.lan has address 10.10.10.133
ceph.lan has address 10.10.10.117
ceph.lan has address 10.10.10.134
ceph.lan has address 10.10.10.19
...
ceph.lan has address 10.10.10.160
```
## Remove an A record for the 'ceph.lan' service
```sh
$ read -s -p "enter your api key: " TOKEN
$ export $TOKEN
$ curl -s -H "x-api-token:$TOKEN" "http://localhost:8000/service/ceph.lan/10.10.10.160" -X DELETE | jq
{
"ceph.lan": [
"10.10.10.11",
"10.10.10.12",
"10.10.10.13",
"10.10.10.14",
"10.10.10.15",
"10.10.10.16",
"10.10.10.17",
"10.10.10.18",
...
"10.10.10.159",
]
}
```
# License (MIT) # License (MIT)
Copyright 2024 Kevin Wojkovich Copyright 2024 Kevin Wojkovich