Python API modules

zsystem


zoautil_py.zsystem.apf(*args, **kwargs)


Description

  • Authorized Program Facility (APF) operations ZOAU apfadm utility python API.

Returns

  • stdout_response, stderr_response, rc.

Return type

  • ZOAUResponse object.

Other Parameters

  • opt (str) –

    • APF operation. Choices:
      • add - Add dataset
      • del - Remove dataset
      • set_dynamic - Set APF list format to DYNAMIC
      • set_static - Set APF list format to STATIC
      • check_format - Check APF list current format
      • list - Return APF list in JSON format.
      • Example: [{“format”: “DYNAMIC”}, {“header”: [‘<1st line>’, … ‘<5th line>’]}, {“vol”:”G2201D”, “ds”: “SYS1.LINKLIB”}, …]
  • dsname (str) – Dataset name (library) to be added/removed to/from APF list. This is required if opt is add or del.

  • volume (str) – The volume serial number that dsname resides on. If not provided, dsname has to be cataloged.

  • sms (bool) – Indicates that the library specified on the dsname parameter is managed by the storage management subsystem (SMS) If true, volume value will be ignored.

  • forceDynamic (bool) – Ensure APF list format is “DYNAMIC” before add/remove libraries.

  • persistent (dict) –

    • Add/remove a persistent entry to a dataset. Choices:
      • addDataset - The dataset be used to Persist the APF entry
      • delDataset - The dataset be used to Remove the APF entry
      • marker : Custom marker in “/*.*{mark}.**/ format
        • default: “/* {mark} MANAGED BLOCK <timestamp> */”
        • <timestamp> will be replaced with current time, format: “+%Y%m%d-%H%M%S”.
  • batch (list) – A list of dictionaries for adding/removing libraries. This is mutually exclusive with opt, dsname, volume, sms.

    • Can be used with persistent. The options are opt, dsname, volume and sms.
    • The description of the options are the same as above except opt options are add and del.
    • Example: [{‘opt’: ‘add’, ‘dsname’: ‘SOME.DATASET.DS1’},
    • {‘opt’: ‘del’, ‘dsname’: ‘SOME.DATASET.DS2’, ‘volume’: ‘VOL001’},
    • {‘opt’: ‘add’, ‘dsname’: ‘SOME.DATASET.DS3’, ‘sms’: True},
    • {‘opt’: ‘del’, ‘dsname’: ‘SOME.DATASET.DS4’, ‘volume’: ‘VOL005’}]
  • debug (bool) – Enable debug messages.

  • verbose (bool) – Enable verbose messages.



zoautil_py.zsystem.find_linklist(member, *args, **kwargs)


zoautil_py.zsystem.find_parmlib(member, *args, **kwargs)


Description

  • Find member in parmlib.

Returns

  • Library that contains member.

Return type

  • str

Parameters

  • member (str) – The member to search for.

Other Parameters

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.find_proclib(member, *args, **kwargs)


Description

  • Find member in proclib.

Returns

  • Library that contains member.

Return type

  • str

Parameters

  • member (str) – The member to search for.

Other Parameters

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.list_linklist(*args, **kwargs)


zoautil_py.zsystem.list_parmlib(*args, **kwargs)


Description

  • Return parmlib representation on system.

Returns

  • List of system's parmlib.

Return type

  • list[str]

Other Parameters

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.list_proclib(*args, **kwargs)


Description

  • Return proclib representation on system.

Returns

  • List of system's proclib.

Return type

  • list[str]

Other Parameters

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.read_console(options='-r', *args, **kwargs)


Description

  • Return the system console based on passed options.

Returns

  • Console output from z/OS system.

Return type

  • str

Parameters

  • options (str) –

    • List of options (shell format) to pass
      • -h - Syntax.
      • -r - (recent) Last ten minutes of data written to the log.
      • -l - Last hour of data written to the log.
      • -d - Last day of data written to the log.
      • -w - Last week of data written to the log.
      • -m - Last month of data written to the log.
      • -y - Last year of data written to the log.
      • -a - The entire log.

Other Parameters

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.search_parmlib(find, *args, **kwargs)


Description

  • Search parmlib for string.

Returns

  • Output of search (grep-like response).

Return type

  • str

Parameters

  • find (str) – The string to search for.

Other Parameters

  • ignore_case (bool) – Ignore case in search.

  • display_lines (bool) – Display the lines that contain found string.

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).



zoautil_py.zsystem.search_proclib(find, *args, **kwargs)


Description

  • Search proclib for string.

Returns

  • Output of search (grep-like response).

Return type

  • str

Parameters

  • find (str) – The string to search for.

Other Parameters

  • ignore_case (bool) – Ignore case in search.

  • display_lines (bool) – Display the lines that contain found string.

  • debug (bool) – Enable debug messages (best used with _function if available and read from ZOAUResponse.stderr_output).

  • verbose (bool) – Enable verbose messages (best used with _function if available and read from ZOAUResponse.stderr_output).