Tso

class zos_tso.zowe.zos_tso_for_zowe_sdk.Tso(connection, tso_profile=None)

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

connection

Connection object

session_not_found

Constant for the session not found tso message id

end_tso_session(session_key)

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)

Issues 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:

list

parse_message_ids(response_json)

Parse TSO response and retrieve only the message ids.

Parameters:

response_json (dict) – The JSON containing the TSO response

Returns:

A list containing the TSO response message ids

Return type:

list

ping_tso_session(session_key)

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)

Parse the TSO response and retrieve all messages.

Parameters:

response_json (dict) – The JSON containing the TSO response

Returns:

A list containing the TSO response messages

Return type:

list

send_tso_message(session_key, message)

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

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

Start a TSO session.

Parameters:
  • proc (str, optional) – Proc parameter for the TSO session (default is “IZUFPROC”)

  • chset (str, optional) – Chset parameter for the TSO session (default is “697”)

  • cpage (str, optional) – Cpage parameter for the TSO session (default is “1047”)

  • rows (str, optional) – Rows parameter for the TSO session (default is “204”)

  • cols (str, optional) – Cols parameter for the TSO session (default is “160”)

  • rsize (str, optional) – Rsize parameter for the TSO session (default is “4096”)

  • str (acctL) – Acct parameter for the TSO session (default is “DEFAULT”)

  • optional – Acct parameter for the TSO session (default is “DEFAULT”)

Returns:

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

Return type:

str