From a750029834c4d6d00901cc897a8e73b2e7d75138 Mon Sep 17 00:00:00 2001 From: Kevin Wojkovich Date: Wed, 25 Dec 2024 23:00:40 -0600 Subject: [PATCH] add some examples --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index a362461..9b434b2 100644 --- a/README.md +++ b/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