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

REST API: GET a cable by providing termination ids and termination types #7394

Closed
rmammadli opened this issue Sep 29, 2021 · 1 comment
Closed
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@rmammadli
Copy link

rmammadli commented Sep 29, 2021

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:

  • termination_a_id
  • termination_a_type
  • termination_b_id
  • termination_b_type

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:

  • termination_a_id
  • termination_a_type
  • termination_b_id
  • termination_b_type

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

@rmammadli rmammadli added the type: feature Introduction of new functionality to the application label Sep 29, 2021
@rmammadli rmammadli changed the title GET a cable by providing termination ids and termination types REST API: GET a cable by providing termination ids and termination types Sep 29, 2021
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Sep 30, 2021
@jeremystretch jeremystretch self-assigned this Oct 6, 2021
@rmammadli
Copy link
Author

Thank you very much @jeremystretch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants