aboutsummaryrefslogtreecommitdiff
path: root/clients/netbox/gql_dns_servers.go
diff options
context:
space:
mode:
Diffstat (limited to 'clients/netbox/gql_dns_servers.go')
-rw-r--r--clients/netbox/gql_dns_servers.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/clients/netbox/gql_dns_servers.go b/clients/netbox/gql_dns_servers.go
new file mode 100644
index 0000000..67b4ad6
--- /dev/null
+++ b/clients/netbox/gql_dns_servers.go
@@ -0,0 +1,47 @@
1package netbox
2
3const dnsServerGQLQuery = `fragment VMHostDetails on VMInterfaceType{
4 virtual_machine {
5 site {
6 name
7 }
8 }
9}
10
11fragment HostDetails on InterfaceType {
12 device {
13 site {
14 name
15 }
16 }
17}
18
19query {
20 ip_address_list(tag:"dns-server") {
21 address
22 assigned_object{
23 ...VMHostDetails
24 ...HostDetails
25 }
26 }
27}`
28
29type dnsServerGQLResponse struct {
30 Data struct {
31 AddressList []struct {
32 Address string `json:"address"`
33 AssignedObject struct {
34 VirtualMachine struct {
35 Site struct {
36 Name string `json:"name"`
37 } `json:"site"`
38 } `json:"virtual_machine"`
39 Device struct {
40 Site struct {
41 Name string `json:"name"`
42 } `json:"site"`
43 } `json:"device"`
44 } `json:"assigned_object"`
45 } `json:"ip_address_list"`
46 } `json:"data"`
47}