6004e599ed
* feat: add dep configuration files. * chore: add vendor folder. * refactor: update Dockerfile. * review: remove git from Dockerfile. * review: remove RUN apk. * review: dep status. * feat: added .dockerignore
29 lines
680 B
Go
29 lines
680 B
Go
package auroradnsclient
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/edeckers/auroradnsclient/zones"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// GetZones returns a list of all zones
|
|
func (client *AuroraDNSClient) GetZones() ([]zones.ZoneRecord, error) {
|
|
logrus.Debugf("GetZones")
|
|
response, err := client.requestor.Request("zones", "GET", []byte(""))
|
|
|
|
if err != nil {
|
|
logrus.Errorf("Failed to get zones: %s", err)
|
|
return nil, err
|
|
}
|
|
|
|
var respData []zones.ZoneRecord
|
|
err = json.Unmarshal(response, &respData)
|
|
if err != nil {
|
|
logrus.Errorf("Failed to unmarshall response: %s", err)
|
|
return nil, err
|
|
}
|
|
|
|
logrus.Debugf("Unmarshalled response: %+v", respData)
|
|
return respData, nil
|
|
}
|