powerdns

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSchema = "https"

DefaultSchema is the value used for the URL in case no schema is explicitly defined

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider returns a schema.Provider for PowerDNS.

Types

type Client

type Client struct {
	ServerURL     string // Location of PowerDNS server to use
	ServerVersion string
	APIKey        string // REST API Static authentication key
	APIVersion    int    // API version to use
	HTTP          *http.Client
}

Client is a PowerDNS client representation

func NewClient

func NewClient(serverURL string, apiKey string, configTLS *tls.Config) (*Client, error)

NewClient returns a new PowerDNS client

func (*Client) CreateZone added in v0.2.0

func (client *Client) CreateZone(zoneInfo ZoneInfo) (ZoneInfo, error)

CreateZone creates a zone

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 its ID

func (*Client) DeleteZone added in v0.2.0

func (client *Client) DeleteZone(name string) error

DeleteZone deletes a zone

func (*Client) GetZone added in v0.2.0

func (client *Client) GetZone(name string) (ZoneInfo, error)

GetZone gets a zone

func (*Client) ListRecords

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

ListRecords returns all records in Zone

func (*Client) ListRecordsByID

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

ListRecordsByID returns all records by IDs

func (*Client) ListRecordsInRRSet

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

ListRecordsInRRSet 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

func (*Client) UpdateZone added in v0.2.0

func (client *Client) UpdateZone(name string, zoneInfo ZoneInfo) error

UpdateZone updates a zone

func (*Client) ZoneExists added in v0.2.0

func (client *Client) ZoneExists(name string) (bool, error)

ZoneExists checks if requested zone exists

type Config

type Config struct {
	ServerURL     string
	APIKey        string
	InsecureHTTPS bool
	CACertificate string
}

Config describes de configuration interface of this provider

func (*Config) Client

func (c *Config) Client() (*Client, error)

Client returns a new client for accessing PowerDNS

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"`
	SetPtr   bool   `json:"set-ptr"`
}

Record represents a PowerDNS record object

func (*Record) ID added in v1.1.0

func (record *Record) ID() string

ID returns a record with the ID format

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 represents a PowerDNS RRSet object

func (*ResourceRecordSet) ID added in v1.1.0

func (rrSet *ResourceRecordSet) ID() string

ID returns a rrSet with the ID format

type ZoneInfo

type ZoneInfo struct {
	ID                 string              `json:"id"`
	Name               string              `json:"name"`
	URL                string              `json:"url"`
	Kind               string              `json:"kind"`
	DNSSec             bool                `json:"dnsssec"`
	Serial             int64               `json:"serial"`
	Records            []Record            `json:"records,omitempty"`
	ResourceRecordSets []ResourceRecordSet `json:"rrsets,omitempty"`
	Nameservers        []string            `json:"nameservers,omitempty"`
	Masters            []string            `json:"masters,omitempty"`
	SoaEditAPI         string              `json:"soa_edit_api"`
}

ZoneInfo represents a PowerDNS zone object

Jump to

Keyboard shortcuts

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