add some examples
parent
3326f446c9
commit
a750029834
41
README.md
41
README.md
|
|
@ -68,6 +68,47 @@ $ pip install -r requirements.txt
|
|||
$ 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)
|
||||
|
||||
Copyright 2024 Kevin Wojkovich
|
||||
|
|
|
|||
Loading…
Reference in New Issue