| @@ 2918-2965 (lines=48) @@ | ||
| 2915 | cmd.set_attribute("format", credential_format.value) |
|
| 2916 | return self._send_xml_command(cmd) |
|
| 2917 | ||
| 2918 | def get_configs( |
|
| 2919 | self, |
|
| 2920 | *, |
|
| 2921 | filter: Optional[str] = None, |
|
| 2922 | filter_id: Optional[str] = None, |
|
| 2923 | trash: Optional[bool] = None, |
|
| 2924 | details: Optional[bool] = None, |
|
| 2925 | families: Optional[bool] = None, |
|
| 2926 | preferences: Optional[bool] = None, |
|
| 2927 | tasks: Optional[bool] = None |
|
| 2928 | ) -> Any: |
|
| 2929 | """Request a list of scan configs |
|
| 2930 | ||
| 2931 | Arguments: |
|
| 2932 | filter: Filter term to use for the query |
|
| 2933 | filter_id: UUID of an existing filter to use for the query |
|
| 2934 | trash: Whether to get the trashcan scan configs instead |
|
| 2935 | details: Whether to get config families, preferences, nvt selectors |
|
| 2936 | and tasks. |
|
| 2937 | families: Whether to include the families if no details are |
|
| 2938 | requested |
|
| 2939 | preferences: Whether to include the preferences if no details are |
|
| 2940 | requested |
|
| 2941 | tasks: Whether to get tasks using this config |
|
| 2942 | ||
| 2943 | Returns: |
|
| 2944 | The response. See :py:meth:`send_command` for details. |
|
| 2945 | """ |
|
| 2946 | cmd = XmlCommand("get_configs") |
|
| 2947 | ||
| 2948 | _add_filter(cmd, filter, filter_id) |
|
| 2949 | ||
| 2950 | if trash is not None: |
|
| 2951 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 2952 | ||
| 2953 | if details is not None: |
|
| 2954 | cmd.set_attribute("details", _to_bool(details)) |
|
| 2955 | ||
| 2956 | if families is not None: |
|
| 2957 | cmd.set_attribute("families", _to_bool(families)) |
|
| 2958 | ||
| 2959 | if preferences is not None: |
|
| 2960 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 2961 | ||
| 2962 | if tasks is not None: |
|
| 2963 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 2964 | ||
| 2965 | return self._send_xml_command(cmd) |
|
| 2966 | ||
| 2967 | def get_config(self, config_id: str) -> Any: |
|
| 2968 | """Request a single scan config |
|
| @@ 749-781 (lines=33) @@ | ||
| 746 | cmd.add_element("usage_type", usage_type.value) |
|
| 747 | return self._send_xml_command(cmd) |
|
| 748 | ||
| 749 | def __get_configs( |
|
| 750 | self, |
|
| 751 | usage_type: UsageType, |
|
| 752 | *, |
|
| 753 | filter: Optional[str] = None, |
|
| 754 | filter_id: Optional[str] = None, |
|
| 755 | trash: Optional[bool] = None, |
|
| 756 | details: Optional[bool] = None, |
|
| 757 | families: Optional[bool] = None, |
|
| 758 | preferences: Optional[bool] = None, |
|
| 759 | tasks: Optional[bool] = None |
|
| 760 | ) -> Any: |
|
| 761 | cmd = XmlCommand("get_configs") |
|
| 762 | cmd.set_attribute("usage_type", usage_type.value) |
|
| 763 | ||
| 764 | _add_filter(cmd, filter, filter_id) |
|
| 765 | ||
| 766 | if trash is not None: |
|
| 767 | cmd.set_attribute("trash", _to_bool(trash)) |
|
| 768 | ||
| 769 | if details is not None: |
|
| 770 | cmd.set_attribute("details", _to_bool(details)) |
|
| 771 | ||
| 772 | if families is not None: |
|
| 773 | cmd.set_attribute("families", _to_bool(families)) |
|
| 774 | ||
| 775 | if preferences is not None: |
|
| 776 | cmd.set_attribute("preferences", _to_bool(preferences)) |
|
| 777 | ||
| 778 | if tasks is not None: |
|
| 779 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 780 | ||
| 781 | return self._send_xml_command(cmd) |
|
| 782 | ||
| 783 | def __get_config(self, config_id: str, usage_type: UsageType) -> Any: |
|
| 784 | if not config_id: |
|