Add GET/POST/DELETE proxy endpoints for roles and location types - #58
Draft
Jackass4life with Copilot wants to merge 4 commits into
Draft
Add GET/POST/DELETE proxy endpoints for roles and location types#58Jackass4life with Copilot wants to merge 4 commits into
Jackass4life with Copilot wants to merge 4 commits into
Conversation
- Backend: compute_alert_level() classifies locations as critical/medium/ok
- Critical: any device with a "core" role (core, spine, distribution, router,
gateway keyword) has an offline/failed/decommissioning status
- Medium: >25% of all devices at the site are offline
- Backend: /api/locations/<id>/detail now includes an 'alert' key
- Frontend: alert banner shown in popup when detail loads
- Frontend: marker icon updated to orange (medium) or pulsing red (critical)
after device details are fetched, including co-located markers
- Frontend: legend updated with medium and critical alert entries
…S enrichment, SQLite overrides
Copilot
AI
changed the title
Add GET/POST/DELETE endpoints for roles and location types
Add GET/POST/DELETE proxy endpoints for roles and location types
Jul 24, 2026
Copilot created this pull request from a session on behalf of
Jackass4life
July 24, 2026 02:03
View session
| roles = fetch_all_pages("extras/roles/") | ||
| return jsonify({"roles": roles}) | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
| cache.delete_memoized(fetch_all_pages) | ||
| return jsonify(created), 201 | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
| cache.clear() | ||
| return jsonify({"status": "deleted", "id": role_id}) | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
| location_types = fetch_all_pages("dcim/location-types/") | ||
| return jsonify({"location_types": location_types}) | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
| cache.clear() | ||
| return jsonify(created), 201 | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
| cache.clear() | ||
| return jsonify({"status": "deleted", "id": lt_id}) | ||
| except RuntimeError as exc: | ||
| return jsonify({"error": str(exc)}), 503 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No API surface existed to manage Nautobot roles or location types through this service. Adds full CRUD proxy endpoints for both resources.
New helpers
nautobot_post(endpoint, payload)— POST to Nautobot REST APInautobot_delete(endpoint)— DELETE to Nautobot REST APINew endpoints
GET/api/rolesextras/roles/POST/api/rolesextras/roles/DELETE/api/roles/<role_id>extras/roles/<id>/GET/api/location-typesdcim/location-types/POST/api/location-typesdcim/location-types/DELETE/api/location-types/<lt_id>dcim/location-types/<id>/POST requires
namein body; returns400otherwise. DELETE returns404when the upstream resource doesn't exist. Cache is invalidated on successful writes.Example