@@ 1989-2012 (lines=24) @@ | ||
1986 | ||
1987 | return self._send_xml_command(cmd) |
|
1988 | ||
1989 | def __get_config( |
|
1990 | self, |
|
1991 | config_id: str, |
|
1992 | usage_type: UsageType, |
|
1993 | *, |
|
1994 | tasks: Optional[bool] = None, |
|
1995 | ) -> Any: |
|
1996 | if not config_id: |
|
1997 | raise RequiredArgument( |
|
1998 | function=self.get_config.__name__, argument='config_id' |
|
1999 | ) |
|
2000 | ||
2001 | cmd = XmlCommand("get_configs") |
|
2002 | cmd.set_attribute("config_id", config_id) |
|
2003 | ||
2004 | cmd.set_attribute("usage_type", usage_type.value) |
|
2005 | ||
2006 | if tasks is not None: |
|
2007 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
2008 | ||
2009 | # for single entity always request all details |
|
2010 | cmd.set_attribute("details", "1") |
|
2011 | ||
2012 | return self._send_xml_command(cmd) |
|
2013 | ||
2014 | def __get_tasks( |
|
2015 | self, |
@@ 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, |