@@ 3228-3275 (lines=48) @@ | ||
3225 | cmd.set_attribute("group_id", group_id) |
|
3226 | return self._send_xml_command(cmd) |
|
3227 | ||
3228 | def get_info_list( |
|
3229 | self, |
|
3230 | info_type: InfoType, |
|
3231 | *, |
|
3232 | filter: Optional[str] = None, |
|
3233 | filter_id: Optional[str] = None, |
|
3234 | name: Optional[str] = None, |
|
3235 | details: Optional[bool] = None, |
|
3236 | ) -> Any: |
|
3237 | """Request a list of security information |
|
3238 | ||
3239 | Arguments: |
|
3240 | info_type: Type must be either CERT_BUND_ADV, CPE, CVE, |
|
3241 | DFN_CERT_ADV, OVALDEF, NVT or ALLINFO |
|
3242 | filter: Filter term to use for the query |
|
3243 | filter_id: UUID of an existing filter to use for the query |
|
3244 | name: Name or identifier of the requested information |
|
3245 | details: Whether to include information about references to this |
|
3246 | information |
|
3247 | ||
3248 | Returns: |
|
3249 | The response. See :py:meth:`send_command` for details. |
|
3250 | """ |
|
3251 | if not info_type: |
|
3252 | raise RequiredArgument( |
|
3253 | function=self.get_info_list.__name__, argument='info_type' |
|
3254 | ) |
|
3255 | ||
3256 | if not isinstance(info_type, InfoType): |
|
3257 | raise InvalidArgumentType( |
|
3258 | function=self.get_info_list.__name__, |
|
3259 | argument='info_type', |
|
3260 | arg_type=InfoType.__name__, |
|
3261 | ) |
|
3262 | ||
3263 | cmd = XmlCommand("get_info") |
|
3264 | ||
3265 | cmd.set_attribute("type", info_type.value) |
|
3266 | ||
3267 | _add_filter(cmd, filter, filter_id) |
|
3268 | ||
3269 | if name: |
|
3270 | cmd.set_attribute("name", name) |
|
3271 | ||
3272 | if details is not None: |
|
3273 | cmd.set_attribute("details", _to_bool(details)) |
|
3274 | ||
3275 | return self._send_xml_command(cmd) |
|
3276 | ||
3277 | def get_info(self, info_id: str, info_type: InfoType) -> Any: |
|
3278 | """Request a single secinfo |
@@ 2267-2314 (lines=48) @@ | ||
2264 | ) |
|
2265 | ) |
|
2266 | ||
2267 | def get_info_list( |
|
2268 | self, |
|
2269 | info_type: InfoType, |
|
2270 | *, |
|
2271 | filter: Optional[str] = None, |
|
2272 | filter_id: Optional[str] = None, |
|
2273 | name: Optional[str] = None, |
|
2274 | details: Optional[bool] = None, |
|
2275 | ) -> Any: |
|
2276 | """Request a list of security information |
|
2277 | ||
2278 | Arguments: |
|
2279 | info_type: Type must be either CERT_BUND_ADV, CPE, CVE, |
|
2280 | DFN_CERT_ADV, OVALDEF, NVT or ALLINFO |
|
2281 | filter: Filter term to use for the query |
|
2282 | filter_id: UUID of an existing filter to use for the query |
|
2283 | name: Name or identifier of the requested information |
|
2284 | details: Whether to include information about references to this |
|
2285 | information |
|
2286 | ||
2287 | Returns: |
|
2288 | The response. See :py:meth:`send_command` for details. |
|
2289 | """ |
|
2290 | if not info_type: |
|
2291 | raise RequiredArgument( |
|
2292 | function=self.get_info_list.__name__, argument='info_type' |
|
2293 | ) |
|
2294 | ||
2295 | if not isinstance(info_type, InfoType): |
|
2296 | raise InvalidArgumentType( |
|
2297 | function=self.get_info_list.__name__, |
|
2298 | argument='info_type', |
|
2299 | arg_type=InfoType.__name__, |
|
2300 | ) |
|
2301 | ||
2302 | cmd = XmlCommand("get_info") |
|
2303 | ||
2304 | cmd.set_attribute("type", info_type.value) |
|
2305 | ||
2306 | _add_filter(cmd, filter, filter_id) |
|
2307 | ||
2308 | if name: |
|
2309 | cmd.set_attribute("name", name) |
|
2310 | ||
2311 | if details is not None: |
|
2312 | cmd.set_attribute("details", _to_bool(details)) |
|
2313 | ||
2314 | return self._send_xml_command(cmd) |
|
2315 | ||
2316 | def get_info(self, info_id: str, info_type: InfoType) -> Any: |
|
2317 | """Request a single secinfo |