How to use the pynetbox.lib.endpoint.DetailEndpoint function in pynetbox

To help you get started, we’ve selected a few pynetbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digitalocean / pynetbox / pynetbox / ipam.py View on Github external
>>> prefix.available_prefixes.list()
        [{u'prefix': u'10.1.1.44/30', u'vrf': None, u'family': 4}]


        Creating a single child prefix:

        >>> prefix = nb.ipam.prefixes.get(1)
        >>> new_prefix = prefix.available_prefixes.create(
        ...    {'prefix_length': 29}
        ...)
        >>> new_prefix['prefix']
        u'10.1.1.56/29'

        '''
        return DetailEndpoint(self, 'available-prefixes')
github digitalocean / pynetbox / pynetbox / ipam.py View on Github external
To create a single IP:

        >>> prefix = nb.ipam.prefixes.get(24)
        >>> prefix.available_ips.create()
        {u'status': 1, u'description': u'', u'nat_inside': None...}


        To create multiple IPs:

        >>> prefix = nb.ipam.prefixes.get(24)
        >>> create = prefix.available_ips.create([{} for i in range(2)])
        >>> len(create)
        2
        """
        return DetailEndpoint(self, 'available-ips')