-
Notifications
You must be signed in to change notification settings - Fork 25
Add records to dns zone in graphql #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @kuon, this is a duplicate of #450. The relation is from record to zone, and the current implementation of Strawerry with NetBox unfortunately does not create the reverse relation. See also this NetBox issue. |
I saw #450 but I didn't realize it was the same issue as I thought the relation was zone->records. But it makes sense. Sorry for the duplicate. Thanks. |
No problem. I'll have a look at it later this week, maybe it will be possible to provide a workaround until netbox-community/netbox#17242 is resolved. At least for this issue, because we control both ends of the relation. #450 is different in that we don't have a chance there because one end is a core model. |
I just tried it, and it is possible to use the standard Django reverse relations and rename them so they make sense in GraphQL. Might take a couple of days because I'm quite busy atm, but it doesn't seem to be a big deal right now. |
There is no emergency, it is only performance optimization. Thank you a lot for your work. |
{
"data": {
"netbox_dns_zone_list": [
{
"name": "0.0.10.in-addr.arpa",
"view": {
"name": "_default_"
},
"records": [
{
"name": "@",
"type": "NS",
"value": "ns1.example.com."
},
{
"name": "@",
"type": "NS",
"value": "ns2.example.com."
},
{
"name": "@",
"type": "SOA",
"value": "ns1.example.com. hostmaster.example.com. 1722355158 172800 7200 2592000 3600"
},
... |
I'll work trough all the relations where this makes sense, and I still need to check how it affects automatic testing. |
I am using graphql to grab DNS data from netbox DNS, and at present I have to do N queries for zones.
Then for each zone:
Being able to do this:
Would greatly increase performances.
The text was updated successfully, but these errors were encountered: