@@ 995-1046 (lines=52) @@ | ||
992 | ||
993 | return self._send_xml_command(cmd) |
|
994 | ||
995 | def modify_audit( |
|
996 | self, |
|
997 | audit_id: str, |
|
998 | *, |
|
999 | name: Optional[str] = None, |
|
1000 | policy_id: Optional[str] = None, |
|
1001 | target_id: Optional[str] = None, |
|
1002 | scanner_id: Optional[str] = None, |
|
1003 | alterable: Optional[bool] = None, |
|
1004 | hosts_ordering: Optional[HostsOrdering] = None, |
|
1005 | schedule_id: Optional[str] = None, |
|
1006 | schedule_periods: Optional[int] = None, |
|
1007 | comment: Optional[str] = None, |
|
1008 | alert_ids: Optional[List[str]] = None, |
|
1009 | observers: Optional[List[str]] = None, |
|
1010 | preferences: Optional[dict] = None, |
|
1011 | ) -> Any: |
|
1012 | """Modifies an existing task. |
|
1013 | ||
1014 | Arguments: |
|
1015 | audit_id: UUID of audit to modify. |
|
1016 | name: The name of the audit. |
|
1017 | policy_id: UUID of policy to use by the audit |
|
1018 | target_id: UUID of target to be scanned |
|
1019 | scanner_id: UUID of scanner to use for scanning the target |
|
1020 | comment: The comment on the audit. |
|
1021 | alert_ids: List of UUIDs for alerts to be applied to the audit |
|
1022 | hosts_ordering: The order hosts are scanned in |
|
1023 | schedule_id: UUID of a schedule when the audit should be run. |
|
1024 | schedule_periods: A limit to the number of times the audit will be |
|
1025 | scheduled, or 0 for no limit. |
|
1026 | observers: List of names or ids of users which should be allowed to |
|
1027 | observe this audit |
|
1028 | preferences: Name/Value pairs of scanner preferences. |
|
1029 | ||
1030 | Returns: |
|
1031 | The response. See :py:meth:`send_command` for details. |
|
1032 | """ |
|
1033 | self.modify_task( |
|
1034 | task_id=audit_id, |
|
1035 | name=name, |
|
1036 | config_id=policy_id, |
|
1037 | target_id=target_id, |
|
1038 | scanner_id=scanner_id, |
|
1039 | alterable=alterable, |
|
1040 | hosts_ordering=hosts_ordering, |
|
1041 | schedule_id=schedule_id, |
|
1042 | schedule_periods=schedule_periods, |
|
1043 | comment=comment, |
|
1044 | alert_ids=alert_ids, |
|
1045 | observers=observers, |
|
1046 | preferences=preferences, |
|
1047 | ) |
|
1048 | ||
1049 | def modify_permission( |
@@ 1116-1167 (lines=52) @@ | ||
1113 | ||
1114 | return self._send_xml_command(cmd) |
|
1115 | ||
1116 | def modify_audit( |
|
1117 | self, |
|
1118 | audit_id: str, |
|
1119 | *, |
|
1120 | name: Optional[str] = None, |
|
1121 | policy_id: Optional[str] = None, |
|
1122 | target_id: Optional[str] = None, |
|
1123 | scanner_id: Optional[str] = None, |
|
1124 | alterable: Optional[bool] = None, |
|
1125 | hosts_ordering: Optional[HostsOrdering] = None, |
|
1126 | schedule_id: Optional[str] = None, |
|
1127 | schedule_periods: Optional[int] = None, |
|
1128 | comment: Optional[str] = None, |
|
1129 | alert_ids: Optional[List[str]] = None, |
|
1130 | observers: Optional[List[str]] = None, |
|
1131 | preferences: Optional[dict] = None, |
|
1132 | ) -> Any: |
|
1133 | """Modifies an existing task. |
|
1134 | ||
1135 | Arguments: |
|
1136 | audit_id: UUID of audit to modify. |
|
1137 | name: The name of the audit. |
|
1138 | policy_id: UUID of policy to use by the audit |
|
1139 | target_id: UUID of target to be scanned |
|
1140 | scanner_id: UUID of scanner to use for scanning the target |
|
1141 | comment: The comment on the audit. |
|
1142 | alert_ids: List of UUIDs for alerts to be applied to the audit |
|
1143 | hosts_ordering: The order hosts are scanned in |
|
1144 | schedule_id: UUID of a schedule when the audit should be run. |
|
1145 | schedule_periods: A limit to the number of times the audit will be |
|
1146 | scheduled, or 0 for no limit. |
|
1147 | observers: List of names or ids of users which should be allowed to |
|
1148 | observe this audit |
|
1149 | preferences: Name/Value pairs of scanner preferences. |
|
1150 | ||
1151 | Returns: |
|
1152 | The response. See :py:meth:`send_command` for details. |
|
1153 | """ |
|
1154 | self.modify_task( |
|
1155 | task_id=audit_id, |
|
1156 | name=name, |
|
1157 | config_id=policy_id, |
|
1158 | target_id=target_id, |
|
1159 | scanner_id=scanner_id, |
|
1160 | alterable=alterable, |
|
1161 | hosts_ordering=hosts_ordering, |
|
1162 | schedule_id=schedule_id, |
|
1163 | schedule_periods=schedule_periods, |
|
1164 | comment=comment, |
|
1165 | alert_ids=alert_ids, |
|
1166 | observers=observers, |
|
1167 | preferences=preferences, |
|
1168 | ) |
|
1169 | ||
1170 | def modify_permission( |