@@ 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 |
@@ 1955-1987 (lines=33) @@ | ||
1952 | cmd.add_element("usage_type", usage_type.value) |
|
1953 | return self._send_xml_command(cmd) |
|
1954 | ||
1955 | def __get_configs( |
|
1956 | self, |
|
1957 | usage_type: UsageType, |
|
1958 | *, |
|
1959 | filter: Optional[str] = None, |
|
1960 | filter_id: Optional[str] = None, |
|
1961 | trash: Optional[bool] = None, |
|
1962 | details: Optional[bool] = None, |
|
1963 | families: Optional[bool] = None, |
|
1964 | preferences: Optional[bool] = None, |
|
1965 | tasks: Optional[bool] = None, |
|
1966 | ) -> Any: |
|
1967 | cmd = XmlCommand("get_configs") |
|
1968 | cmd.set_attribute("usage_type", usage_type.value) |
|
1969 | ||
1970 | _add_filter(cmd, filter, filter_id) |
|
1971 | ||
1972 | if trash is not None: |
|
1973 | cmd.set_attribute("trash", _to_bool(trash)) |
|
1974 | ||
1975 | if details is not None: |
|
1976 | cmd.set_attribute("details", _to_bool(details)) |
|
1977 | ||
1978 | if families is not None: |
|
1979 | cmd.set_attribute("families", _to_bool(families)) |
|
1980 | ||
1981 | if preferences is not None: |
|
1982 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
1983 | ||
1984 | if tasks is not None: |
|
1985 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
1986 | ||
1987 | return self._send_xml_command(cmd) |
|
1988 | ||
1989 | def __get_config( |
|
1990 | self, |
@@ 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, |