Ssh-iterator pattern added#101
Merged
isivaselvan merged 7 commits intoMar 13, 2026
Merged
Conversation
isivaselvan
reviewed
Mar 12, 2026
| # Local RSA keys | ||
| .local/* | ||
|
|
||
| terraform_key* |
Collaborator
There was a problem hiding this comment.
why these were added to the .gitignore?
Contributor
Author
There was a problem hiding this comment.
updated gitignore
isivaselvan
approved these changes
Mar 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.
Refactored SSH Keys resource to implement iterator pattern for listing operations, providing better memory efficiency and consistent API behavior across the SDK.
Changed list() method to return iterator[SSHkey] instead of SSHKeyList
Implemented lazy evaluation using list() helper method for automatic pagination.
In Examples
Updated listing to use iterator pattern with for-loop
Replaced pagination object return with generator-style iteration
Demonstrated practical usage of iterator with pagination options
Simplified code by removing manual list length tracking
and updated Test Files

All 8 tests passing
!
achments/assets/fdb07a89-a857-43bb-a6cc-90837abb5207)
SSH Keys API Example for organization: prab-sandbox01
Found 1 SSH keys
Creating a new SSH key...
Created SSH key: sshkey-Y6fCsxdmSv94VqYZ - Python TFE Example SSH Key
Reading the SSH key...
Read SSH key: sshkey-Y6fCsxdmSv94VqYZ - Python TFE Example SSH Key
Updating the SSH key...
Updated SSH key: sshkey-Y6fCsxdmSv94VqYZ - Updated Python TFE Example SSH Key
Deleting the SSH key...
Deleted SSH key: sshkey-Y6fCsxdmSv94VqYZ
Verifying deletion...
SSH keys after deletion: 1
Demonstrating iterator with pagination options...
- test-key-20251217-192455
Listed 1 keys with pagination options
SSH Keys API example completed successfully!
(.venv) nimishashrivastava@dhcp-9-124-203-8 python-tfe %
SSH Keys API Example for organization: prab-sandbox01
Found 3 SSH keys
Creating a new SSH key...
Created SSH key: sshkey-GYqnR1bSBvr25Bfp - Python TFE Example SSH Key
Reading the SSH key...
Read SSH key: sshkey-GYqnR1bSBvr25Bfp - Python TFE Example SSH Key
Updating the SSH key...
Updated SSH key: sshkey-GYqnR1bSBvr25Bfp - Updated Python TFE Example SSH Key
Deleting the SSH key...
Deleted SSH key: sshkey-GYqnR1bSBvr25Bfp
Verifying deletion...
SSH keys after deletion: 3
Demonstrating iterator with pagination options...
- test-key-20251217-192455
- terraform-ssh-key
- terraform_key_2
Listed 3 keys with pagination options
SSH Keys API example completed successfully!
(.venv) nimishashrivastava@dhcp-9-124-203-8 python-tfe %