# Zone Transfers # Force AXFR ## Force AXFR `client.DNS.ZoneTransfers.ForceAXFR.New(ctx, params) (*ForceAXFR, error)` **post** `/zones/{zone_id}/secondary_dns/force_axfr` Sends AXFR zone transfer request to primary nameserver(s). ### Parameters - `params ZoneTransferForceAXFRNewParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type ForceAXFR string` When force_axfr query parameter is set to true, the response is a simple string. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) forceAXFR, err := client.DNS.ZoneTransfers.ForceAXFR.New(context.TODO(), dns.ZoneTransferForceAXFRNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", forceAXFR) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": "OK" } ``` ## Domain Types ### Force AXFR - `type ForceAXFR string` When force_axfr query parameter is set to true, the response is a simple string. # Incoming ## Secondary Zone Configuration Details `client.DNS.ZoneTransfers.Incoming.Get(ctx, query) (*ZoneTransferIncomingGetResponse, error)` **get** `/zones/{zone_id}/secondary_dns/incoming` Get secondary zone configuration for incoming zone transfers. ### Parameters - `query ZoneTransferIncomingGetParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferIncomingGetResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Get(context.TODO(), dns.ZoneTransferIncomingGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Create Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.New(ctx, params) (*ZoneTransferIncomingNewResponse, error)` **post** `/zones/{zone_id}/secondary_dns/incoming` Create secondary zone configuration for incoming zone transfers. ### Parameters - `params ZoneTransferIncomingNewParams` - `ZoneID param.Field[string]` Path param - `AutoRefreshSeconds param.Field[float64]` Body param: How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferIncomingNewResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.New(context.TODO(), dns.ZoneTransferIncomingNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), AutoRefreshSeconds: cloudflare.F(86400.000000), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Update Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.Update(ctx, params) (*ZoneTransferIncomingUpdateResponse, error)` **put** `/zones/{zone_id}/secondary_dns/incoming` Update secondary zone configuration for incoming zone transfers. ### Parameters - `params ZoneTransferIncomingUpdateParams` - `ZoneID param.Field[string]` Path param - `AutoRefreshSeconds param.Field[float64]` Body param: How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferIncomingUpdateResponse struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Update(context.TODO(), dns.ZoneTransferIncomingUpdateParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), AutoRefreshSeconds: cloudflare.F(86400.000000), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "auto_refresh_seconds": 86400, "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "modified_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Delete Secondary Zone Configuration `client.DNS.ZoneTransfers.Incoming.Delete(ctx, body) (*ZoneTransferIncomingDeleteResponse, error)` **delete** `/zones/{zone_id}/secondary_dns/incoming` Delete secondary zone configuration for incoming zone transfers. ### Parameters - `body ZoneTransferIncomingDeleteParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferIncomingDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) incoming, err := client.DNS.ZoneTransfers.Incoming.Delete(context.TODO(), dns.ZoneTransferIncomingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", incoming.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20" } } ``` ## Domain Types ### Incoming - `type Incoming struct{…}` - `ID string` - `AutoRefreshSeconds float64` How often should a secondary zone auto refresh regardless of DNS NOTIFY. Not applicable for primary zones. - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `ModifiedTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. # Outgoing ## Primary Zone Configuration Details `client.DNS.ZoneTransfers.Outgoing.Get(ctx, query) (*ZoneTransferOutgoingGetResponse, error)` **get** `/zones/{zone_id}/secondary_dns/outgoing` Get primary zone configuration for outgoing zone transfers. ### Parameters - `query ZoneTransferOutgoingGetParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferOutgoingGetResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Get(context.TODO(), dns.ZoneTransferOutgoingGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Create Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.New(ctx, params) (*ZoneTransferOutgoingNewResponse, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing` Create primary zone configuration for outgoing zone transfers. ### Parameters - `params ZoneTransferOutgoingNewParams` - `ZoneID param.Field[string]` Path param - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferOutgoingNewResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.New(context.TODO(), dns.ZoneTransferOutgoingNewParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Update Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.Update(ctx, params) (*ZoneTransferOutgoingUpdateResponse, error)` **put** `/zones/{zone_id}/secondary_dns/outgoing` Update primary zone configuration for outgoing zone transfers. ### Parameters - `params ZoneTransferOutgoingUpdateParams` - `ZoneID param.Field[string]` Path param - `Name param.Field[string]` Body param: Zone name. - `Peers param.Field[[]string]` Body param: A list of peer tags. ### Returns - `type ZoneTransferOutgoingUpdateResponse struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Update(context.TODO(), dns.ZoneTransferOutgoingUpdateParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Name: cloudflare.F("www.example.com."), Peers: cloudflare.F([]string{"23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194"}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20", "checked_time": "2019-10-24T17:09:42.883908+01:00", "created_time": "2019-10-24T17:09:42.883908+01:00", "last_transferred_time": "2019-10-24T17:09:42.883908+01:00", "name": "www.example.com.", "peers": [ "23ff594956f20c2a721606e94745a8aa", "00920f38ce07c2e2f4df50b1f61d4194" ], "soa_serial": 2019102400 } } ``` ## Delete Primary Zone Configuration `client.DNS.ZoneTransfers.Outgoing.Delete(ctx, body) (*ZoneTransferOutgoingDeleteResponse, error)` **delete** `/zones/{zone_id}/secondary_dns/outgoing` Delete primary zone configuration for outgoing zone transfers. ### Parameters - `body ZoneTransferOutgoingDeleteParams` - `ZoneID param.Field[string]` ### Returns - `type ZoneTransferOutgoingDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outgoing, err := client.DNS.ZoneTransfers.Outgoing.Delete(context.TODO(), dns.ZoneTransferOutgoingDeleteParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outgoing.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "269d8f4853475ca241c4e730be286b20" } } ``` ## Disable Outgoing Zone Transfers `client.DNS.ZoneTransfers.Outgoing.Disable(ctx, params) (*DisableTransfer, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/disable` Disable outgoing zone transfers for primary zone and clears IXFR backlog of primary zone. ### Parameters - `params ZoneTransferOutgoingDisableParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type DisableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) disableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Disable(context.TODO(), dns.ZoneTransferOutgoingDisableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", disableTransfer) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": "Disabled" } ``` ## Enable Outgoing Zone Transfers `client.DNS.ZoneTransfers.Outgoing.Enable(ctx, params) (*EnableTransfer, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/enable` Enable outgoing zone transfers for primary zone. ### Parameters - `params ZoneTransferOutgoingEnableParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type EnableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) enableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Enable(context.TODO(), dns.ZoneTransferOutgoingEnableParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", enableTransfer) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": "Enabled" } ``` ## Force DNS NOTIFY `client.DNS.ZoneTransfers.Outgoing.ForceNotify(ctx, params) (*string, error)` **post** `/zones/{zone_id}/secondary_dns/outgoing/force_notify` Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. ### Parameters - `params ZoneTransferOutgoingForceNotifyParams` - `ZoneID param.Field[string]` Path param - `Body param.Field[unknown]` Body param ### Returns - `type ZoneTransferOutgoingForceNotifyResponseEnvelopeResult string` When force_notify query parameter is set to true, the response is a simple string. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.DNS.ZoneTransfers.Outgoing.ForceNotify(context.TODO(), dns.ZoneTransferOutgoingForceNotifyParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), Body: map[string]interface{}{ }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": "OK" } ``` ## Domain Types ### Disable Transfer - `type DisableTransfer string` The zone transfer status of a primary zone. ### Enable Transfer - `type EnableTransfer string` The zone transfer status of a primary zone. ### Outgoing - `type Outgoing struct{…}` - `ID string` - `CheckedTime string` The time for a specific event. - `CreatedTime string` The time for a specific event. - `LastTransferredTime string` The time for a specific event. - `Name string` Zone name. - `Peers []string` A list of peer tags. - `SOASerial float64` The serial number of the SOA for the given zone. ### Outgoing Status - `type OutgoingStatus string` The zone transfer status of a primary zone. # Status ## Get Outgoing Zone Transfer Status `client.DNS.ZoneTransfers.Outgoing.Status.Get(ctx, query) (*EnableTransfer, error)` **get** `/zones/{zone_id}/secondary_dns/outgoing/status` Get primary zone transfer status. ### Parameters - `query ZoneTransferOutgoingStatusGetParams` - `ZoneID param.Field[string]` ### Returns - `type EnableTransfer string` The zone transfer status of a primary zone. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) enableTransfer, err := client.DNS.ZoneTransfers.Outgoing.Status.Get(context.TODO(), dns.ZoneTransferOutgoingStatusGetParams{ ZoneID: cloudflare.F("269d8f4853475ca241c4e730be286b20"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", enableTransfer) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": "Enabled" } ``` # ACLs ## List ACLs `client.DNS.ZoneTransfers.ACLs.List(ctx, query) (*SinglePage[ACL], error)` **get** `/accounts/{account_id}/secondary_dns/acls` List ACLs. ### Parameters - `query ZoneTransferACLListParams` - `AccountID param.Field[string]` ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.ACLs.List(context.TODO(), dns.ZoneTransferACLListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## ACL Details `client.DNS.ZoneTransfers.ACLs.Get(ctx, aclID, query) (*ACL, error)` **get** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Get ACL. ### Parameters - `aclID string` - `query ZoneTransferACLGetParams` - `AccountID param.Field[string]` ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Get( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Create ACL `client.DNS.ZoneTransfers.ACLs.New(ctx, params) (*ACL, error)` **post** `/accounts/{account_id}/secondary_dns/acls` Create ACL. ### Parameters - `params ZoneTransferACLNewParams` - `AccountID param.Field[string]` Path param - `IPRange param.Field[string]` Body param: Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name param.Field[string]` Body param: The name of the acl. ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.New(context.TODO(), dns.ZoneTransferACLNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), IPRange: cloudflare.F("192.0.2.53/28"), Name: cloudflare.F("my-acl-1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Update ACL `client.DNS.ZoneTransfers.ACLs.Update(ctx, aclID, params) (*ACL, error)` **put** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Modify ACL. ### Parameters - `aclID string` - `params ZoneTransferACLUpdateParams` - `AccountID param.Field[string]` Path param - `ACL param.Field[ACL]` Body param ### Returns - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Update( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), ACL: dns.ACLParam{ IPRange: cloudflare.F("192.0.2.53/28"), Name: cloudflare.F("my-acl-1"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "ip_range": "192.0.2.53/28", "name": "my-acl-1" } } ``` ## Delete ACL `client.DNS.ZoneTransfers.ACLs.Delete(ctx, aclID, body) (*ZoneTransferACLDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/acls/{acl_id}` Delete ACL. ### Parameters - `aclID string` - `body ZoneTransferACLDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferACLDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) acl, err := client.DNS.ZoneTransfers.ACLs.Delete( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferACLDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", acl.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa" } } ``` ## Domain Types ### ACL - `type ACL struct{…}` - `ID string` - `IPRange string` Allowed IPv4/IPv6 address range of primary or secondary nameservers. This will be applied for the entire account. The IP range is used to allow additional NOTIFY IPs for secondary zones and IPs Cloudflare allows AXFR/IXFR requests from for primary zones. CIDRs are limited to a maximum of /24 for IPv4 and /64 for IPv6 respectively. - `Name string` The name of the acl. # Peers ## List Peers `client.DNS.ZoneTransfers.Peers.List(ctx, query) (*SinglePage[Peer], error)` **get** `/accounts/{account_id}/secondary_dns/peers` List Peers. ### Parameters - `query ZoneTransferPeerListParams` - `AccountID param.Field[string]` ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.Peers.List(context.TODO(), dns.ZoneTransferPeerListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Peer Details `client.DNS.ZoneTransfers.Peers.Get(ctx, peerID, query) (*Peer, error)` **get** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Get Peer. ### Parameters - `peerID string` - `query ZoneTransferPeerGetParams` - `AccountID param.Field[string]` ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Get( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Create Peer `client.DNS.ZoneTransfers.Peers.New(ctx, params) (*Peer, error)` **post** `/accounts/{account_id}/secondary_dns/peers` Create Peer. ### Parameters - `params ZoneTransferPeerNewParams` - `AccountID param.Field[string]` Path param - `Name param.Field[string]` Body param: The name of the peer. ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.New(context.TODO(), dns.ZoneTransferPeerNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Name: cloudflare.F("my-peer-1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Update Peer `client.DNS.ZoneTransfers.Peers.Update(ctx, peerID, params) (*Peer, error)` **put** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Modify Peer. ### Parameters - `peerID string` - `params ZoneTransferPeerUpdateParams` - `AccountID param.Field[string]` Path param - `Peer param.Field[Peer]` Body param ### Returns - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Update( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Peer: dns.PeerParam{ Name: cloudflare.F("my-peer-1"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa", "name": "my-peer-1", "ip": "192.0.2.53", "ixfr_enable": false, "port": 53, "tsig_id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Delete Peer `client.DNS.ZoneTransfers.Peers.Delete(ctx, peerID, body) (*ZoneTransferPeerDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/peers/{peer_id}` Delete Peer. ### Parameters - `peerID string` - `body ZoneTransferPeerDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferPeerDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) peer, err := client.DNS.ZoneTransfers.Peers.Delete( context.TODO(), "23ff594956f20c2a721606e94745a8aa", dns.ZoneTransferPeerDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", peer.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "23ff594956f20c2a721606e94745a8aa" } } ``` ## Domain Types ### Peer - `type Peer struct{…}` - `ID string` - `Name string` The name of the peer. - `IP string` IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. - `IxfrEnable bool` Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. - `Port float64` DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. - `TSIGID string` TSIG authentication will be used for zone transfer if configured. # TSIGs ## List TSIGs `client.DNS.ZoneTransfers.TSIGs.List(ctx, query) (*SinglePage[TSIG], error)` **get** `/accounts/{account_id}/secondary_dns/tsigs` List TSIGs. ### Parameters - `query ZoneTransferTSIGListParams` - `AccountID param.Field[string]` ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.DNS.ZoneTransfers.TSIGs.List(context.TODO(), dns.ZoneTransferTSIGListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## TSIG Details `client.DNS.ZoneTransfers.TSIGs.Get(ctx, tsigID, query) (*TSIG, error)` **get** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Get TSIG. ### Parameters - `tsigID string` - `query ZoneTransferTSIGGetParams` - `AccountID param.Field[string]` ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Get( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Create TSIG `client.DNS.ZoneTransfers.TSIGs.New(ctx, params) (*TSIG, error)` **post** `/accounts/{account_id}/secondary_dns/tsigs` Create TSIG. ### Parameters - `params ZoneTransferTSIGNewParams` - `AccountID param.Field[string]` Path param - `TSIG param.Field[TSIG]` Body param ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.New(context.TODO(), dns.ZoneTransferTSIGNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), TSIG: dns.TSIGParam{ Algo: cloudflare.F("hmac-sha512."), Name: cloudflare.F("tsig.customer.cf."), Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Update TSIG `client.DNS.ZoneTransfers.TSIGs.Update(ctx, tsigID, params) (*TSIG, error)` **put** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Modify TSIG. ### Parameters - `tsigID string` - `params ZoneTransferTSIGUpdateParams` - `AccountID param.Field[string]` Path param - `TSIG param.Field[TSIG]` Body param ### Returns - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Update( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), TSIG: dns.TSIGParam{ Algo: cloudflare.F("hmac-sha512."), Name: cloudflare.F("tsig.customer.cf."), Secret: cloudflare.F("caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a", "algo": "hmac-sha512.", "name": "tsig.customer.cf.", "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c" } } ``` ## Delete TSIG `client.DNS.ZoneTransfers.TSIGs.Delete(ctx, tsigID, body) (*ZoneTransferTSIGDeleteResponse, error)` **delete** `/accounts/{account_id}/secondary_dns/tsigs/{tsig_id}` Delete TSIG. ### Parameters - `tsigID string` - `body ZoneTransferTSIGDeleteParams` - `AccountID param.Field[string]` ### Returns - `type ZoneTransferTSIGDeleteResponse struct{…}` - `ID string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/dns" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) tsig, err := client.DNS.ZoneTransfers.TSIGs.Delete( context.TODO(), "69cd1e104af3e6ed3cb344f263fd0d5a", dns.ZoneTransferTSIGDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", tsig.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "69cd1e104af3e6ed3cb344f263fd0d5a" } } ``` ## Domain Types ### TSIG - `type TSIG struct{…}` - `ID string` - `Algo string` TSIG algorithm. - `Name string` TSIG key name. - `Secret string` TSIG secret.