@@ 1143-1175 (lines=33) @@ | ||
1140 | cmd.add_element("usage_type", usage_type.value) |
|
1141 | return self._send_xml_command(cmd) |
|
1142 | ||
1143 | def __get_configs( |
|
1144 | self, |
|
1145 | usage_type: UsageType, |
|
1146 | *, |
|
1147 | filter: Optional[str] = None, |
|
1148 | filter_id: Optional[str] = None, |
|
1149 | trash: Optional[bool] = None, |
|
1150 | details: Optional[bool] = None, |
|
1151 | families: Optional[bool] = None, |
|
1152 | preferences: Optional[bool] = None, |
|
1153 | tasks: Optional[bool] = None |
|
1154 | ) -> Any: |
|
1155 | cmd = XmlCommand("get_configs") |
|
1156 | cmd.set_attribute("usage_type", usage_type.value) |
|
1157 | ||
1158 | _add_filter(cmd, filter, filter_id) |
|
1159 | ||
1160 | if trash is not None: |
|
1161 | cmd.set_attribute("trash", _to_bool(trash)) |
|
1162 | ||
1163 | if details is not None: |
|
1164 | cmd.set_attribute("details", _to_bool(details)) |
|
1165 | ||
1166 | if families is not None: |
|
1167 | cmd.set_attribute("families", _to_bool(families)) |
|
1168 | ||
1169 | if preferences is not None: |
|
1170 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
1171 | ||
1172 | if tasks is not None: |
|
1173 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
1174 | ||
1175 | return self._send_xml_command(cmd) |
|
1176 | ||
1177 | def __get_config( |
|
1178 | self, |
@@ 2999-3046 (lines=48) @@ | ||
2996 | ||
2997 | return self._send_xml_command(cmd) |
|
2998 | ||
2999 | def get_configs( |
|
3000 | self, |
|
3001 | *, |
|
3002 | filter: Optional[str] = None, |
|
3003 | filter_id: Optional[str] = None, |
|
3004 | trash: Optional[bool] = None, |
|
3005 | details: Optional[bool] = None, |
|
3006 | families: Optional[bool] = None, |
|
3007 | preferences: Optional[bool] = None, |
|
3008 | tasks: Optional[bool] = None |
|
3009 | ) -> Any: |
|
3010 | """Request a list of scan configs |
|
3011 | ||
3012 | Arguments: |
|
3013 | filter: Filter term to use for the query |
|
3014 | filter_id: UUID of an existing filter to use for the query |
|
3015 | trash: Whether to get the trashcan scan configs instead |
|
3016 | details: Whether to get config families, preferences, nvt selectors |
|
3017 | and tasks. |
|
3018 | families: Whether to include the families if no details are |
|
3019 | requested |
|
3020 | preferences: Whether to include the preferences if no details are |
|
3021 | requested |
|
3022 | tasks: Whether to get tasks using this config |
|
3023 | ||
3024 | Returns: |
|
3025 | The response. See :py:meth:`send_command` for details. |
|
3026 | """ |
|
3027 | cmd = XmlCommand("get_configs") |
|
3028 | ||
3029 | _add_filter(cmd, filter, filter_id) |
|
3030 | ||
3031 | if trash is not None: |
|
3032 | cmd.set_attribute("trash", _to_bool(trash)) |
|
3033 | ||
3034 | if details is not None: |
|
3035 | cmd.set_attribute("details", _to_bool(details)) |
|
3036 | ||
3037 | if families is not None: |
|
3038 | cmd.set_attribute("families", _to_bool(families)) |
|
3039 | ||
3040 | if preferences is not None: |
|
3041 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
3042 | ||
3043 | if tasks is not None: |
|
3044 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
3045 | ||
3046 | return self._send_xml_command(cmd) |
|
3047 | ||
3048 | def get_config( |
|
3049 | self, config_id: str, *, tasks: Optional[bool] = None |