1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add ip_addresses relation on InterfaceType, VMInterfaceType

This commit is contained in:
jeremystretch
2021-08-03 09:54:06 -04:00
parent 8bdfa34c7d
commit 0df67dbc12
4 changed files with 22 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
import graphene
__all__ = (
'IPAddressesMixin',
)
class IPAddressesMixin:
ip_addresses = graphene.List('ipam.graphql.types.IPAddressType')
def resolve_ip_addresses(self, info):
return self.ip_addresses.restrict(info.context.user, 'view')