# README
udnssdk - An UltraDNS SDK for Go
This is a golang SDK for the UltraDNS REST API. It's not feature complete, and currently is only known to be used for Terraform's ultradns
provider.
Full API docs are available at godoc
Example
package main
import (
"fmt"
"log"
"github.com/terra-farm/udnssdk"
)
func main() {
client := udnssdk.NewClient("username", "password", udnssdk.DefaultTestBaseURL)
if client == nil {
log.Fatalf("Failed to create client")
}
fmt.Printf("---- Query RRSets\n")
rrsetkey := RRSetKey{
Zone: "domain.com",
Type: "ANY",
Name: "",
}
rrsets, err := client.RRSets.Select(rrsetkey)
if err != nil {
log.Fatalf(err)
}
fmt.Printf("%+v\n", rrsets)
fmt.Printf("---- Create RRSet\n")
rrsetkey = RRSetKey{
Zone: "domain.com",
Type: "A",
Name: "test",
}
rrset := udnssdk.RRSet{
OwnerName: r.Name,
RRType: r.Type,
TTL: 300,
RData: []string{"127.0.0.1"},
}
resp, err := client.RRSets.Create(rrsetkey, rrset)
if err != nil {
log.Fatalf(err)
}
fmt.Printf("Response: %+v\n", resp)
fmt.Printf("---- Update RRSet\n")
rrset = udnssdk.RRSet{
OwnerName: r.Name,
RRType: r.Type,
TTL: 300,
RData: []string{"127.0.0.2"},
}
resp, err := client.RRSets.Update(rrsetkey, rrset)
if err != nil {
log.Fatalf(err)
}
fmt.Printf("Response: %+v\n", resp)
fmt.Printf("---- Delete RRSet\n")
resp, err := client.RRSets.Delete(rrsetkey)
if err != nil {
log.Fatalf(err)
}
fmt.Printf("Response: %+v\n", resp)
}
Thanks
- Originally started as a modified version of weppos/go-dnsimple
- Designed to add UltraDNS support to terraform
- And for other languages, be sure to check out UltraDNS's various SDKs
# Functions
AccountsURI generates the URI for Accounts collection.
CheckResponse checks the API response for errors, and returns them if present.
Endpoint returns an oauth2.Endpoint for UltraDNS.
NewClient returns a new ultradns API client.
NewConfig creates a new *password.config for UltraDNS OAuth2.
TasksQueryURI generates the query URI for the tasks collection given a query and offset.
TokenURL returns an OAuth2 TokenURL for UltraDNS.
# Constants
DefaultLiveBaseURL returns the URL for UltraDNS's production restapi endpoint.
DefaultTestBaseURL returns the URL for UltraDNS's test restapi endpoint.
DirPoolSchema is the schema URI for a Directional pool profile.
Here lie all the possible ProbeType values.
Here lie all the possible ProbeType values.
Here lie all the possible ProbeType values.
Here lie all the possible ProbeType values.
RDPoolSchema is the schema URI for a Resource Distribution pool profile.
SBPoolSchema is the schema URI for a SiteBacker pool profile.
Here lie all the possible ProbeType values.
Here lie all the possible ProbeType values.
TCPoolSchema is the schema URI for a Traffic Controller pool profile.
Here lie all the possible ProbeType values.
# Structs
Account represents responses from the service.
AccountLevelGeoDirectionalGroupDTO wraps an account-level, geo directonal-group response.
AccountLevelGeoDirectionalGroupListDTO wraps a list of account-level, geo directional-groups response from a index request.
AccountLevelIPDirectionalGroupDTO wraps an account-level, IP directional-group response.
AccountLevelIPDirectionalGroupListDTO wraps an account-level, IP directional-group response.
AccountListDTO represents a account index response.
AccountsService provides access to account resources.
AlertsService manages Alerts.
BackupRecord wraps the backupRecord objects of an SBPoolProfile response.
Client wraps our general-purpose Service Client.
DirectionalPool wraps an account-level directional-groups response from a index request.
DirectionalPoolKey collects the identifiers of a DirectionalPool.
DirectionalPoolListDTO wraps a list of account-level directional-groups response from a index request.
DirectionalPoolsService manages 'account level' 'geo' and 'ip' groups for directional-pools.
DirPoolProfile wraps a Profile for a Directional Pool.
DNSProbeDetailsDTO wraps DNS probe details.
DPRDataInfo wraps the rdataInfo object of a DirPoolProfile response.
ErrorResponse represents an error caused by an API request.
ErrorResponseList wraps an HTTP response that has a list of errors.
EventInfoDTO wraps an event's info response.
EventInfoListDTO wraps a list of event info and list metadata, from an index request.
EventKey collects the identifiers of an Event.
EventsService manages Events.
FTPProbeDetailsDTO wraps FTP probe details.
GeoDirectionalPoolKey collects the identifiers of an DirectionalPool with type Geo.
GeoDirectionalPoolsService manages 'geo' groups for directional-pools.
GeoInfo wraps the geoInfo object of a DPRDataInfo.
HTTPProbeDetailsDTO wraps HTTP probe details.
IPAddrDTO wraps an IP address range or CIDR block.
IPDirectionalPoolKey collects the identifiers of an DirectionalPool with type IP.
IPDirectionalPoolsService manages 'geo' groups for directional-pools.
IPInfo wraps the ipInfo object of a DPRDataInfo.
NotificationDTO manages notifications.
NotificationInfoDTO does things unknown.
NotificationKey collects the identifiers of an Notification.
NotificationListDTO does things unknown.
NotificationPoolRecord does things unknown.
NotificationsService manages Probes.
PingProbeDetailsDTO wraps Ping probe details.
ProbeAlertDataDTO wraps a probe alert response.
ProbeAlertDataListDTO wraps the response for an index of probe alerts.
ProbeDetailsDTO wraps the details of a probe.
ProbeDetailsLimitDTO wraps a probe.
ProbeInfoDTO wraps a probe response.
ProbeKey collects the identifiers of a Probe.
ProbeListDTO wraps a list of probes.
ProbesService manages Probes.
QueryInfo wraps a query request.
RDPoolProfile wraps a Profile for a Resource Distribution pool.
ResultInfo wraps the list metadata for an index response.
RRSet wraps an RRSet resource.
RRSetKey collects the identifiers of a Zone.
RRSetListDTO wraps a list of RRSet resources.
RRSetsService provides access to RRSet resources.
SBPoolProfile wraps a Profile for a SiteBacker pool.
SBRDataInfo wraps the rdataInfo object of a SBPoolProfile.
SMTPProbeDetailsDTO wraps SMTP probe details.
SMTPSENDProbeDetailsDTO wraps SMTP SEND probe details.
Task wraps a task response.
TaskListDTO wraps a list of Task resources, from an HTTP response.
TasksService provides access to the tasks resources.
TCPoolProfile wraps a Profile for a Traffic Controller pool.
TCPProbeDetailsDTO wraps TCP probe details.
Transaction wraps a transaction response.
# Type aliases
AccountKey represents the string identifier of an Account.
ProbeType wraps the possible types of a ProbeInfoDTO.
ProfileSchema are the schema URIs for RRSet Profiles.
RawProfile represents the naive interface to an RRSet Profile.
TaskID represents the string identifier of a task.