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 method to issue ssh commands #351

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

olamidepeterojo
Copy link
Contributor

@olamidepeterojo olamidepeterojo commented Jan 21, 2025

What It Does
Fixes #253

How to Test

Review Checklist
I certify that I have:

Additional Comments

@olamidepeterojo olamidepeterojo changed the title add method to issue ssh commands [WIP]add method to issue ssh commands Jan 24, 2025
@olamidepeterojo olamidepeterojo marked this pull request as draft January 24, 2025 06:48
@olamidepeterojo olamidepeterojo changed the title [WIP]add method to issue ssh commands add method to issue ssh commands Jan 26, 2025
@olamidepeterojo olamidepeterojo marked this pull request as ready for review January 26, 2025 17:44
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @olamidepeterojo,
Thank you so much for this contribution 🙏
I think this is going to be super helpful for users that want to script their Unix commands via the python sdk 🙏


Apologies for the delay on reviewing this. I just wanted to share that there are a few things that I still need test here 🙏

CHANGELOG.md Outdated
@@ -8,6 +8,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil

- Turning off logger at the class-constructor level [#316](https://github.com/zowe/zowe-client-python-sdk/issues/316)
- Added support for commonly used environmental variables, like `REQUESTS_CA_BUNDLE` and `CURL_CA_BUNDLE`. [#346](https://github.com/zowe/zowe-client-python-sdk/issues/346)
- Add method to issue SSH commands. [#253](https://github.com/zowe/zowe-client-python-sdk/issues/253)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move this to a new section above 1.0.0-dev22 with a ## Recent Changes header. 😋

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay will do so 😋

requirements.txt Outdated
@@ -3,6 +3,7 @@ deepmerge==1.1.0
jsonschema==4.17.3
PyYAML==6.0.1
requests==2.32.0
paramiko
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for choosing one of the recommended libraries mentioned by Timothy on the issue:

I'm wondering if we should lock this down to a specific version 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was thinking version 3.5.0 which is the latest version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding documentation with a small example script. 😋
I believe this will make it easier for people to adopt going forward 🙏

Curious if we should mention some of the possible limitations in the readme...

Perhaps with commands that change codepages, or how the paramiko package may handle special characters (e.g. ööö, 👍 , 🔟 )

What about encoding? 🤔

These are some ideas of things we should probably consider in this document 🙏

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And last but not least, we should probably update the `read-the-docs as part of this PR 🙏

"""

def __init__(self, connection: dict, log: bool = True):
super().__init__(connection, "/zosmf/restuss", logger_name=__name__, log=log)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the attempt at initializing the class 🙏
I'm afraidI couldn't find such endpoint on zosmf 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my apologies.../zosmf/restfiles/fs should do the trick of finding the endpoint 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review/QA
Development

Successfully merging this pull request may close these issues.

[zos-uss] Add method to issue SSH commands
2 participants