powerdns

package
v0.1.1-0...-96f391d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Types

type Client

type Client struct {
	ServerUrl  string // Location of PowerDNS server to use
	ApiKey     string // REST API Static authentication key
	ApiVersion int    // API version to use
	Http       *http.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)

Creates new record with single content entry

func (*Client) DeleteRecordSet

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

Deletes record set from Zone

func (*Client) DeleteRecordSetByID

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

Deletes record from Zone by it's ID

func (*Client) ListRecords

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

Returns all records in Zone

func (*Client) ListRecordsByID

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

func (*Client) ListRecordsInRRSet

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

Returns only records of specified name and type

func (*Client) ListZones

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

Returns all Zones of server, without records

func (*Client) RecordExists

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

Checks if requested record exists in Zone

func (*Client) RecordExistsByID

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

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

func (*Client) ReplaceRecordSet

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

Creates new record set in Zone

type Config

type Config struct {
	ServerUrl string
	ApiKey    string
}

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"`
}

func (*Record) Id

func (record *Record) Id() string

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"`
}

func (*ResourceRecordSet) Id

func (rrSet *ResourceRecordSet) Id() string

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"`
}

Jump to

Keyboard shortcuts

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