Assigning Contacts to DNS records.. #369
Replies: 3 comments 2 replies
-
Hi @ThomasADavis, that's interesting (as always :-)). I never tried it, but does this help you:
There's also
They look pretty similar but probably aren't - You could try either of them and see if that gets you going. |
Beta Was this translation helpful? Give feedback.
-
OK, just to preserve the conversation from Slack: Here's how to enable contact assignments for plugin models. Depending on how you create your URLs, there are two or three steps:
from netbox.models.features import ContactsMixin
...
class MyModel(ContactsMixin, NetBoxModel):
...
from utilities.views import register_model_view
from tenancy.views import ObjectContactsView
...
@register_model_view(MyModel, "contacts")
class MyModelContactsView(ObjectContactsView):
queryset = MyModel.objects.all()
...
from mymodel.views import MyModelContactsView
...
path("mymodels/<int:pk>/contacts/", MyModelContactsView.as_view(), name="mymodel_contacts"),
... |
Beta Was this translation helpful? Give feedback.
-
would these steps allow assigning contacts to dns records within the gui? |
Beta Was this translation helpful? Give feedback.
-
At my place of work, they have historically assigned a set of contacts to DNS records. This allows them to directly contact the requester(s)/tenants if something goes bad.
In netbox, contacts can be assigned to objects. For instance, ipam/ip-address ojbects can have a contact assigned to it, even though you can not do this on the IPAM web interfaces. You use the API to do this. This relationship does however show up on the IPAM/IPaddress page.
To assign contacts, you need an object_type, and an object_id. The id I can easily get - it's what returned from api calls. The object_type, for a dns record, I'm still looking for.. if it exists.
If it does exists, what is it?
If it doesn't exist, can a object_type for this type of operation be registered?
I currently assign contacts to IP addresses, but I'd like to be able to assign contacts to DNS records of all types.
Beta Was this translation helpful? Give feedback.
All reactions