I need to get all the VM name that I have in the virtualization part in Netbox.
I want to use an API call using requests module in python. I can't use pynetbox module as it doesn't fit my needs at the moment.
I have approximately 5500 VM registered in Netbox. I know it's a lot, and it'll go bigger and bigger in the time.
My issue is that the API call return only 1000 items, not all the item that are registered in Netbox.
Is this a limitation made by netbox's api ? Do you know how I can workaround that limitation ?
Here is the code I have tested so far. Pretty basic:
r = requests.get("https://netbox/api/virtualization/virtual-machines/?limit=10000", headers={"Authorization":"Token "+ token}, verify=False).json()
for vm in r['results']:
list_vm.append(vm['name'])
print(list_vm)
print(len(list_vm))
Basically, the print(len(list_vm)) return "1000" and not more.
Thank you for your help :)