-
Notifications
You must be signed in to change notification settings - Fork 28
feat: adding telnet streamer support #302
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0e4ff99
telnet: adding telnet streamer support
vadvolo eac5728
telnet: update pb
vadvolo 8f385dd
telnet: grpc_sdk client
vadvolo bf12845
telnet: update server
vadvolo 86d8a90
telnet: update server
vadvolo 5b5876b
fixes
vadvolo de91886
fix gnetclisdk
vadvolo 75fa41b
update
vadvolo 0b9f296
Merge branch 'annetutil:main' into telnet-streamer
vadvolo ca4fb58
update proto files
vadvolo 5d74e76
downgrade proto-gen-go version
vadvolo 8817ebf
update go-mod go-sum
vadvolo 9782840
update go-mod go-sum
vadvolo a2bafbd
update docs
vadvolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Streamer Types | ||
|
|
||
| `gnetcli` supports different connection types (streamers) for connecting to network equipment: SSH, Telnet. | ||
|
|
||
| ## Supported Types | ||
|
|
||
| ### Unknown (StreamerType_unknown) | ||
| - **Value**: `0` | ||
| - **Description**: Unspecified connection type, server will determine based on port or default to SSH | ||
| - **Usage**: When not explicitly set | ||
|
|
||
| ### SSH (StreamerType_ssh) | ||
| - **Value**: `1` | ||
| - **Description**: Connection via SSH protocol (default when unknown) | ||
| - **Default port**: 22 | ||
| - **Features**: | ||
| - SSH tunnel support (ProxyJump) | ||
| - SSH Control Files support | ||
| - SSH Agent support | ||
| - Private key authentication | ||
| - SFTP for file transfers | ||
|
|
||
| ### Telnet (StreamerType_telnet) | ||
| - **Value**: `2` | ||
| - **Description**: Connection via Telnet protocol | ||
| - **Default port**: 23 | ||
| - **Features**: | ||
| - Plain text connection | ||
| - Username/password authentication | ||
| - Custom port support | ||
|
|
||
| ## API Usage | ||
|
|
||
| ### Via gRPC | ||
| The streamer type is specified in host parameters: | ||
|
|
||
| ```protobuf | ||
| message HostParams { | ||
| string host = 1; | ||
| Credentials credentials = 2; | ||
| int32 port = 3; | ||
| string device = 4; | ||
| string ip = 5; | ||
| StreamerType streamer_type = 6; // SSH or Telnet | ||
| } | ||
| ``` | ||
|
|
||
| ### Example Request | ||
| ```json | ||
| { | ||
| "host": "192.168.1.1", | ||
| "cmd": "show version", | ||
| "host_params": { | ||
| "streamer_type": 2, | ||
| "port": 23, | ||
| "credentials": { | ||
| "login": "admin", | ||
| "password": "password" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
| Note: `streamer_type: 2` for Telnet, `streamer_type: 1` for SSH, `streamer_type: 0` for unknown/auto-detect. | ||
|
|
||
| ## Choosing Streamer Type | ||
|
|
||
| ### SSH is recommended for: | ||
| - Modern network equipment | ||
| - Production environments where security is important | ||
| - Devices supporting cryptographic authentication | ||
| - Cases requiring file transfers | ||
|
|
||
| ### Telnet is suitable for: | ||
| - Legacy equipment without SSH support | ||
| - Lab and test environments | ||
| - Devices with limited computational resources | ||
| - Connection debugging and diagnostics | ||
|
|
||
| ## Default Configuration | ||
|
|
||
| If `streamer_type` is not explicitly specified, SSH is used as the more secure default option. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| """gnetcli SDK for Python""" | ||
|
|
||
| from .client import ( | ||
| Credentials, | ||
| File, | ||
| Gnetcli, | ||
| HostParams, | ||
| QA, | ||
| STREAMER_UNKNOWN, | ||
| STREAMER_SSH, | ||
| STREAMER_TELNET, | ||
| ) | ||
| from .exceptions import ( | ||
| DeviceConnectError, | ||
| GnetcliException, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "Credentials", | ||
| "File", | ||
| "Gnetcli", | ||
| "HostParams", | ||
| "QA", | ||
| "STREAMER_UNKNOWN", | ||
| "STREAMER_SSH", | ||
| "STREAMER_TELNET", | ||
| "DeviceConnectError", | ||
| "GnetcliException", | ||
| ] |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.