| @@ 214-250 (lines=37) @@ | ||
| 211 | ||
| 212 | return self._send_xml_command(cmd) |
|
| 213 | ||
| 214 | def get_tasks( |
|
| 215 | self, |
|
| 216 | *, |
|
| 217 | filter: Optional[str] = None, |
|
| 218 | filter_id: Optional[str] = None, |
|
| 219 | trash: Optional[bool] = None, |
|
| 220 | details: Optional[bool] = None, |
|
| 221 | schedules_only: Optional[bool] = None, |
|
| 222 | ) -> Any: |
|
| 223 | """Request a list of tasks |
|
| 224 | ||
| 225 | Arguments: |
|
| 226 | filter: Filter term to use for the query |
|
| 227 | filter_id: UUID of an existing filter to use for the query |
|
| 228 | trash: Whether to get the trashcan tasks instead |
|
| 229 | details: Whether to include full task details |
|
| 230 | schedules_only: Whether to only include id, name and schedule |
|
| 231 | details |
|
| 232 | ||
| 233 | Returns: |
|
| 234 | The response. See :py:meth:`send_command` for details. |
|
| 235 | """ |
|
| 236 | cmd = XmlCommand("get_tasks") |
|
| 237 | cmd.set_attribute("usage_type", "scan") |
|
| 238 | ||
| 239 | add_filter(cmd, filter, filter_id) |
|
| 240 | ||
| 241 | if trash is not None: |
|
| 242 | cmd.set_attribute("trash", to_bool(trash)) |
|
| 243 | ||
| 244 | if details is not None: |
|
| 245 | cmd.set_attribute("details", to_bool(details)) |
|
| 246 | ||
| 247 | if schedules_only is not None: |
|
| 248 | cmd.set_attribute("schedules_only", to_bool(schedules_only)) |
|
| 249 | ||
| 250 | return self._send_xml_command(cmd) |
|
| 251 | ||
| 252 | def get_task(self, task_id: str) -> Any: |
|
| 253 | """Request a single task |
|
| @@ 206-242 (lines=37) @@ | ||
| 203 | ||
| 204 | return self._send_xml_command(cmd) |
|
| 205 | ||
| 206 | def get_audits( |
|
| 207 | self, |
|
| 208 | *, |
|
| 209 | filter: Optional[str] = None, |
|
| 210 | filter_id: Optional[str] = None, |
|
| 211 | trash: Optional[bool] = None, |
|
| 212 | details: Optional[bool] = None, |
|
| 213 | schedules_only: Optional[bool] = None, |
|
| 214 | ) -> Any: |
|
| 215 | """Request a list of audits |
|
| 216 | ||
| 217 | Arguments: |
|
| 218 | filter: Filter term to use for the query |
|
| 219 | filter_id: UUID of an existing filter to use for the query |
|
| 220 | trash: Whether to get the trashcan audits instead |
|
| 221 | details: Whether to include full audit details |
|
| 222 | schedules_only: Whether to only include id, name and schedule |
|
| 223 | details |
|
| 224 | ||
| 225 | Returns: |
|
| 226 | The response. See :py:meth:`send_command` for details. |
|
| 227 | """ |
|
| 228 | cmd = XmlCommand("get_tasks") |
|
| 229 | cmd.set_attribute("usage_type", "audit") |
|
| 230 | ||
| 231 | add_filter(cmd, filter, filter_id) |
|
| 232 | ||
| 233 | if trash is not None: |
|
| 234 | cmd.set_attribute("trash", to_bool(trash)) |
|
| 235 | ||
| 236 | if details is not None: |
|
| 237 | cmd.set_attribute("details", to_bool(details)) |
|
| 238 | ||
| 239 | if schedules_only is not None: |
|
| 240 | cmd.set_attribute("schedules_only", to_bool(schedules_only)) |
|
| 241 | ||
| 242 | return self._send_xml_command(cmd) |
|
| 243 | ||
| 244 | def get_audit(self, audit_id: str) -> Any: |
|
| 245 | """Request a single audit |
|
| @@ 207-241 (lines=35) @@ | ||
| 204 | ||
| 205 | return self._send_xml_command(cmd) |
|
| 206 | ||
| 207 | def get_port_lists( |
|
| 208 | self, |
|
| 209 | *, |
|
| 210 | filter: Optional[str] = None, |
|
| 211 | filter_id: Optional[str] = None, |
|
| 212 | details: Optional[bool] = None, |
|
| 213 | targets: Optional[bool] = None, |
|
| 214 | trash: Optional[bool] = None, |
|
| 215 | ) -> Any: |
|
| 216 | """Request a list of port lists |
|
| 217 | ||
| 218 | Arguments: |
|
| 219 | filter: Filter term to use for the query |
|
| 220 | filter_id: UUID of an existing filter to use for the query |
|
| 221 | details: Whether to include full port list details |
|
| 222 | targets: Whether to include targets using this port list |
|
| 223 | trash: Whether to get port lists in the trashcan instead |
|
| 224 | ||
| 225 | Returns: |
|
| 226 | The response. See :py:meth:`send_command` for details. |
|
| 227 | """ |
|
| 228 | cmd = XmlCommand("get_port_lists") |
|
| 229 | ||
| 230 | add_filter(cmd, filter, filter_id) |
|
| 231 | ||
| 232 | if details is not None: |
|
| 233 | cmd.set_attribute("details", to_bool(details)) |
|
| 234 | ||
| 235 | if targets is not None: |
|
| 236 | cmd.set_attribute("targets", to_bool(targets)) |
|
| 237 | ||
| 238 | if trash is not None: |
|
| 239 | cmd.set_attribute("trash", to_bool(trash)) |
|
| 240 | ||
| 241 | return self._send_xml_command(cmd) |
|
| 242 | ||
| 243 | def get_port_list(self, port_list_id: str): |
|
| 244 | """Request a single port list |
|
| @@ 1499-1538 (lines=40) @@ | ||
| 1496 | ||
| 1497 | return self._send_xml_command(cmd) |
|
| 1498 | ||
| 1499 | def get_report_formats( |
|
| 1500 | self, |
|
| 1501 | *, |
|
| 1502 | filter: Optional[str] = None, |
|
| 1503 | filter_id: Optional[str] = None, |
|
| 1504 | trash: Optional[bool] = None, |
|
| 1505 | alerts: Optional[bool] = None, |
|
| 1506 | params: Optional[bool] = None, |
|
| 1507 | details: Optional[bool] = None, |
|
| 1508 | ) -> Any: |
|
| 1509 | """Request a list of report formats |
|
| 1510 | ||
| 1511 | Arguments: |
|
| 1512 | filter: Filter term to use for the query |
|
| 1513 | filter_id: UUID of an existing filter to use for the query |
|
| 1514 | trash: Whether to get the trashcan report formats instead |
|
| 1515 | alerts: Whether to include alerts that use the report format |
|
| 1516 | params: Whether to include report format parameters |
|
| 1517 | details: Include report format file, signature and parameters |
|
| 1518 | ||
| 1519 | Returns: |
|
| 1520 | The response. See :py:meth:`send_command` for details. |
|
| 1521 | """ |
|
| 1522 | cmd = XmlCommand("get_report_formats") |
|
| 1523 | ||
| 1524 | add_filter(cmd, filter, filter_id) |
|
| 1525 | ||
| 1526 | if details is not None: |
|
| 1527 | cmd.set_attribute("details", to_bool(details)) |
|
| 1528 | ||
| 1529 | if alerts is not None: |
|
| 1530 | cmd.set_attribute("alerts", to_bool(alerts)) |
|
| 1531 | ||
| 1532 | if params is not None: |
|
| 1533 | cmd.set_attribute("params", to_bool(params)) |
|
| 1534 | ||
| 1535 | if trash is not None: |
|
| 1536 | cmd.set_attribute("trash", to_bool(trash)) |
|
| 1537 | ||
| 1538 | return self._send_xml_command(cmd) |
|
| 1539 | ||
| 1540 | def get_report_format( |
|
| 1541 | self, report_format_id: Union[str, ReportFormatType] |
|