@@ 199-229 (lines=31) @@ | ||
196 | ||
197 | return self._send_xml_command(cmd) |
|
198 | ||
199 | def get_scanners( |
|
200 | self, |
|
201 | *, |
|
202 | filter: Optional[str] = None, |
|
203 | filter_id: Optional[str] = None, |
|
204 | trash: Optional[bool] = None, |
|
205 | details: Optional[bool] = None, |
|
206 | ) -> Any: |
|
207 | """Request a list of scanners |
|
208 | ||
209 | Arguments: |
|
210 | filter: Filter term to use for the query |
|
211 | filter_id: UUID of an existing filter to use for the query |
|
212 | trash: Whether to get the trashcan scanners instead |
|
213 | details: Whether to include extra details like tasks using this |
|
214 | scanner |
|
215 | ||
216 | Returns: |
|
217 | The response. See :py:meth:`send_command` for details. |
|
218 | """ |
|
219 | cmd = XmlCommand("get_scanners") |
|
220 | ||
221 | add_filter(cmd, filter, filter_id) |
|
222 | ||
223 | if trash is not None: |
|
224 | cmd.set_attribute("trash", to_bool(trash)) |
|
225 | ||
226 | if details is not None: |
|
227 | cmd.set_attribute("details", to_bool(details)) |
|
228 | ||
229 | return self._send_xml_command(cmd) |
|
230 | ||
231 | def get_scanner(self, scanner_id: str) -> Any: |
|
232 | """Request a single scanner |
@@ 254-283 (lines=30) @@ | ||
251 | ||
252 | return self._send_xml_command(cmd) |
|
253 | ||
254 | def get_targets( |
|
255 | self, |
|
256 | *, |
|
257 | filter: Optional[str] = None, |
|
258 | filter_id: Optional[str] = None, |
|
259 | trash: Optional[bool] = None, |
|
260 | tasks: Optional[bool] = None, |
|
261 | ) -> Any: |
|
262 | """Request a list of targets |
|
263 | ||
264 | Arguments: |
|
265 | filter: Filter term to use for the query |
|
266 | filter_id: UUID of an existing filter to use for the query |
|
267 | trash: Whether to get the trashcan targets instead |
|
268 | tasks: Whether to include list of tasks that use the target |
|
269 | ||
270 | Returns: |
|
271 | The response. See :py:meth:`send_command` for details. |
|
272 | """ |
|
273 | cmd = XmlCommand("get_targets") |
|
274 | ||
275 | add_filter(cmd, filter, filter_id) |
|
276 | ||
277 | if trash is not None: |
|
278 | cmd.set_attribute("trash", to_bool(trash)) |
|
279 | ||
280 | if tasks is not None: |
|
281 | cmd.set_attribute("tasks", to_bool(tasks)) |
|
282 | ||
283 | return self._send_xml_command(cmd) |
|
284 | ||
285 | def modify_target( |
|
286 | self, |
@@ 175-204 (lines=30) @@ | ||
172 | ||
173 | return self._send_xml_command(cmd) |
|
174 | ||
175 | def get_filters( |
|
176 | self, |
|
177 | *, |
|
178 | filter: Optional[str] = None, |
|
179 | filter_id: Optional[str] = None, |
|
180 | trash: Optional[bool] = None, |
|
181 | alerts: Optional[bool] = None, |
|
182 | ) -> Any: |
|
183 | """Request a list of filters |
|
184 | ||
185 | Arguments: |
|
186 | filter: Filter term to use for the query |
|
187 | filter_id: UUID of an existing filter to use for the query |
|
188 | trash: Whether to get the trashcan filters instead |
|
189 | alerts: Whether to include list of alerts that use the filter. |
|
190 | ||
191 | Returns: |
|
192 | The response. See :py:meth:`send_command` for details. |
|
193 | """ |
|
194 | cmd = XmlCommand("get_filters") |
|
195 | ||
196 | add_filter(cmd, filter, filter_id) |
|
197 | ||
198 | if trash is not None: |
|
199 | cmd.set_attribute("trash", to_bool(trash)) |
|
200 | ||
201 | if alerts is not None: |
|
202 | cmd.set_attribute("alerts", to_bool(alerts)) |
|
203 | ||
204 | return self._send_xml_command(cmd) |
|
205 | ||
206 | def get_filter( |
|
207 | self, filter_id: str, *, alerts: Optional[bool] = None |
@@ 154-183 (lines=30) @@ | ||
151 | ||
152 | return self._send_xml_command(cmd) |
|
153 | ||
154 | def get_tags( |
|
155 | self, |
|
156 | *, |
|
157 | filter: Optional[str] = None, |
|
158 | filter_id: Optional[str] = None, |
|
159 | trash: Optional[bool] = None, |
|
160 | names_only: Optional[bool] = None, |
|
161 | ) -> Any: |
|
162 | """Request a list of tags |
|
163 | ||
164 | Arguments: |
|
165 | filter: Filter term to use for the query |
|
166 | filter_id: UUID of an existing filter to use for the query |
|
167 | trash: Whether to get tags from the trashcan instead |
|
168 | names_only: Whether to get only distinct tag names |
|
169 | ||
170 | Returns: |
|
171 | The response. See :py:meth:`send_command` for details. |
|
172 | """ |
|
173 | cmd = XmlCommand("get_tags") |
|
174 | ||
175 | add_filter(cmd, filter, filter_id) |
|
176 | ||
177 | if trash is not None: |
|
178 | cmd.set_attribute("trash", to_bool(trash)) |
|
179 | ||
180 | if names_only is not None: |
|
181 | cmd.set_attribute("names_only", to_bool(names_only)) |
|
182 | ||
183 | return self._send_xml_command(cmd) |
|
184 | ||
185 | def get_tag(self, tag_id: str) -> Any: |
|
186 | """Request a single tag |
@@ 144-173 (lines=30) @@ | ||
141 | ||
142 | return self._send_xml_command(cmd) |
|
143 | ||
144 | def get_schedules( |
|
145 | self, |
|
146 | *, |
|
147 | filter: Optional[str] = None, |
|
148 | filter_id: Optional[str] = None, |
|
149 | trash: Optional[bool] = None, |
|
150 | tasks: Optional[bool] = None, |
|
151 | ) -> Any: |
|
152 | """Request a list of schedules |
|
153 | ||
154 | Arguments: |
|
155 | filter: Filter term to use for the query |
|
156 | filter_id: UUID of an existing filter to use for the query |
|
157 | trash: Whether to get the trashcan schedules instead |
|
158 | tasks: Whether to include tasks using the schedules |
|
159 | ||
160 | Returns: |
|
161 | The response. See :py:meth:`send_command` for details. |
|
162 | """ |
|
163 | cmd = XmlCommand("get_schedules") |
|
164 | ||
165 | add_filter(cmd, filter, filter_id) |
|
166 | ||
167 | if trash is not None: |
|
168 | cmd.set_attribute("trash", to_bool(trash)) |
|
169 | ||
170 | if tasks is not None: |
|
171 | cmd.set_attribute("tasks", to_bool(tasks)) |
|
172 | ||
173 | return self._send_xml_command(cmd) |
|
174 | ||
175 | def get_schedule( |
|
176 | self, schedule_id: str, *, tasks: Optional[bool] = None |
@@ 360-388 (lines=29) @@ | ||
357 | ||
358 | return self._send_xml_command(cmd) |
|
359 | ||
360 | def get_alerts( |
|
361 | self, |
|
362 | *, |
|
363 | filter: Optional[str] = None, |
|
364 | filter_id: Optional[str] = None, |
|
365 | trash: Optional[bool] = None, |
|
366 | tasks: Optional[bool] = None, |
|
367 | ) -> Any: |
|
368 | """Request a list of alerts |
|
369 | ||
370 | Arguments: |
|
371 | filter: Filter term to use for the query |
|
372 | filter_id: UUID of an existing filter to use for the query |
|
373 | trash: True to request the alerts in the trashcan |
|
374 | tasks: Whether to include the tasks using the alerts |
|
375 | Returns: |
|
376 | The response. See :py:meth:`send_command` for details. |
|
377 | """ |
|
378 | cmd = XmlCommand("get_alerts") |
|
379 | ||
380 | add_filter(cmd, filter, filter_id) |
|
381 | ||
382 | if trash is not None: |
|
383 | cmd.set_attribute("trash", to_bool(trash)) |
|
384 | ||
385 | if tasks is not None: |
|
386 | cmd.set_attribute("tasks", to_bool(tasks)) |
|
387 | ||
388 | return self._send_xml_command(cmd) |
|
389 | ||
390 | def get_alert(self, alert_id: str, *, tasks: Optional[bool] = None) -> Any: |
|
391 | """Request a single alert |