|
7 | 7 | def find_apps( |
8 | 8 | t: Tapis, search_term: str, list_type: str = "ALL", verbose: bool = True |
9 | 9 | ) -> List[Tapis]: |
10 | | - """ |
11 | | - Search for Tapis apps matching a search term. |
| 10 | + """Search for Tapis apps matching a search term. |
| 11 | +
|
| 12 | + Searches through available Tapis applications using partial name matching. |
| 13 | + This function helps discover applications available for job submission. |
12 | 14 |
|
13 | 15 | Args: |
14 | | - t: Authenticated Tapis client instance. |
15 | | - search_term: Name or partial name to search for. Use "" for all. |
16 | | - list_type: One of 'OWNED', 'SHARED_PUBLIC', 'SHARED_DIRECT', 'READ_PERM', 'MINE', 'ALL'. |
17 | | - verbose: If True, prints summary of found apps. |
| 16 | + t (Tapis): Authenticated Tapis client instance. |
| 17 | + search_term (str): Name or partial name to search for. Use empty string |
| 18 | + for all apps. Supports partial matching with wildcards. |
| 19 | + list_type (str, optional): Type of apps to list. Must be one of: |
| 20 | + 'OWNED', 'SHARED_PUBLIC', 'SHARED_DIRECT', 'READ_PERM', 'MINE', 'ALL'. |
| 21 | + Defaults to "ALL". |
| 22 | + verbose (bool, optional): If True, prints summary of found apps including |
| 23 | + ID, version, and owner information. Defaults to True. |
18 | 24 |
|
19 | 25 | Returns: |
20 | | - List of matching Tapis app objects. |
| 26 | + List[Tapis]: List of matching Tapis app objects with selected fields |
| 27 | + (id, version, owner). |
21 | 28 |
|
22 | 29 | Raises: |
23 | | - AppDiscoveryError: If the search fails. |
| 30 | + AppDiscoveryError: If the Tapis API search fails or an unexpected |
| 31 | + error occurs during the search operation. |
| 32 | +
|
| 33 | + Example: |
| 34 | + >>> find_apps(client, "matlab", verbose=True) |
| 35 | + Found 3 matching apps: |
| 36 | + - matlab-r2023a (Version: 1.0, Owner: designsafe) |
| 37 | + - matlab-parallel (Version: 2.1, Owner: tacc) |
| 38 | + - matlab-desktop (Version: 1.5, Owner: designsafe) |
24 | 39 | """ |
25 | 40 | try: |
26 | 41 | # Use id.like for partial matching, ensure search term is handled |
@@ -53,20 +68,35 @@ def find_apps( |
53 | 68 | def get_app_details( |
54 | 69 | t: Tapis, app_id: str, app_version: Optional[str] = None, verbose: bool = True |
55 | 70 | ) -> Optional[Tapis]: |
56 | | - """ |
57 | | - Get detailed information for a specific app ID and version (or latest). |
| 71 | + """Get detailed information for a specific app ID and version. |
| 72 | +
|
| 73 | + Retrieves comprehensive details about a specific Tapis application, |
| 74 | + including job attributes, execution system, and parameter definitions. |
58 | 75 |
|
59 | 76 | Args: |
60 | | - t: Authenticated Tapis client instance. |
61 | | - app_id: Exact app ID to look up. |
62 | | - app_version: Specific app version. If None, fetches the latest version. |
63 | | - verbose: If True, prints basic app info. |
| 77 | + t (Tapis): Authenticated Tapis client instance. |
| 78 | + app_id (str): Exact app ID to look up. Must match exactly. |
| 79 | + app_version (Optional[str], optional): Specific app version to retrieve. |
| 80 | + If None, fetches the latest available version. Defaults to None. |
| 81 | + verbose (bool, optional): If True, prints basic app information including |
| 82 | + ID, version, owner, execution system, and description. Defaults to True. |
64 | 83 |
|
65 | 84 | Returns: |
66 | | - Tapis app object with full details, or None if not found. |
| 85 | + Optional[Tapis]: Tapis app object with full details including jobAttributes, |
| 86 | + parameterSet, and other configuration. Returns None if the app is not found. |
67 | 87 |
|
68 | 88 | Raises: |
69 | | - AppDiscoveryError: If fetching the app details fails. |
| 89 | + AppDiscoveryError: If the Tapis API call fails (except for 404 not found) |
| 90 | + or an unexpected error occurs during retrieval. |
| 91 | +
|
| 92 | + Example: |
| 93 | + >>> app = get_app_details(client, "matlab-r2023a", "1.0") |
| 94 | + App Details: |
| 95 | + ID: matlab-r2023a |
| 96 | + Version: 1.0 |
| 97 | + Owner: designsafe |
| 98 | + Execution System: frontera |
| 99 | + Description: MATLAB R2023a runtime environment |
70 | 100 | """ |
71 | 101 | try: |
72 | 102 | if app_version: |
|
0 commit comments