用于auroradns的简单cli客户端

auroradns-cli的Python项目详细描述


Auroradns客户端

基于apache的pcextreme auroradns服务的命令行api客户端 利伯克劳德。

用法

usage: auroradns-cli.py [action] [aruments] (--help for more information)

AuroraDNS Command Line Interface

positional arguments:
  {list-zones,get-record,create-record,delete-record,update-record,create-zone,delete-zone,set-hostname}
                        Specify the action to perform.

optional arguments:
  -h, --help            show this help message and exit
  --details             print details
  --extras              print extras
  --force               don't prompt

authentication:
  --apikey APIKEY, -a APIKEY
                        dns api key
  --secretkey SECRETKEY, -s SECRETKEY
                        dns secret key

record arguments:
  -n NAME, --name NAME  dns name field, defaults to apex
  -d DATA, --data DATA  dns data/content field
  -p PRIO, --prio PRIO  dns record PRIO, mandatory for MX and SRV record types
  -t TYPE, --type TYPE  dns record type, defaults to A/AAAA based on DATA, mandatory otherwise
  --ttl TTL             dns record TTL
  --recordid RECORDID   dns record ID

zone arguments:
  -z ZONE, --zone ZONE  dns ZONE name
  --zoneid ZONEID       dns zone ID

示例

列出区域中的所有记录:

./auroradns-cli.py get-record --zone=mydomain.net
name              type       priority   ttl        data
----------------- ---------- ---------- ---------- ----------------------------------------------------------------------
@                 A                     900        203.0.113.20
*                 A                     900        203.0.113.20
@                 AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
*                 AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
@                 MX         10         900        primary.mail.pcextreme.nl
@                 MX         20         900        fallback.mail.pcextreme.nl
@                 NS                    3600       ns081.auroradns.eu
@                 NS                    3600       ns082.auroradns.nl
@                 NS                    3600       ns083.auroradns.info
@                 SOA                   4800       ns081.auroradns.eu admin.auroradns.eu 2019011401 86400 7200 604800 300

根据特定记录类型和ttl进行筛选:

./auroradns-cli.py get-record --zone=mydomain.net --type=AAAA --ttl=900
name          type       priority   ttl        data
------------- ---------- ---------- ---------- ----------------------------------
@             AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675
*             AAAA                  900        2001:db8:1337::5054:efff:fe0c:c675

创建新的DNS记录,验证IPv6和IPv4记录,记录类型为 如果未指定,则自动设置为aaaa或a。TTL默认为区域默认值:

./auroradns-cli.py create-record --zone=mydomain.net --name=test123 --data=2001:db8:1337:dbfd:5054:3eff:feba:c1f3
Record created: test123.mydomain.net. 3600 IN AAAA 2001:db8:1337:dbfd:5054:3eff:feba:c1f3

删除一条记录,如果过滤器 返回多个结果:

./auroradns-cli.py delete-record --zone=mydomain.net --name=mysubdomain --type=A
name                 type       priority   ttl        data
-------------------- ---------- ---------- ---------- ----------------------------
mysubdomain          AAAA                  3600       2001:db8:1337::5054:15ff:feb8:6a0e

Warning, you are about to delete the records shown above, this cannot be undone.
Type _uppercase_ yes to confirm: YES

Deleted record id 9f020b67-5b77-46e8-832c-0792280e3260: mysubdomain.mydomain.net. 3600 IN A 203.0.113.10

自动为主机创建或更新aaaa-/a-记录

./auroradns-cli.py set-hostname
Record created: mysubdomain.mydomain.net. 3600 IN AAAA 2001:db8:1337::5054:15ff:feb8:6a0e
Record updated: mysubdomain.mydomain.net. 3600 IN A 203.0.113.10

认证

您可以传递--apikey APIKEY--secretkey SECRETKEY命令 行参数或设置DNS_API_KEYDNS_SECRET_KEY环境 变量:

export DNS_API_KEY=MYAPIKEY; export DNS_SECRET_KEY=MYSECRETKEY

设置

pip3 install auroradns-cli

要求

ubuntu 16+

apt install python3 python3-pip python3-dev libcurl4-openssl-dev libssl-dev

中心7

yum install python36 python36-pip python36-devel libcurl libcurl-devel openssl openssl-libs openssl-devel

如果出现以下错误:ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl),请使用--global-option="--with-nss"重新安装pycurl:

pip3 uninstall pycurl
pip3 install pycurl>=7.43.0.2 --global-option="--with-nss"

许可证

  • 麻省理工学院许可证

这是我有史以来第一个python项目,所以这里可能有很多代码 它甚至还没有接近于Python和一些设计选择 可能看起来很奇怪,但在我看来,这在当时是合乎逻辑的。所以没有 无论如何保证,使用风险自负。如果这对你有用, 太好了,享受吧!如果没有,给我发个信息,我会设法解决这个问题。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何让用户决定按钮的特定颜色   java Tomcat jdbc连接池,使用后不释放连接   Java泛型类可分配性   javaactivemq&如何在路由路径中创建依赖关系   java为什么没有接收到操作用户?   windows如何启动使用cmd中预编译DLL的java swing应用程序?   java JFreechart实时组合图,在未收到数据点的情况下呈现step子图表的上一个值   java排序自定义数组列表   java如何从HSLFSlideShow获取文本格式信息   java不能将片段和活动登录结合起来   java是下载位于远程存储服务中的文件的有效方法   java AS:将点数交给GameOverActivity   java如何在textView中将焦点放在新生成文本的顶部?   HashMap中特定于Java存储的类类型   java使用不同的变量类型进行计算   if语句中的Java poll()   检查匹配括号的java字符堆栈没有错误,但也没有任何作用   java Netbeans不断将应用程序部署到错误的服务器