| @@ 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 |
|
| @@ 1676-1708 (lines=33) @@ | ||
| 1673 | cmd.add_element("usage_type", usage_type.value) |
|
| 1674 | return self._send_xml_command(cmd) |
|
| 1675 | ||
| 1676 | def __get_configs( |
|
| 1677 | self, |
|
| 1678 | usage_type: UsageType, |
|
| 1679 | *, |
|
| 1680 | filter: Optional[str] = None, |
|
| 1681 | filter_id: Optional[str] = None, |
|
| 1682 | trash: Optional[bool] = None, |
|
| 1683 | details: Optional[bool] = None, |
|
| 1684 | families: Optional[bool] = None, |
|
| 1685 | preferences: Optional[bool] = None, |
|
| 1686 | tasks: Optional[bool] = None |
|
| 1687 | ) -> Any: |
|
| 1688 | cmd = XmlCommand("get_configs") |
|
| 1689 | cmd.set_attribute("usage_type", usage_type.value) |
|
| 1690 | ||
| 1691 | _add_filter(cmd, filter, filter_id) |
|
| 1692 | ||
| 1693 | if trash is not None: |
|
| 1694 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 1695 | ||
| 1696 | if details is not None: |
|
| 1697 | cmd.set_attribute("details", _to_bool(details)) |
|
| 1698 | ||
| 1699 | if families is not None: |
|
| 1700 | cmd.set_attribute("families", _to_bool(families)) |
|
| 1701 | ||
| 1702 | if preferences is not None: |
|
| 1703 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 1704 | ||
| 1705 | if tasks is not None: |
|
| 1706 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 1707 | ||
| 1708 | return self._send_xml_command(cmd) |
|
| 1709 | ||
| 1710 | def __get_config( |
|
| 1711 | self, |
|