🚀 Add Explorer API (v2) support to pytfe - #136
Merged
Merged
Conversation
rigalGit
reviewed
Apr 27, 2026
rigalGit
reviewed
Apr 27, 2026
rigalGit
reviewed
Apr 27, 2026
- Unused TYPE is removed. - CSV header order fixed as per API response.
rigalGit
reviewed
Apr 28, 2026
rigalGit
left a comment
There was a problem hiding this comment.
Looks good, please check some minor comments.
isivaselvan
approved these changes
May 13, 2026
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.
📌 Description
This PR adds support for the HCP Terraform / Terraform Enterprise Explorer API (v2) to pytfe, exposed via:
The Explorer API enables organization-scoped visibility and analytics, including:
It also supports:
This implementation covers public v2 routes under:
✨ Changes Included
📦 Models
Added new Pydantic models:
src/pytfe/models/explorer.pyExported models via:
src/pytfe/models/__init__.py🔧 Resources
Added new resource:
Explorer→src/pytfe/resources/explorer.pyPagination aligned with existing
_Servicepatterns🧠 Client
Added:
in
src/pytfe/client.py❗ Errors
Introduced:
InvalidExplorerSavedViewIDErrorinsrc/pytfe/errors.py🧪 Tests
Added unit tests with mocked HTTP:
tests/units/test_explorer.py📘 Examples
Added usage example:
examples/explorer.py📝 Changelog
Updated:
CHANGELOG.mdunderv0.2.0 (Unreleased)🧪 Testing Plan
🔹 Local (No live cluster)
🔹 Optional (Live HCP Terraform / TFE)
Set environment variables:
Run:
Optional (Saved View flows)
Ensure:
🔄 Rollback Plan
Revert this PR from
mainRemoves:
client.explorer✅ No infra or migration rollback required
🔐 Changes to Security Controls
No changes in this repository
Authentication:
HTTPTransport+ bearer tokenAuthorization:
✅ PCI Review Checklist
🧾 CONTRIBUTING Checklist
make fmt)make lint)make type-check)make test)CHANGELOG.mdupdatedexamples/