66 lines
1.2 KiB
Markdown
66 lines
1.2 KiB
Markdown
# API Wrapper: Pi-hole
|
|
>A basic API wrapper for Pi-hole
|
|
|
|
## Functions
|
|
### Custom DNS
|
|
Read, add or delete a custom dns entry (no cname's!)
|
|
```python
|
|
get_custom_dns()
|
|
add_custom_dns(domain, ip)
|
|
del_custom_dns(domain, ip)
|
|
```
|
|
|
|
### Custom CNAMES
|
|
Same as Custom DNS but for CNAMES only.
|
|
```python
|
|
get_custom_cname()
|
|
add_custom_cname(domain, target)
|
|
del_custom_cname(domain, target)
|
|
```
|
|
|
|
### Filter Lists
|
|
Read, add or delete a filter list.
|
|
Availible lists:
|
|
- white
|
|
- black
|
|
- regex_white
|
|
- regex_black
|
|
|
|
*white and black only match exact machtes!*
|
|
|
|
```python
|
|
get_list(list, entry)
|
|
""" aliases """
|
|
get_whitelist(entry)
|
|
get_regex_whitelist(entry)
|
|
get_blacklist(entry)
|
|
get_regex_blacklist(entry)
|
|
|
|
add_to_list(list, entry)
|
|
""" aliases """
|
|
add_to_whitelist(entry)
|
|
add_to_regex_whitelist(entry)
|
|
add_to_blacklist(entry)
|
|
add_to_regex_blacklist(entry)
|
|
|
|
del_from_list(list, entry)
|
|
""" aliases """
|
|
del_from_whitelist(entry)
|
|
del_from_regex_whitelist(entry)
|
|
del_from_blacklist(entry)
|
|
del_from_regex_blacklist(entry)
|
|
```
|
|
|
|
### Misc
|
|
Misc functions for:
|
|
- enable / disable filter
|
|
- get / check update status
|
|
- set temp unit from cpu
|
|
|
|
```python
|
|
enable()
|
|
disable()
|
|
get_version()
|
|
check_updates()
|
|
set_tmp_unit(unit)
|
|
``` |