You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
knotctl/README.md

145 lines
2.9 KiB

2 years ago
# knotctl
This is a commandline tool for knotapi: https://gitlab.nic.cz/knot/knot-dns-rest
2 years ago
## Build and install
3 months ago
To install using pip, run the following command in a virtual envrionment.
```
3 months ago
python -m pip install "knotctl @ git+https://code.smolnet.org/micke/knotctl
```
3 months ago
To build and install as a deb-package
3 months ago
```
sudo apt install python3-stdeb
git clone https://code.smolnet.org/micke/knotctl
cd knotctl
python3 setup.py --command-packages=stdeb.command bdist_deb
sudo dpkg -i deb_dist/knotctl_*_all.deb
```
A prebuilt deb-package is also available from the release page: https://code.smolnet.org/micke/knotctl/releases/
## Shell completion
3 months ago
For bash: add this to .bashrc
3 months ago
```
source <(knotctl completion)
```
3 months ago
For fish, run:
3 months ago
```
knotctl completion --shell fish > ~/.config/fish/completions/knotctl.fish
```
3 months ago
For tcsh: add this to .cshrc
3 months ago
```
complete "knotctl" 'p@*@`python-argcomplete-tcsh "knotctl"`@' ;
```
3 months ago
For zsh: add this to .zshrc
3 months ago
```
autoload -U bashcompinit
bashcompinit
source <(knotctl completion)
```
2 years ago
## Usage
3 months ago
2 years ago
```
2 years ago
usage: knotctl [-h] [--json | --no-json]
{add,completion,config,delete,list,update} ...
2 years ago
positional arguments:
{add,completion,config,delete,list,update}
2 years ago
options:
-h, --help show this help message and exit
--json, --no-json
2 years ago
```
3 months ago
2 years ago
### ADD
3 months ago
2 years ago
```
usage: knotctl add [-h] -d DATA -n NAME -r RTYPE [-t TTL] -z ZONE
2 years ago
options:
-h, --help show this help message and exit
-d DATA, --data DATA
-n NAME, --name NAME
-r RTYPE, --rtype RTYPE
-t TTL, --ttl TTL
-z ZONE, --zone ZONE
2 years ago
```
3 months ago
### COMPLETION
3 months ago
2 years ago
```
usage: knotctl completion [-h] [-s SHELL]
2 years ago
options:
-h, --help show this help message and exit
-s SHELL, --shell SHELL
```
3 months ago
2 years ago
### CONFIG
3 months ago
2 years ago
```
usage: knotctl config [-h] [-c CONTEXT] [-b BASEURL] [-p PASSWORD] [-u USERNAME]
2 years ago
options:
-h, --help show this help message and exit
-c CONTEXT, --context CONTEXT
2 years ago
-b BASEURL, --baseurl BASEURL
-p PASSWORD, --password PASSWORD
-u USERNAME, --username USERNAME
2 years ago
```
3 months ago
2 years ago
### DELETE
3 months ago
2 years ago
```
2 years ago
usage: knotctl delete [-h] [-d DATA] [-n NAME] [-r RTYPE] -z ZONE
options:
-h, --help show this help message and exit
-d DATA, --data DATA
-n NAME, --name NAME
-r RTYPE, --rtype RTYPE
-z ZONE, --zone ZONE
2 years ago
```
3 months ago
2 years ago
### LIST
3 months ago
2 years ago
```
2 years ago
usage: knotctl list [-h] [-d DATA] [-n NAME] [-r RTYPE] [-z ZONE]
options:
-h, --help show this help message and exit
-d DATA, --data DATA
-n NAME, --name NAME
-r RTYPE, --rtype RTYPE
-z ZONE, --zone ZONE
2 years ago
```
3 months ago
2 years ago
### UPDATE
3 months ago
2 years ago
```
usage: knotctl update [-h] -a [ARGUMENT ...] -d DATA -n NAME -r RTYPE [-t TTL]
-z ZONE
2 years ago
options:
-h, --help show this help message and exit
-a [ARGUMENT ...], --argument [ARGUMENT ...]
Specify key - value pairs to be updated:
name=dns1.example.com.
2 years ago
-d DATA, --data DATA
-n NAME, --name NAME
-r RTYPE, --rtype RTYPE
-t TTL, --ttl TTL
-z ZONE, --zone ZONE
2 years ago
```