| @@ 2952-2999 (lines=48) @@ | ||
| 2949 | ||
| 2950 | return self._send_xml_command(cmd) |
|
| 2951 | ||
| 2952 | def get_configs( |
|
| 2953 | self, |
|
| 2954 | *, |
|
| 2955 | filter: Optional[str] = None, |
|
| 2956 | filter_id: Optional[str] = None, |
|
| 2957 | trash: Optional[bool] = None, |
|
| 2958 | details: Optional[bool] = None, |
|
| 2959 | families: Optional[bool] = None, |
|
| 2960 | preferences: Optional[bool] = None, |
|
| 2961 | tasks: Optional[bool] = None |
|
| 2962 | ) -> Any: |
|
| 2963 | """Request a list of scan configs |
|
| 2964 | ||
| 2965 | Arguments: |
|
| 2966 | filter: Filter term to use for the query |
|
| 2967 | filter_id: UUID of an existing filter to use for the query |
|
| 2968 | trash: Whether to get the trashcan scan configs instead |
|
| 2969 | details: Whether to get config families, preferences, nvt selectors |
|
| 2970 | and tasks. |
|
| 2971 | families: Whether to include the families if no details are |
|
| 2972 | requested |
|
| 2973 | preferences: Whether to include the preferences if no details are |
|
| 2974 | requested |
|
| 2975 | tasks: Whether to get tasks using this config |
|
| 2976 | ||
| 2977 | Returns: |
|
| 2978 | The response. See :py:meth:`send_command` for details. |
|
| 2979 | """ |
|
| 2980 | cmd = XmlCommand("get_configs") |
|
| 2981 | ||
| 2982 | _add_filter(cmd, filter, filter_id) |
|
| 2983 | ||
| 2984 | if trash is not None: |
|
| 2985 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 2986 | ||
| 2987 | if details is not None: |
|
| 2988 | cmd.set_attribute("details", _to_bool(details)) |
|
| 2989 | ||
| 2990 | if families is not None: |
|
| 2991 | cmd.set_attribute("families", _to_bool(families)) |
|
| 2992 | ||
| 2993 | if preferences is not None: |
|
| 2994 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 2995 | ||
| 2996 | if tasks is not None: |
|
| 2997 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 2998 | ||
| 2999 | return self._send_xml_command(cmd) |
|
| 3000 | ||
| 3001 | def get_config( |
|
| 3002 | self, config_id: str, *, tasks: Optional[bool] = None |
|
| @@ 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, |
|