opentofu/vendor/github.com/Ensighten/udnssdk
James Bardin 339803b701 Fix readme.md -> README.md
git with ignorecasce and macOS with silly case handing conspiring to
miss a file rename.
2017-01-20 12:23:02 -05:00
..
passwordcredentials ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
account.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
alert.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
CHANGELOG.md ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
common.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
CONTRIBUTING.md ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
directional_pool.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
event.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
LICENSE ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
notification.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
probe.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
README.md Fix readme.md -> README.md 2017-01-20 12:23:02 -05:00
rrset.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
task.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
token_source.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00
udnssdk.go ultradns providers and improvements (#9788) 2016-12-15 16:28:34 +00:00

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/Ensighten/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