pyslk.search_raw

Contents

pyslk.search_raw#

pyslk.search_raw(search_string: str | None = None, group: str | int | None = None, user: str | int | None = None, name: str | None = None, partial: bool = False, return_type: int = 0) str | int | CompletedProcess#

Creates search and returns search id

Either group, user and/or name can be set or a search_string can be provided.

search_string has to be a valid JSON search string as described in the SLK-CLI manual. Simple double quotes have to be used in the JSON expression (no escaped double quotes, no escaped special characters).

Example for search_string:

search_string=’{“resources.mtime”: {“$gt”: “2021-09-02”}}’

Parameters:
  • search_string (str) – JSON search query string

  • group (str or int) – search for files belonging to the provided group name or GID

  • user (str or int) – search for files belonging to the provided username or UID

  • name (str) – search files having the provided name

  • partial (bool) – search for files with ‘partial file’ flag

  • return_type (int) – select between 0 (== str output), 1 (== exit code), 2 (subprocess output)

Returns:

stdout of the slk call

Return type:

Union[str, int, subprocess.CompletedProcess]