| @@ 4673-4694 (lines=22) @@ | ||
| 4670 | ||
| 4671 | return self._send_xml_command(cmd) |
|
| 4672 | ||
| 4673 | def get_alert(self, alert_id: str, *, tasks: Optional[bool] = None) -> Any: |
|
| 4674 | """Request a single alert |
|
| 4675 | ||
| 4676 | Arguments: |
|
| 4677 | alert_id: UUID of an existing alert |
|
| 4678 | ||
| 4679 | Returns: |
|
| 4680 | The response. See :py:meth:`send_command` for details. |
|
| 4681 | """ |
|
| 4682 | cmd = XmlCommand("get_alerts") |
|
| 4683 | ||
| 4684 | if not alert_id: |
|
| 4685 | raise RequiredArgument( |
|
| 4686 | function=self.get_alert.__name__, argument='alert_id' |
|
| 4687 | ) |
|
| 4688 | ||
| 4689 | cmd.set_attribute("alert_id", alert_id) |
|
| 4690 | ||
| 4691 | if tasks is not None: |
|
| 4692 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 4693 | ||
| 4694 | return self._send_xml_command(cmd) |
|
| 4695 | ||
| 4696 | def get_assets( |
|
| 4697 | self, |
|
| @@ 2848-2869 (lines=22) @@ | ||
| 2845 | ||
| 2846 | return self._send_xml_command(cmd) |
|
| 2847 | ||
| 2848 | def get_alert(self, alert_id: str, *, tasks: Optional[bool] = None) -> Any: |
|
| 2849 | """Request a single alert |
|
| 2850 | ||
| 2851 | Arguments: |
|
| 2852 | alert_id: UUID of an existing alert |
|
| 2853 | ||
| 2854 | Returns: |
|
| 2855 | The response. See :py:meth:`send_command` for details. |
|
| 2856 | """ |
|
| 2857 | cmd = XmlCommand("get_alerts") |
|
| 2858 | ||
| 2859 | if not alert_id: |
|
| 2860 | raise RequiredArgument( |
|
| 2861 | function=self.get_alert.__name__, argument='alert_id' |
|
| 2862 | ) |
|
| 2863 | ||
| 2864 | cmd.set_attribute("alert_id", alert_id) |
|
| 2865 | ||
| 2866 | if tasks is not None: |
|
| 2867 | cmd.set_attribute("tasks", _to_bool(tasks)) |
|
| 2868 | ||
| 2869 | return self._send_xml_command(cmd) |
|
| 2870 | ||
| 2871 | def get_assets( |
|
| 2872 | self, |
|