Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>>> 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')
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')