zowe / zowe-client-python-sdk

Eclipse Public License 2.0
40 stars 28 forks source link

Support responseTimeout profile property for z/OSMF operations #334

Open pjfarleyiii opened 1 month ago

pjfarleyiii commented 1 month ago

The connection function only supports specific user name and password input and no way to use a secure profile name.

Provide either a new argument to the connection function or a new "profile_connect" function to connect to the remote system using a config.json profile with secure user credentials.

In the SDK documentation there does not seem to be any way to use a loaded profile to connect to the remote system.

The specific reason for this request is to allow the responseTimeout configuration parameter to govern how long the SDK functions wait for a response from the z/OS system since none of the SDK functions are documented to allow a timeout parameter to be supplied.

github-actions[bot] commented 1 month ago

Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 5 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.

t1m0thyj commented 1 month ago

Followed up on Zowe Discord:

There is a pre-release version of the Zowe Python SDK available on PyPI that can load connection info from V2 profiles in team config files. If you want to load secure properties like user/password that are stored in the OS keyring you'll also want to install the Secrets SDK.

To install these pre-release versions you need to pass the --pre flag to pip: pip install -U --pre zowe-python-sdk-bundle zowe.secrets_for_zowe_sdk

Here's a sample Python script that loads the default z/OSMF profile from zowe.config.json and uploads a local file to USS on the mainframe:

from zowe.core_for_zowe_sdk import ProfileManager
from zowe.zos_files_for_zowe_sdk import USSFiles

profile = ProfileManager().load(profile_name="zosmf")
uss_api = USSFiles(profile)
uss_api.upload("local.txt", "/u/users/ibmuser/remote.txt")

You are correct that the responseTimeout flag in zosmf profiles is not yet supported by the Python SDK. Thanks for filing an issue, we've added this enhancement request to our backlog 🙂

aadityasinha-dotcom commented 22 hours ago

Assign this issue to me :relaxed: