REST API: GET a cable by providing termination ids and termination types #7394
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v3.0.0
Feature type
Data model extension
Proposed functionality
There are currently ~ 2500 cables within our netbox instance and it is going to grow rapidly in near future.
Current version of Netbox API does not offer possibility to get / filter cable(s) using termination values (id, type).
To create / update a cable, we firstly need check if there is already cable exsiting with given data below:
For that we need execute GET request to obtain all cables from Netbox API and then execute search in obtained data additionally.
Benchmarks:
with default values for limit and offset to GET cables:
curl -s -X GET -H "Authorization: Token $TOKEN" -H "Content-Type: application/json" https://my_netbox_instance/api/dcim/cables/?limit=50&offset50
real 0m2,236s
user 0m0,000s
sys 0m0,062s
GET all cables, limit=0:
curl -s -X GET -H "Authorization: Token $TOKEN" -H "Content-Type: application/json" https://my_netbox_instance/api/dcim/cables/?limit=0
real 0m47,855s
user 0m0,015s
sys 0m0,046s
Use case
Netbox users will be able to search for certain cable with using parameters below:
GET request in Netbox API with these parameters should be faster in comparison with GET all cables.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: