@@ 1862-1885 (lines=24) @@ | ||
1859 | ||
1860 | return self._send_xml_command(cmd) |
|
1861 | ||
1862 | def __get_config( |
|
1863 | self, |
|
1864 | config_id: str, |
|
1865 | usage_type: UsageType, |
|
1866 | *, |
|
1867 | tasks: Optional[bool] = None, |
|
1868 | ) -> Any: |
|
1869 | if not config_id: |
|
1870 | raise RequiredArgument( |
|
1871 | function=self.get_config.__name__, argument='config_id' |
|
1872 | ) |
|
1873 | ||
1874 | cmd = XmlCommand("get_configs") |
|
1875 | cmd.set_attribute("config_id", config_id) |
|
1876 | ||
1877 | cmd.set_attribute("usage_type", usage_type.value) |
|
1878 | ||
1879 | if tasks is not None: |
|
1880 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
1881 | ||
1882 | # for single entity always request all details |
|
1883 | cmd.set_attribute("details", "1") |
|
1884 | ||
1885 | return self._send_xml_command(cmd) |
|
1886 | ||
1887 | def __get_tasks( |
|
1888 | self, |
@@ 2021-2044 (lines=24) @@ | ||
2018 | ||
2019 | return self._send_xml_command(cmd) |
|
2020 | ||
2021 | def __get_config( |
|
2022 | self, |
|
2023 | config_id: str, |
|
2024 | usage_type: UsageType, |
|
2025 | *, |
|
2026 | tasks: Optional[bool] = None, |
|
2027 | ) -> Any: |
|
2028 | if not config_id: |
|
2029 | raise RequiredArgument( |
|
2030 | function=self.get_config.__name__, argument='config_id' |
|
2031 | ) |
|
2032 | ||
2033 | cmd = XmlCommand("get_configs") |
|
2034 | cmd.set_attribute("config_id", config_id) |
|
2035 | ||
2036 | cmd.set_attribute("usage_type", usage_type.value) |
|
2037 | ||
2038 | if tasks is not None: |
|
2039 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
2040 | ||
2041 | # for single entity always request all details |
|
2042 | cmd.set_attribute("details", "1") |
|
2043 | ||
2044 | return self._send_xml_command(cmd) |
|
2045 | ||
2046 | def __get_tasks( |
|
2047 | self, |