| @@ 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 |
|
| @@ 1327-1359 (lines=33) @@ | ||
| 1324 | cmd.add_element("usage_type", usage_type.value) |
|
| 1325 | return self._send_xml_command(cmd) |
|
| 1326 | ||
| 1327 | def __get_configs( |
|
| 1328 | self, |
|
| 1329 | usage_type: UsageType, |
|
| 1330 | *, |
|
| 1331 | filter: Optional[str] = None, |
|
| 1332 | filter_id: Optional[str] = None, |
|
| 1333 | trash: Optional[bool] = None, |
|
| 1334 | details: Optional[bool] = None, |
|
| 1335 | families: Optional[bool] = None, |
|
| 1336 | preferences: Optional[bool] = None, |
|
| 1337 | tasks: Optional[bool] = None |
|
| 1338 | ) -> Any: |
|
| 1339 | cmd = XmlCommand("get_configs") |
|
| 1340 | cmd.set_attribute("usage_type", usage_type.value) |
|
| 1341 | ||
| 1342 | _add_filter(cmd, filter, filter_id) |
|
| 1343 | ||
| 1344 | if trash is not None: |
|
| 1345 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 1346 | ||
| 1347 | if details is not None: |
|
| 1348 | cmd.set_attribute("details", _to_bool(details)) |
|
| 1349 | ||
| 1350 | if families is not None: |
|
| 1351 | cmd.set_attribute("families", _to_bool(families)) |
|
| 1352 | ||
| 1353 | if preferences is not None: |
|
| 1354 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 1355 | ||
| 1356 | if tasks is not None: |
|
| 1357 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 1358 | ||
| 1359 | return self._send_xml_command(cmd) |
|
| 1360 | ||
| 1361 | def __get_config( |
|
| 1362 | self, |
|