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 URL field on API responses that provides the NetBox UI URL to an object #15156

Closed
ITJamie opened this issue Feb 14, 2024 · 4 comments · Fixed by #16412
Closed

Add URL field on API responses that provides the NetBox UI URL to an object #15156

ITJamie opened this issue Feb 14, 2024 · 4 comments · Fixed by #16412
Assignees
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@ITJamie
Copy link
Contributor

ITJamie commented Feb 14, 2024

NetBox version

4.0.2

Feature type

New functionality

Proposed functionality

When using the Rest API the URL field on objects has direct API URLs.
It would be great if there was a display_url or ui_url to use when referencing the object in external tools.

Removing /api from the the existing url field on API response doesn't always work to get to a valid UI URL.

This could be an optional non-default field that could be requested if needed now that #15087 is possible.

examples of what this could look like:

VM API response:

{
    "id": 361,
    "url": "https://demo.netbox.dev/api/virtualization/virtual-machines/361/",
    "ui_url": "https://demo.netbox.dev/virtualization/virtual-machines/361/",
    "display": "vm1",
    "name": "vm1",
 <truncated>

VM Disk response:

{
    "id": 1,
    "url": "https://demo.netbox.dev/api/virtualization/virtual-disks/1/",
    "ui_url: "https://demo.netbox.dev/virtualization/disks/1/",
    "display": "disk1",
 <truncated>

Use case

When using the API sometimes we send slack alerts or emails for specific issues we find with data for a human to visit and interfact with / fix.

With most objects we can strip /api from the URL and give that URL to users, however not all objects follow that (e.g. virtual disks on VMs)

Example:

  • UI URL: http://netbox_instance/virtualization/disks/1/
  • API URL: http://netbox_instance/api/virtualization/virtual-disks/1/

Database changes

N/A

External dependencies

N/A

@ITJamie ITJamie added the type: feature Introduction of new functionality to the application label Feb 14, 2024
@jeremystretch jeremystretch added the status: needs triage This issue is awaiting triage by a maintainer label Mar 26, 2024
@jeremystretch
Copy link
Member

jeremystretch commented Apr 4, 2024

@ITJamie could you please make another pass over your original request for readability. I think I get the gist, but we need to uphold a minimum standard for grammar and punctuation. (Please rewrite the issue title as well.)

Additionally, "feature branch" is not a valid version. Please indicate a specific NetBox release.

@jeremystretch jeremystretch added status: revisions needed This issue requires additional information to be actionable and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 4, 2024
@jeffgdotorg jeffgdotorg changed the title additional url field on api responses that has the ui url to an object Provide additional URL field on API responses that have the NetBox UI URL to an object May 17, 2024
@jeffgdotorg jeffgdotorg changed the title Provide additional URL field on API responses that have the NetBox UI URL to an object Add URL field on API responses that provides the NetBox UI URL to an object May 17, 2024
@jeffgdotorg
Copy link
Contributor

Hey @ITJamie, I've just made some copy-edits to your title and issue body so that we can get this FR into the product backlog. I wasn't able to puzzle out the meaning of Feature branch as the version, though; would you please change that to a current release which includes the work from #15087?

@jeffgdotorg jeffgdotorg self-assigned this May 17, 2024
@ITJamie
Copy link
Contributor Author

ITJamie commented May 18, 2024

updated further with an example of possible API response

@jeffgdotorg jeffgdotorg added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: revisions needed This issue requires additional information to be actionable labels May 20, 2024
@jeffgdotorg jeffgdotorg removed their assignment May 20, 2024
@jeffgdotorg
Copy link
Contributor

Thanks for the update @ITJamie. Since this work will involve adding new API response fields, we'll need to schedule it for a minor-version boundary, hence needs milestone status.

@jeremystretch jeremystretch added status: backlog Awaiting selection for work complexity: low Requires minimal effort to implement labels May 21, 2024
@jeffgdotorg jeffgdotorg added this to the v4.1 milestone May 31, 2024
@arthanson arthanson self-assigned this Jun 4, 2024
@jeffgdotorg jeffgdotorg removed the needs milestone Awaiting prioritization for inclusion with a future NetBox release label Jun 7, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: backlog Awaiting selection for work labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants