| @@ 1084-1116 (lines=33) @@ | ||
| 1081 | cmd.add_element("usage_type", usage_type.value) |
|
| 1082 | return self._send_xml_command(cmd) |
|
| 1083 | ||
| 1084 | def __get_configs( |
|
| 1085 | self, |
|
| 1086 | usage_type: UsageType, |
|
| 1087 | *, |
|
| 1088 | filter: Optional[str] = None, |
|
| 1089 | filter_id: Optional[str] = None, |
|
| 1090 | trash: Optional[bool] = None, |
|
| 1091 | details: Optional[bool] = None, |
|
| 1092 | families: Optional[bool] = None, |
|
| 1093 | preferences: Optional[bool] = None, |
|
| 1094 | tasks: Optional[bool] = None |
|
| 1095 | ) -> Any: |
|
| 1096 | cmd = XmlCommand("get_configs") |
|
| 1097 | cmd.set_attribute("usage_type", usage_type.value) |
|
| 1098 | ||
| 1099 | _add_filter(cmd, filter, filter_id) |
|
| 1100 | ||
| 1101 | if trash is not None: |
|
| 1102 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 1103 | ||
| 1104 | if details is not None: |
|
| 1105 | cmd.set_attribute("details", _to_bool(details)) |
|
| 1106 | ||
| 1107 | if families is not None: |
|
| 1108 | cmd.set_attribute("families", _to_bool(families)) |
|
| 1109 | ||
| 1110 | if preferences is not None: |
|
| 1111 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 1112 | ||
| 1113 | if tasks is not None: |
|
| 1114 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 1115 | ||
| 1116 | return self._send_xml_command(cmd) |
|
| 1117 | ||
| 1118 | def __get_config( |
|
| 1119 | self, |
|
| @@ 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 |
|