1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

GANDI: Registrar support (#274)

* GANDI: add registrar support for changing nameservers. #87

* Update docs with Gandi registrar support #87

* Updated dependencies for Gandi Registrar Support #87
This commit is contained in:
Philipp Hug
2017-11-27 19:04:24 +01:00
committed by Craig Peterson
parent ccf28349ce
commit 53b72f39a8
7 changed files with 98 additions and 22 deletions

View File

@ -16,7 +16,8 @@ func New(c *client.Client) *Domain {
// Check the availability of some domain
func (self *Domain) Available(name string) (string, error) {
var result map[string]interface{}
params := []interface{}{self.Key, name}
domain := []string{name}
params := []interface{}{self.Key, domain}
if err := self.Call("domain.available", params, &result); err != nil {
return "", err
}

View File

@ -0,0 +1,24 @@
package zone
import (
"github.com/prasmussen/gandi-api/client"
"github.com/prasmussen/gandi-api/operation"
)
type Nameservers struct {
*client.Client
}
func New(c *client.Client) *Nameservers {
return &Nameservers{c}
}
// Set the current zone of a domain
func (self *Nameservers) Set(domainName string, nameservers []string) (*operation.OperationInfo, error) {
var res map[string]interface{}
params := []interface{}{self.Key, domainName, nameservers}
if err := self.Call("domain.nameservers.set", params, &res); err != nil {
return nil, err
}
return operation.ToOperationInfo(res), nil
}

View File

@ -65,7 +65,7 @@ func (self *Record) Add(args RecordAdd) (*RecordInfo, error) {
}
// Remove a record from a zone/version
func (self *Record) Delete(zoneId, version, recordId int64) (bool, error) {
func (self *Record) Delete(zoneId, version int64, recordId string) (bool, error) {
var res int64
deleteArgs := map[string]interface{}{"id": recordId}
params := []interface{}{self.Key, zoneId, version, deleteArgs}