https://github.com/libdns/totaluptime
https://github.com/libdns/totaluptime
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/libdns/totaluptime
- Owner: libdns
- License: mit
- Created: 2022-12-05T18:57:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T18:45:55.000Z (over 3 years ago)
- Last Synced: 2024-04-16T00:13:11.566Z (about 2 years ago)
- Language: Go
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Total Uptime for [`libdns`](https://github.com/libdns/libdns)
=======================
[](https://pkg.go.dev/github.com/libdns/totaluptime)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for Total Uptime, allowing you to manage DNS records.
## Authenticating
This package supports basic authentication with Total Uptime's API. It's recommended that you create a role and user specific to API use, so that you can ensure least-privilege access to the account. Listed below are the steps to achieve this using Total Uptime's management portal:
* Settings -> Roles & Security -> Role Management -> Add
* Name: **API_User_Role**
* DNS: **Enabled**
* Information: **Read**
* Domains: **Full**
* *(all other access set to "Disabled")*
* Settings -> Users -> Add
* First Name: **API**
* Last Name: **User**
* User Name (Email): **apiuser@mydomain.com** *(can be anything and does not need to receive mail)*
* Active: **[ X ]** *(checked)*
* Role: **API_User_Role**
* API Account: **[ X ]** *(checked)*
## Example
Here's a minimal example of how to list all DNS records using this `libdns` provider (see `examples/main.go` for more examples)
```go
package main
import (
"context"
"fmt"
"log"
"github.com/libdns/totaluptime"
)
func main() func main() {
provider := totaluptime.Provider{
Username: "USERNAME", // provider API username
Password: "PASSWORD", // provider API password
}
zone := "DNS_ZONE" // zone in provider account
ctx := context.Background()
result, err := provider.GetRecords(ctx, zone)
if err != nil {
log.Fatalln(err)
}
fmt.Println(result)
}
```