powerdns

package module
v0.0.0-...-7cb21fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2017 License: Apache-2.0, MPL-2.0 Imports: 10 Imported by: 0

README

powerdns

Go PowerDNS 4.0 and 3.4 API Client

working api fork from terraform.io

added support for more things now

Documentation

Index

Constants

View Source
const IDSeparator string = ":::"

IDSeparator separator for record identifier.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client Powerdns API client.

func NewClient

func NewClient(serverURL string, apiKey string) (*Client, error)

NewClient returns a new PowerDNS client

func (*Client) CreateRecord

func (client *Client) CreateRecord(zone string, record Record) (string, error)

CreateRecord Creates new record with single content entry

func (*Client) DeleteRecordSet

func (client *Client) DeleteRecordSet(zone string, name string, tpe string) error

DeleteRecordSet Deletes record set from Zone

func (*Client) DeleteRecordSetByID

func (client *Client) DeleteRecordSetByID(zone string, recID string) error

DeleteRecordSetByID Deletes record from Zone by it's ID

func (*Client) ListRecords

func (client *Client) ListRecords(zone string) ([]Record, error)

ListRecords Returns all records in Zone

func (*Client) ListRecordsAsRRSet

func (client *Client) ListRecordsAsRRSet(zone string) ([]ResourceRecordSet, error)

ListRecordsAsRRSet Returns only records of specified name and type

func (*Client) ListRecordsByID

func (client *Client) ListRecordsByID(zone string, recID string) ([]Record, error)

ListRecordsByID returns only records that match the specified record IDentifier.

func (*Client) ListRecordsByNameAndType

func (client *Client) ListRecordsByNameAndType(zone string, name string, tpe string) ([]Record, error)

ListRecordsByNameAndType Returns only records of specified name and type

func (*Client) ListZones

func (client *Client) ListZones() ([]ZoneInfo, error)

ListZones Returns all Zones of server, without records

func (*Client) RecordExists

func (client *Client) RecordExists(zone string, name string, tpe string) (bool, error)

RecordExists Checks if requested record exists in Zone

func (*Client) RecordExistsByID

func (client *Client) RecordExistsByID(zone string, recID string) (bool, error)

RecordExistsByID Checks if requested record exists in Zone by it's ID

func (*Client) ReplaceRecordSet

func (client *Client) ReplaceRecordSet(zone string, rrSet ResourceRecordSet) (string, error)

ReplaceRecordSet Creates new record set in Zone

type Record

type Record struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"` // For API v0
	Disabled bool   `json:"disabled"`
}

Record Data representing Record Information.

func (*Record) ID

func (record *Record) ID() string

ID Returns the record identifier.

type ResourceRecordSet

type ResourceRecordSet struct {
	Name       string   `json:"name"`
	Type       string   `json:"type"`
	ChangeType string   `json:"changetype"`
	TTL        int      `json:"ttl"` // For API v1
	Records    []Record `json:"records,omitempty"`
}

ResourceRecordSet Data representing Resource Record Set Information.

func (*ResourceRecordSet) ID

func (rrSet *ResourceRecordSet) ID() string

ID Returns the resource record identifier.

type ZoneInfo

type ZoneInfo struct {
	ID                 string              `json:"ID"`
	Name               string              `json:"name"`
	Account            string              `json:"account"`
	URL                string              `json:"url"`
	LastCheck          int64               `json:"last_check"`
	Kind               string              `json:"kind"`
	DNSSec             bool                `json:"dnsssec"`
	Serial             int64               `json:"serial"`
	NotifiedSerial     int64               `json:"notified_serial"`
	Masters            []string            `json:"masters"`
	Records            []Record            `json:"records,omitempty"`
	ResourceRecordSets []ResourceRecordSet `json:"rrsets,omitempty"`
}

ZoneInfo Data representing Zone Information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL