|
8 | 8 | import xml.etree.ElementTree as ET
|
9 | 9 | from io import SEEK_CUR, SEEK_END, SEEK_SET, BufferedReader, BytesIO
|
10 | 10 | from pathlib import Path
|
11 |
| -from typing import Dict, Optional, Union |
| 11 | +from typing import Dict, List, Optional, Union |
12 | 12 | from urllib.parse import urlencode
|
13 | 13 |
|
14 | 14 | import requests
|
|
32 | 32 | PolicyList,
|
33 | 33 | PolicyUser,
|
34 | 34 | RMCClient,
|
| 35 | + ServerSettings, |
35 | 36 | ShareActivity,
|
36 | 37 | SharedType,
|
37 | 38 | SortBy,
|
@@ -1660,6 +1661,30 @@ def admin_resetpolicyforuser(self, username: str) -> None:
|
1660 | 1661 |
|
1661 | 1662 | self._raise_exception_from_command(resp)
|
1662 | 1663 |
|
| 1664 | + def admin_get_config_settings(self, config: List[str]) -> ServerSettings: |
| 1665 | + """ |
| 1666 | + Retrieve Filecloud configuration settings. The config list should |
| 1667 | + contain FC configuration keys. |
| 1668 | + Args: |
| 1669 | + config: List containing FC config keys |
| 1670 | + """ |
| 1671 | + try: |
| 1672 | + count = len(config) |
| 1673 | + except (ValueError, TypeError): |
| 1674 | + count = 0 |
| 1675 | + |
| 1676 | + config_opts = {} |
| 1677 | + for i in range(count): |
| 1678 | + param_key = f"param{i}" |
| 1679 | + config_opts[param_key] = config[i] # type:ignore |
| 1680 | + |
| 1681 | + config_opts["count"] = str(len(config_opts)) |
| 1682 | + |
| 1683 | + resp = self._api_call("/admin/getconfigsetting", config_opts) |
| 1684 | + |
| 1685 | + settings = ServerSettings(resp) |
| 1686 | + return settings |
| 1687 | + |
1663 | 1688 | def set_config_setting(self, config_name: str, config_val: str) -> None:
|
1664 | 1689 | """
|
1665 | 1690 | Sets a server config setting via admin
|
|
0 commit comments