Skip to content
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

Add AsnRanges.available_asns (for NetBox 3.5+) #542

Closed

Conversation

markkuleinio
Copy link
Contributor

Example:

>>> asn_range = nb.ipam.asn_ranges.get(1)
>>> asn_range
TestRange (65510-65512)
>>> pprint.pprint(dict(asn_range))
{'created': '2023-04-16T10:59:57.566139+03:00',
 'custom_fields': {},
 'description': '',
 'display': 'TestRange (65510-65512)',
 'end': 65512,
 'id': 1,
 'last_updated': '2023-04-16T11:13:15.835726+03:00',
 'name': 'TestRange',
 'rir': {'display': 'RFC1918',
         'id': 1,
         'name': 'RFC1918',
         'slug': 'rfc1918',
         'url': 'http://netbox-future.lein.io/api/ipam/rirs/1/'},
 'slug': 'testrange',
 'start': 65510,
 'tags': [],
 'tenant': None,
 'url': 'http://netbox-future.lein.io/api/ipam/asn-ranges/1/'}
>>> asn_range.available_asns
<pynetbox.core.endpoint.DetailEndpoint object at 0x7f0224cc9a58>
>>> asn_range.available_asns.list()
[65510, 65511, 65512]
>>>

@abhi1693
Copy link
Member

This will be superseded by #564 once that's merged.

@abhi1693 abhi1693 closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants