class Pdns::RRSet

Overview

This represents a Resource Record Set (all records with the same name and type).

Included Modules

Defined in:

pdns/rrset.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(*, name, type, changetype = ChangeType::Replace, ttl = nil, records = nil, comments = nil) #

Initialize an RRSet with the given attributes

RRSet.new(
  name: "www.powerdns.com.",
  type: "A",
  ttl: 3600_u32,
  records: [Record.new("127.0.0.1")],
  comments: [Comment.new(content: "Testing", account: "Tester")]
)

[View source]

Instance Method Detail

def changetype : ChangeType? #

MUST be added when updating the RRSet. Must be ChangeType::Replace or ChangeType::Delete.

With ChangeType::Delete, all existing RRs matching name and type will be deleted, including all comments.

With ChangeType::Replace: when records is present, all existing RRs matching name and type will be deleted, and then new records given in records will be created. If no records are left, any existing comments will be deleted as well. When comments is present, all existing comments for the RRs matching name and type will be deleted, and then new comments given in comments will be created.


[View source]
def changetype=(changetype : ChangeType?) #

MUST be added when updating the RRSet. Must be ChangeType::Replace or ChangeType::Delete.

With ChangeType::Delete, all existing RRs matching name and type will be deleted, including all comments.

With ChangeType::Replace: when records is present, all existing RRs matching name and type will be deleted, and then new records given in records will be created. If no records are left, any existing comments will be deleted as well. When comments is present, all existing comments for the RRs matching name and type will be deleted, and then new comments given in comments will be created.


[View source]
def comments : Array(Comment)? #

List of Comment.

Must be empty when changetype is set to DELETE. An empty list results in deletion of all comments. modified_at is optional and defaults to the current server time.


[View source]
def comments=(comments : Array(Comment)?) #

List of Comment.

Must be empty when changetype is set to DELETE. An empty list results in deletion of all comments. modified_at is optional and defaults to the current server time.


[View source]
def delete! #

Sets changetype to ChangeType::Delete


[View source]
def name : String #

Name for record set (e.g. "www.powerdns.com.")


[View source]
def name=(name : String) #

Name for record set (e.g. "www.powerdns.com.")


[View source]
def records : Array(Record)? #

All records in this RRSet.

When updating Records, this is the list of new records (replacing the old ones). Must be empty when changetype is set to "DELETE". An empty list results in deletion of all records (and comments).


[View source]
def records=(records : Array(Record)?) #

All records in this RRSet.

When updating Records, this is the list of new records (replacing the old ones). Must be empty when changetype is set to "DELETE". An empty list results in deletion of all records (and comments).


[View source]
def replace! #

Sets changetype to ChangeType::Replace


[View source]
def ttl : UInt32? #

DNS TTL of the records, in seconds. MUST NOT be included when changetype is set to "DELETE”.


[View source]
def ttl=(ttl : UInt32?) #

DNS TTL of the records, in seconds. MUST NOT be included when changetype is set to "DELETE”.


[View source]
def type : DNSRecordType #

Type of this record (e.g. "A", "PTR", "MX")


[View source]
def type=(type : DNSRecordType) #

Type of this record (e.g. "A", "PTR", "MX")


[View source]