用于管理google云dns上的区域和资源记录集的python模块和cli

gcpdns的Python项目详细描述


python模块和cli,用于管理google cloud dns上的区域和资源记录集

功能

  • 以csv和/或json格式转储所有项目区域名
  • 以csv和/或json格式转储所有区域资源记录集
  • 通过cli或csv创建和删除区域
  • 通过cli创建和删除资源记录集
  • 使用一个csv更新一个项目中多个区域的dns资源记录 文件
  • 发布时自动拆分长度超过255个字符的TXT记录
  • 需要时自动向记录中添加结尾.

cli

Usage: gcpdns [OPTIONS] CREDENTIAL_FILE COMMAND [ARGS]...

  gcpdns: A CLI for managing zones and resource record sets on Google Cloud
  DNS.

Options:
  --version  Show the version and exit.
  --verbose  Enable verbose logging.
  --help     Show this message and exit.

Commands:
  record  Manage DNS resource record sets.
  zone    Manage DNS zones.

gcpdns记录

Usage: gcpdns record [OPTIONS] COMMAND [ARGS]...

  Manage DNS resource record sets.

Options:
  --help  Show this message and exit.

Commands:
  create  Create a resource record set (Data fields separated by |).
  delete  Delete a resource record set
  dump    Dump a list of DNS resource records.
  update  Create, replace, and delete resource record sets using a CSV file.

gcpdns区

Manage DNS zones.

Options:
  --help  Show this message and exit.

Commands:
  create  Create a DNS zone.
  delete  Delete a DNS zone and all its resource records.
  dump    Dump a list of DNS zones.
  update  Create and delete zones using a CSV file.

安装

使用pip(或者对python 3使用pip3)。

sudo -H pip install gcpdns

设置

要使用gcpdns,您需要一个单独的service account凭据json 要使用的每个GCP项目的文件。

确保服务帐户具有编辑DNS的适当权限 (例如,dns管理员角色)在项目中。

区域CSV字段

  • action
    • create-创建区域
    • delete-删除区域
  • dns_name-区域的dns名称
  • gcp_name-GCP中的区域名称(可选)
  • description-区域的描述(可选)

记录csv字段

  • action
    • create-创建资源记录集
    • 与所提供的资源相同,但将替换现有资源。 记录集具有相同的{TT16} $和^ {Tt17}$(如果存在)
    • delete-删除资源记录集
  • name-记录集名称(即完全限定的域名)
  • record_type-DNS记录类型
  • ttl-dns生存时间(秒)
  • data-dns记录数据由|
  • 分隔

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

推荐PyPI第三方库


热门话题
java使用split函数分割字符串,但没有得到期望的结果   未找到包含derby数据库嵌入架构的sql Java桌面应用程序错误   java elasticsearch vs solr用于定制全文搜索系统   java Android:创建没有startOffset的动画延迟?   java如何查看其他应用程序接收的数据?   java如何在Linux中使用D和classpath选项运行jar文件   java和域设计最佳实践   具有相同内存位置的java数组,将显示为输出   连接到java中的elasticsearch?   Java Playframework重定向到带有Json负载的外部url   java无法在Android平台上使用InputStream为蓝牙socket创建ObjectInputStream   使用POI将Excel日期转换为Java日期,年份未正确显示   oracle从数据库层还是Java层调用webservice?