mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-16 05:41:13 +08:00
minor refactor
This commit is contained in:
28
cli/functions/dns.go
Normal file
28
cli/functions/dns.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package functions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/gravitl/netmaker/models"
|
||||
)
|
||||
|
||||
func GetDNS() *[]models.DNSEntry {
|
||||
return request[[]models.DNSEntry](http.MethodGet, "/api/dns", nil)
|
||||
}
|
||||
|
||||
func GetNodeDNS(networkName string) *[]models.DNSEntry {
|
||||
return request[[]models.DNSEntry](http.MethodGet, fmt.Sprintf("/api/dns/adm/%s/nodes", networkName), nil)
|
||||
}
|
||||
|
||||
func GetCustomDNS(networkName string) *[]models.DNSEntry {
|
||||
return request[[]models.DNSEntry](http.MethodGet, fmt.Sprintf("/api/dns/adm/%s/custom", networkName), nil)
|
||||
}
|
||||
|
||||
func GetNetworkDNS(networkName string) *[]models.DNSEntry {
|
||||
return request[[]models.DNSEntry](http.MethodGet, "/api/dns/adm/"+networkName, nil)
|
||||
}
|
||||
|
||||
func CreateDNS(networkName string, payload *models.DNSEntry) *models.DNSEntry {
|
||||
return request[models.DNSEntry](http.MethodPost, "/api/dns/"+networkName, payload)
|
||||
}
|
Reference in New Issue
Block a user