community.general.dnsimple_info 模块 – 从 DNSimple API 拉取基本信息

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general

要在 playbook 中使用它,请指定:community.general.dnsimple_info

community.general 4.2.0 中的新增功能

概要

  • 从 DNSimple API 检索现有记录和域名。

参数

参数

注释

account_id

string / 必需

要查询的帐户 ID。

api_key

string / 必需

要使用的 API 密钥。

name

string

从中检索信息的域名。

如果指定,将返回此域的所有关联记录。

如果未指定,将返回与帐户 ID 关联的所有域。

record

string

要查找的记录。

如果指定,将仅返回此记录,而不是所有记录。

sandbox

boolean

是否使用沙盒环境。

选项

  • false ←(默认)

  • true

属性

属性

支持

描述

check_mode

支持:完整

此操作不会修改状态。

可以在 check_mode 中运行,并返回已更改的状态预测,而无需修改目标。

diff_mode

支持: N/A

此操作不会修改状态。

当处于 diff 模式时,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息。

示例

- name: Get all domains from an account
  community.general.dnsimple_info:
    account_id: "1234"
    api_key: "1234"

- name: Get all records from a domain
  community.general.dnsimple_info:
    name: "example.com"
    account_id: "1234"
    api_key: "1234"

- name: Get all info from a matching record
  community.general.dnsimple_info:
    name: "example.com"
    record: "subdomain"
    account_id: "1234"
    api_key: "1234"

返回值

通用返回值记录在此处 此处,以下是此模块特有的字段

描述

dnsimple_domain_info

list / elements=dictionary

返回与提供的帐户 ID 关联的所有域的字典列表。

返回:当未指定 name 时成功

示例: [{"account_id": 1234, "created_at": "2021-10-16T21:25:42Z", "id": 123456, "last_transferred_at": null, "name": "example.com", "reverse": false, "secondary": false, "updated_at": "2021-11-10T20:22:50Z"}]

account_id

integer

帐户 ID。

返回:成功

created_at

string

创建域条目的时间。

返回:成功

id

integer

条目的 ID。

返回:成功

last_transferred_at

string

域转移的日期,如果没有转移则为空。

返回:成功

name

string

记录的名称。

返回:成功

reverse

boolean

是否为反向区域记录。

返回:成功

updated_at

string

更新域条目的时间。

返回:成功

dnsimple_record_info

list / elements=dictionary

返回与提供的记录匹配的字典列表。

返回:当指定 namerecord 时成功

示例: [{"content": "1.2.3.4", "created_at": "2021-11-15T23:55:51Z", "id": 123456, "name": "catheadbiscuit", "parent_id": null, "priority": null, "regions": ["global"], "system_record": false, "ttl": 3600, "type": "A", "updated_at": "2021-11-15T23:55:51Z", "zone_id": "example.com"}]

content

string

返回记录的内容。

返回:成功

created_at

string

创建域条目的时间。

返回:成功

id

integer

条目的 ID。

返回:成功

name

string

记录的名称。

返回:成功

parent_id

integer

父记录或 null。

返回:成功

priority

string

记录的优先级设置。

返回:成功

regions

list / elements=string

记录可用的区域列表。

返回:成功

system_record

boolean

是否为系统记录。

返回:成功

ttl

integer

记录 TTL。

返回:成功

type

string

记录类型。

返回:成功

updated_at

string

更新域条目的时间。

返回:成功

zone_id

string

与记录关联的区域的 ID。

返回:成功

dnsimple_records_info

list / elements=dictionary

返回包含提供的域的所有记录的字典列表。

返回:当指定 name 但未指定 record 时成功

示例: [{"content": "ns1.dnsimple.com admin.dnsimple.com", "created_at": "2021-10-16T19:07:34Z", "id": 12345, "name": "catheadbiscuit", "parent_id": null, "priority": null, "regions": ["global"], "system_record": true, "ttl": 3600, "type": "SOA", "updated_at": "2021-11-15T23:55:51Z", "zone_id": "example.com"}]

content

string

返回记录的内容。

返回:成功

created_at

string

创建域条目的时间。

返回:成功

id

integer

条目的 ID。

返回:成功

name

string

记录的名称。

返回:成功

parent_id

integer

父记录或 null。

返回:成功

priority

string

记录的优先级设置。

返回:成功

regions

list / elements=string

记录可用的区域列表。

返回:成功

system_record

boolean

是否为系统记录。

返回:成功

ttl

integer

记录 TTL。

返回:成功

type

string

记录类型。

返回:成功

updated_at

string

更新域条目的时间。

返回:成功

zone_id

string

与记录关联的区域的 ID。

返回:成功

作者

  • Edward Hilgendorf (@edhilgendorf)