@@ 3015-3062 (lines=48) @@ | ||
3012 | ||
3013 | return self._send_xml_command(cmd) |
|
3014 | ||
3015 | def get_configs( |
|
3016 | self, |
|
3017 | *, |
|
3018 | filter: Optional[str] = None, |
|
3019 | filter_id: Optional[str] = None, |
|
3020 | trash: Optional[bool] = None, |
|
3021 | details: Optional[bool] = None, |
|
3022 | families: Optional[bool] = None, |
|
3023 | preferences: Optional[bool] = None, |
|
3024 | tasks: Optional[bool] = None, |
|
3025 | ) -> Any: |
|
3026 | """Request a list of scan configs |
|
3027 | ||
3028 | Arguments: |
|
3029 | filter: Filter term to use for the query |
|
3030 | filter_id: UUID of an existing filter to use for the query |
|
3031 | trash: Whether to get the trashcan scan configs instead |
|
3032 | details: Whether to get config families, preferences, nvt selectors |
|
3033 | and tasks. |
|
3034 | families: Whether to include the families if no details are |
|
3035 | requested |
|
3036 | preferences: Whether to include the preferences if no details are |
|
3037 | requested |
|
3038 | tasks: Whether to get tasks using this config |
|
3039 | ||
3040 | Returns: |
|
3041 | The response. See :py:meth:`send_command` for details. |
|
3042 | """ |
|
3043 | cmd = XmlCommand("get_configs") |
|
3044 | ||
3045 | _add_filter(cmd, filter, filter_id) |
|
3046 | ||
3047 | if trash is not None: |
|
3048 | cmd.set_attribute("trash", _to_bool(trash)) |
|
3049 | ||
3050 | if details is not None: |
|
3051 | cmd.set_attribute("details", _to_bool(details)) |
|
3052 | ||
3053 | if families is not None: |
|
3054 | cmd.set_attribute("families", _to_bool(families)) |
|
3055 | ||
3056 | if preferences is not None: |
|
3057 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
3058 | ||
3059 | if tasks is not None: |
|
3060 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
3061 | ||
3062 | return self._send_xml_command(cmd) |
|
3063 | ||
3064 | def get_config( |
|
3065 | self, config_id: str, *, tasks: Optional[bool] = None |
@@ 1828-1860 (lines=33) @@ | ||
1825 | cmd.add_element("usage_type", usage_type.value) |
|
1826 | return self._send_xml_command(cmd) |
|
1827 | ||
1828 | def __get_configs( |
|
1829 | self, |
|
1830 | usage_type: UsageType, |
|
1831 | *, |
|
1832 | filter: Optional[str] = None, |
|
1833 | filter_id: Optional[str] = None, |
|
1834 | trash: Optional[bool] = None, |
|
1835 | details: Optional[bool] = None, |
|
1836 | families: Optional[bool] = None, |
|
1837 | preferences: Optional[bool] = None, |
|
1838 | tasks: Optional[bool] = None, |
|
1839 | ) -> Any: |
|
1840 | cmd = XmlCommand("get_configs") |
|
1841 | cmd.set_attribute("usage_type", usage_type.value) |
|
1842 | ||
1843 | _add_filter(cmd, filter, filter_id) |
|
1844 | ||
1845 | if trash is not None: |
|
1846 | cmd.set_attribute("trash", _to_bool(trash)) |
|
1847 | ||
1848 | if details is not None: |
|
1849 | cmd.set_attribute("details", _to_bool(details)) |
|
1850 | ||
1851 | if families is not None: |
|
1852 | cmd.set_attribute("families", _to_bool(families)) |
|
1853 | ||
1854 | if preferences is not None: |
|
1855 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
1856 | ||
1857 | if tasks is not None: |
|
1858 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
1859 | ||
1860 | return self._send_xml_command(cmd) |
|
1861 | ||
1862 | def __get_config( |
|
1863 | self, |
@@ 1987-2019 (lines=33) @@ | ||
1984 | cmd.add_element("usage_type", usage_type.value) |
|
1985 | return self._send_xml_command(cmd) |
|
1986 | ||
1987 | def __get_configs( |
|
1988 | self, |
|
1989 | usage_type: UsageType, |
|
1990 | *, |
|
1991 | filter: Optional[str] = None, |
|
1992 | filter_id: Optional[str] = None, |
|
1993 | trash: Optional[bool] = None, |
|
1994 | details: Optional[bool] = None, |
|
1995 | families: Optional[bool] = None, |
|
1996 | preferences: Optional[bool] = None, |
|
1997 | tasks: Optional[bool] = None, |
|
1998 | ) -> Any: |
|
1999 | cmd = XmlCommand("get_configs") |
|
2000 | cmd.set_attribute("usage_type", usage_type.value) |
|
2001 | ||
2002 | _add_filter(cmd, filter, filter_id) |
|
2003 | ||
2004 | if trash is not None: |
|
2005 | cmd.set_attribute("trash", _to_bool(trash)) |
|
2006 | ||
2007 | if details is not None: |
|
2008 | cmd.set_attribute("details", _to_bool(details)) |
|
2009 | ||
2010 | if families is not None: |
|
2011 | cmd.set_attribute("families", _to_bool(families)) |
|
2012 | ||
2013 | if preferences is not None: |
|
2014 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
2015 | ||
2016 | if tasks is not None: |
|
2017 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
2018 | ||
2019 | return self._send_xml_command(cmd) |
|
2020 | ||
2021 | def __get_config( |
|
2022 | self, |