Added settings, proper record renaming
This commit is contained in:
parent
2ae93b6fd4
commit
7d7c0c9570
10 changed files with 444 additions and 85 deletions
|
|
@ -106,23 +106,25 @@ func (dev *RouterosDevice) GetIdentity() (identity string, err error) { // {{{
|
|||
return
|
||||
} // }}}
|
||||
|
||||
func (dev *RouterosDevice) StaticDNSEntries() (entries []*DNSRecord, err error) {
|
||||
entries = []*DNSRecord{}
|
||||
func (dev *RouterosDevice) StaticDNSEntries() (records []DNSRecord, err error) {
|
||||
records = []DNSRecord{}
|
||||
|
||||
var routerosEntries []DNSEntry
|
||||
var body []byte
|
||||
body, err = dev.query("GET", "/ip/dns/static", []byte{})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = json.Unmarshal(body, &entries)
|
||||
err = json.Unmarshal(body, &routerosEntries)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, entry := range entries {
|
||||
entry.ParsedValue = entry.String()
|
||||
for _, entry := range routerosEntries {
|
||||
records = append(records, NewDNSRecord(entry))
|
||||
}
|
||||
logger.Info("FOO", "entry", records)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue