@@ 1122-1173 (lines=52) @@ | ||
1119 | ||
1120 | return self._send_xml_command(cmd) |
|
1121 | ||
1122 | def modify_audit( |
|
1123 | self, |
|
1124 | audit_id: str, |
|
1125 | *, |
|
1126 | name: Optional[str] = None, |
|
1127 | policy_id: Optional[str] = None, |
|
1128 | target_id: Optional[str] = None, |
|
1129 | scanner_id: Optional[str] = None, |
|
1130 | alterable: Optional[bool] = None, |
|
1131 | hosts_ordering: Optional[HostsOrdering] = None, |
|
1132 | schedule_id: Optional[str] = None, |
|
1133 | schedule_periods: Optional[int] = None, |
|
1134 | comment: Optional[str] = None, |
|
1135 | alert_ids: Optional[List[str]] = None, |
|
1136 | observers: Optional[List[str]] = None, |
|
1137 | preferences: Optional[dict] = None, |
|
1138 | ) -> Any: |
|
1139 | """Modifies an existing task. |
|
1140 | ||
1141 | Arguments: |
|
1142 | audit_id: UUID of audit to modify. |
|
1143 | name: The name of the audit. |
|
1144 | policy_id: UUID of policy to use by the audit |
|
1145 | target_id: UUID of target to be scanned |
|
1146 | scanner_id: UUID of scanner to use for scanning the target |
|
1147 | comment: The comment on the audit. |
|
1148 | alert_ids: List of UUIDs for alerts to be applied to the audit |
|
1149 | hosts_ordering: The order hosts are scanned in |
|
1150 | schedule_id: UUID of a schedule when the audit should be run. |
|
1151 | schedule_periods: A limit to the number of times the audit will be |
|
1152 | scheduled, or 0 for no limit. |
|
1153 | observers: List of names or ids of users which should be allowed to |
|
1154 | observe this audit |
|
1155 | preferences: Name/Value pairs of scanner preferences. |
|
1156 | ||
1157 | Returns: |
|
1158 | The response. See :py:meth:`send_command` for details. |
|
1159 | """ |
|
1160 | self.modify_task( |
|
1161 | task_id=audit_id, |
|
1162 | name=name, |
|
1163 | config_id=policy_id, |
|
1164 | target_id=target_id, |
|
1165 | scanner_id=scanner_id, |
|
1166 | alterable=alterable, |
|
1167 | hosts_ordering=hosts_ordering, |
|
1168 | schedule_id=schedule_id, |
|
1169 | schedule_periods=schedule_periods, |
|
1170 | comment=comment, |
|
1171 | alert_ids=alert_ids, |
|
1172 | observers=observers, |
|
1173 | preferences=preferences, |
|
1174 | ) |
|
1175 | ||
1176 | def modify_permission( |
@@ 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( |