Tso

class zos_tso.zowe.zos_tso_for_zowe_sdk.Tso(connection: dict[str, Any], tso_profile: dict[str, Any] | None = None, log: bool = True)

Class used to represent the base z/OSMF TSO API.

Parameters:
  • connection (dict[str, Any]) – Connection object

  • tso_profile (Optional[dict[str, Any]]) – Profile used for tso connection

  • log (bool) – Flag to disable logger

end(session_key: str) EndResponse

Terminates an existing TSO session.

Parameters:

session_key (str) – The session key of an existing TSO session

Returns:

A string informing if the session was terminated successfully or not

Return type:

EndResponse

end_tso_session(session_key: str) str

Terminates an existing TSO session.

Parameters:

session_key (str) – The session key of an existing TSO session

Returns:

A string informing if the session was terminated successfully or not

Return type:

str

issue_command(command: str) IssueResponse

Issue a TSO command.

This function will first initiate a TSO session, retrieve the session key, send the command and finally terminate the session

Parameters:

command (str) – TSO command to be executed

Returns:

A list containing the output from the TSO command

Return type:

IssueResponse

parse_message_ids(response_json: dict[str, Any]) list[str]

Parse TSO response and retrieve only the message ids.

Parameters:

response_json (dict[str, Any]) – The JSON containing the TSO response

Returns:

A list containing the TSO response message ids

Return type:

list[str]

ping_tso_session(session_key: str) str

Ping an existing TSO session and returns if it is still available.

Parameters:

session_key (str) – The session key of an existing TSO session

Returns:

A string informing if the ping was successful or not. Where the options are: ‘Ping successful’ or ‘Ping failed’

Return type:

str

retrieve_tso_messages(response_json: list[dict[str, Any]]) list[str]

Parse the TSO response and retrieve all messages.

Parameters:

response_json (list[dict[str, Any]]) – The JSON containing the TSO response

Returns:

A list containing the TSO response messages

Return type:

list[str]

send(session_key: str, message: str, read_reply: bool = True) SendResponse

Send a command to an existing TSO session.

Parameters:
  • session_key (str) – The session key of an existing TSO session

  • message (str) – The message/command to be sent to the TSO session

  • read_reply (bool) – Whether to read the reply from the TSO session

Returns:

A non-normalized list from TSO containing the result from the command

Return type:

SendResponse

send_tso_message(session_key: str, message: str) list[dict[str, Any]]

Send a command to an existing TSO session.

Parameters:
  • session_key (str) – The session key of an existing TSO session

  • message (str) – The message/command to be sent to the TSO session

Returns:

A non-normalized list from TSO containing the result from the command

Return type:

list[dict[str, Any]]

start(proc: str | None = None, chset: str | None = None, cpage: str | None = None, rows: str | None = None, cols: str | None = None, rsize: str | None = None, acct: str | None = None) StartResponse

Start a TSO session.

Parameters:
  • proc (Optional[str]) – Proc parameter for the TSO session (default is “IZUFPROC”)

  • chset (Optional[str]) – Chset parameter for the TSO session (default is “697”)

  • cpage (Optional[str]) – Cpage parameter for the TSO session (default is “1047”)

  • rows (Optional[str]) – Rows parameter for the TSO session (default is “204”)

  • cols (Optional[str]) – Cols parameter for the TSO session (default is “160”)

  • rsize (Optional[str]) – Rsize parameter for the TSO session (default is “4096”)

  • acct (Optional[str]) – Acct parameter for the TSO session (default is “DEFAULT”)

Returns:

The ‘servletKey’ key for the created session (if successful)

Return type:

StartResponse

start_tso_session(proc: str | None = None, chset: str | None = None, cpage: str | None = None, rows: str | None = None, cols: str | None = None, rsize: str | None = None, acct: str | None = None) str

Start a TSO session.

Parameters:
  • proc (Optional[str]) – Proc parameter for the TSO session (default is “IZUFPROC”)

  • chset (Optional[str]) – Chset parameter for the TSO session (default is “697”)

  • cpage (Optional[str]) – Cpage parameter for the TSO session (default is “1047”)

  • rows (Optional[str]) – Rows parameter for the TSO session (default is “204”)

  • cols (Optional[str]) – Cols parameter for the TSO session (default is “160”)

  • rsize (Optional[str]) – Rsize parameter for the TSO session (default is “4096”)

  • acct (Optional[str]) – Acct parameter for the TSO session (default is “DEFAULT”)

Returns:

The ‘servletKey’ key for the created session (if successful)

Return type:

str