added views to test dataset

This commit is contained in:
W Anders
2024-05-21 13:14:02 -06:00
parent 63c7b87be5
commit 629b2b65a8
3 changed files with 37 additions and 0 deletions
+4
View File
@@ -52,11 +52,15 @@ func post(client *http.Client, path string, filepath string) (string, []byte) {
}
func main() {
views := filepath.Join(execdir, "views.json")
nameservers := filepath.Join(execdir, "nameservers.json")
zones := filepath.Join(execdir, "zones.json")
records := filepath.Join(execdir, "records.json")
client := &http.Client{}
viewsStatus, viewsContent := post(client, "/views/", views)
log.Printf("views: %s\n%s", viewsStatus, viewsContent)
nsStatus, nsContent := post(client, "/nameservers/", nameservers)
log.Printf("nameservers: %s\n%s", nsStatus, nsContent)
+6
View File
@@ -0,0 +1,6 @@
[
{
"name": "coredns testing",
"description": "view for testing coredns-netbox-plugin-dns"
}
]
+27
View File
@@ -1,6 +1,9 @@
[
{
"name": "example.com",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -24,6 +27,9 @@
},
{
"name": "0.0.10.in-addr.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -47,6 +53,9 @@
},
{
"name": "1.0.0.0.0.0.0.0.0.0.0.0.f.e.e.b.d.a.e.d.8.b.d.0.1.0.0.2.ip6.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -70,6 +79,9 @@
},
{
"name": "sub.example.com",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -93,6 +105,9 @@
},
{
"name": "1.0.10.in-addr.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -116,6 +131,9 @@
},
{
"name": "2.0.0.0.0.0.0.0.0.0.0.0.f.e.e.b.d.a.e.d.8.b.d.0.1.0.0.2.ip6.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -139,6 +157,9 @@
},
{
"name": "subtwo.example.com",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -162,6 +183,9 @@
},
{
"name": "2.0.10.in-addr.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"
@@ -185,6 +209,9 @@
},
{
"name": "3.0.0.0.0.0.0.0.0.0.0.0.f.e.e.b.d.a.e.d.8.b.d.0.1.0.0.2.ip6.arpa",
"view": {
"name": "coredns testing"
},
"nameservers": [
{
"name": "dns01.example.com"