dnsv2

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 30

README

Akamai Config DNS (Zone Record Management)

A golang package that talks to the Akamai OPEN Config DNS API.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config contains the Akamai OPEN Edgegrid API credentials
	// for automatic signing of requests
	Config edgegrid.Config
)

Functions

func FullIPv6

func FullIPv6(ip net.IP) string

func GetMasterZoneFile

func GetMasterZoneFile(zone string) (string, error)

GetZone retrieves a DNS Zone for a given hostname

func GetNameServerRecordList

func GetNameServerRecordList(contractId string) ([]string, error)

func GetRdata

func GetRdata(zone string, name string, record_type string) ([]string, error)

func Init

func Init(config edgegrid.Config)

Init sets the DNSv2 edgegrid Config

func IsConfigDNSError

func IsConfigDNSError(e error) bool

Types

type AuthorityResponse

type AuthorityResponse struct {
	Contracts []struct {
		ContractID  string   `json:"contractId"`
		Authorities []string `json:"authorities"`
	} `json:"contracts"`
}

func GetAuthorities

func GetAuthorities(contractId string) (*AuthorityResponse, error)

func NewAuthorityResponse

func NewAuthorityResponse(contract string) *AuthorityResponse

type ChangeListResponse

type ChangeListResponse struct {
	Zone             string `json:"zone,omitempty"`
	ChangeTag        string `json:"changeTag,omitempty"`
	ZoneVersionId    string `json:"zoneVersionId,omitempty"`
	LastModifiedDate string `json:"lastModifiedDate,omitempty"`
	Stale            bool   `json:"stale,omitempty"`
}

func GetChangeList

func GetChangeList(zone string) (*ChangeListResponse, error)

GetZone retrieves a DNS Zone for a given hostname

func NewChangeListResponse

func NewChangeListResponse(zone string) *ChangeListResponse

type ConfigDNSError

type ConfigDNSError interface {
	error
	Network() bool
	NotFound() bool
	FailedToSave() bool
	ValidationFailed() bool
}

type MetadataH

type MetadataH struct {
	ShowAll       bool `json:"showAll"`
	TotalElements int  `json:"totalElements"`

} //`json:"metadata"`

type RecordBody

type RecordBody struct {
	Name                string   `json:"name,omitempty"`
	RecordType          string   `json:"type,omitempty"`
	TTL                 int      `json:"ttl,omitempty"`
	Active              bool     `json:"active,omitempty"`
	Target              []string `json:"rdata,omitempty"`
	Subtype             int      `json:"subtype,omitempty"`                //AfsdbRecord
	Flags               int      `json:"flags,omitempty"`                  //DnskeyRecord Nsec3paramRecord
	Protocol            int      `json:"protocol,omitempty"`               //DnskeyRecord
	Algorithm           int      `json:"algorithm,omitempty"`              //DnskeyRecord DsRecord Nsec3paramRecord RrsigRecord SshfpRecord
	Key                 string   `json:"key,omitempty"`                    //DnskeyRecord
	Keytag              int      `json:"keytag,omitempty"`                 //DsRecord RrsigRecord
	DigestType          int      `json:"digest_type,omitempty"`            //DsRecord
	Digest              string   `json:"digest,omitempty"`                 //DsRecord
	Hardware            string   `json:"hardware,omitempty"`               //HinfoRecord
	Software            string   `json:"software,omitempty"`               //HinfoRecord
	Priority            int      `json:"priority,omitempty"`               //MxRecord SrvRecord
	Order               uint16   `json:"order,omitempty"`                  //NaptrRecord
	Preference          uint16   `json:"preference,omitempty"`             //NaptrRecord
	FlagsNaptr          string   `json:"flags,omitempty"`                  //NaptrRecord
	Service             string   `json:"service,omitempty"`                //NaptrRecord
	Regexp              string   `json:"regexp,omitempty"`                 //NaptrRecord
	Replacement         string   `json:"replacement,omitempty"`            //NaptrRecord
	Iterations          int      `json:"iterations,omitempty"`             //Nsec3Record Nsec3paramRecord
	Salt                string   `json:"salt,omitempty"`                   //Nsec3Record Nsec3paramRecord
	NextHashedOwnerName string   `json:"next_hashed_owner_name,omitempty"` //Nsec3Record
	TypeBitmaps         string   `json:"type_bitmaps,omitempty"`           //Nsec3Record
	Mailbox             string   `json:"mailbox,omitempty"`                //RpRecord
	Txt                 string   `json:"txt,omitempty"`                    //RpRecord
	TypeCovered         string   `json:"type_covered,omitempty"`           //RrsigRecord
	OriginalTTL         int      `json:"original_ttl,omitempty"`           //RrsigRecord
	Expiration          string   `json:"expiration,omitempty"`             //RrsigRecord
	Inception           string   `json:"inception,omitempty"`              //RrsigRecord
	Signer              string   `json:"signer,omitempty"`                 //RrsigRecord
	Signature           string   `json:"signature,omitempty"`              //RrsigRecord
	Labels              int      `json:"labels,omitempty"`                 //RrsigRecord
	Weight              uint16   `json:"weight,omitempty"`                 //SrvRecord
	Port                uint16   `json:"port,omitempty"`                   //SrvRecord
	FingerprintType     int      `json:"fingerprint_type,omitempty"`       //SshfpRecord
	Fingerprint         string   `json:"fingerprint,omitempty"`            //SshfpRecord
	PriorityIncrement   int      `json:"priority_increment,omitempty"`     //MX priority Increment
}

func NewRecordBody

func NewRecordBody(params RecordBody) *RecordBody

func (*RecordBody) Delete

func (record *RecordBody) Delete(zone string) error

func (*RecordBody) Save

func (record *RecordBody) Save(zone string) error

func (*RecordBody) ToMap

func (record *RecordBody) ToMap() map[string]interface{}

func (*RecordBody) Update

func (record *RecordBody) Update(zone string) error

type RecordError

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

func (*RecordError) Error

func (e *RecordError) Error() string

func (*RecordError) FailedToSave

func (e *RecordError) FailedToSave() bool

func (*RecordError) Network

func (e *RecordError) Network() bool

func (*RecordError) NotFound

func (e *RecordError) NotFound() bool

func (*RecordError) ValidationFailed

func (e *RecordError) ValidationFailed() bool

type RecordSetResponse

type RecordSetResponse struct {
	Metadata   MetadataH   `json:"metadata"`
	Recordsets []Recordset `json:"recordsets"`
}

func GetRecordList

func GetRecordList(zone string, name string, record_type string) (*RecordSetResponse, error)

func NewRecordSetResponse

func NewRecordSetResponse(name string) *RecordSetResponse

type Recordset

type Recordset struct {
	Name  string   `json:"name"`
	Type  string   `json:"type"`
	TTL   int      `json:"ttl"`
	Rdata []string `json:"rdata"`

} //`json:"recordsets"`

type ZoneCreate

type ZoneCreate struct {
	Zone         string   `json:"zone,omitempty"`
	Type         string   `json:"type,omitempty"`
	Masters      []string `json:"masters,omitempty"`
	Comment      string   `json:"comment,omitempty"`
	SignAndServe bool     `json:"signAndServe"`
}

func NewZone

func NewZone(params ZoneCreate) *ZoneCreate

NewZone creates a new Zone

func (*ZoneCreate) Delete

func (zone *ZoneCreate) Delete(zonequerystring ZoneQueryString) error

func (*ZoneCreate) Save

func (zone *ZoneCreate) Save(zonequerystring ZoneQueryString) error

Save updates the Zone

func (*ZoneCreate) SaveChangelist

func (zone *ZoneCreate) SaveChangelist() error

Save changelist for the Zone to create default NS SOA records

func (*ZoneCreate) SubmitChangelist

func (zone *ZoneCreate) SubmitChangelist() error

Save changelist for the Zone to create default NS SOA records

func (*ZoneCreate) Update

func (zone *ZoneCreate) Update(zonequerystring ZoneQueryString) error

Save updates the Zone

type ZoneError

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

func (*ZoneError) Error

func (e *ZoneError) Error() string

func (*ZoneError) FailedToSave

func (e *ZoneError) FailedToSave() bool

func (*ZoneError) Network

func (e *ZoneError) Network() bool

func (*ZoneError) NotFound

func (e *ZoneError) NotFound() bool

func (*ZoneError) ValidationFailed

func (e *ZoneError) ValidationFailed() bool

type ZoneQueryString

type ZoneQueryString struct {
	Contract string `json:"contractid,omitempty"`
	Group    string `json:"lastactivationdate,omitempty"`
}

func NewZoneQueryString

func NewZoneQueryString(Contract string, group string) *ZoneQueryString

type ZoneResponse

type ZoneResponse struct {
	Zone               string   `json:"zone,omitempty"`
	Type               string   `json:"type,omitempty"`
	Masters            []string `json:"masters,omitempty"`
	Comment            string   `json:"comment,omitempty"`
	ActivationState    string   `json:"activationstate,omitempty"`
	ContractId         string   `json:"contractid,omitempty"`
	LastActivationDate string   `json:"lastactivationdate,omitempty"`
	LastModifiedBy     string   `json:"lastmodifiedby,omitempty"`
	LastModifiedDate   string   `json:"lastmodifieddate,omitempty"`
	SignAndServe       bool     `json:"signandserve"`
	VersionId          string   `json:"versionid,omitempty"`
}

func GetZone

func GetZone(zonename string) (*ZoneResponse, error)

GetZone retrieves a DNS Zone for a given hostname

func NewZoneResponse

func NewZoneResponse(zonename string) *ZoneResponse

Jump to

Keyboard shortcuts

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