@@ 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 |
@@ 2235-2282 (lines=48) @@ | ||
2232 | ) |
|
2233 | ) |
|
2234 | ||
2235 | def get_info_list( |
|
2236 | self, |
|
2237 | info_type: InfoType, |
|
2238 | *, |
|
2239 | filter: Optional[str] = None, |
|
2240 | filter_id: Optional[str] = None, |
|
2241 | name: Optional[str] = None, |
|
2242 | details: Optional[bool] = None, |
|
2243 | ) -> Any: |
|
2244 | """Request a list of security information |
|
2245 | ||
2246 | Arguments: |
|
2247 | info_type: Type must be either CERT_BUND_ADV, CPE, CVE, |
|
2248 | DFN_CERT_ADV, OVALDEF, NVT or ALLINFO |
|
2249 | filter: Filter term to use for the query |
|
2250 | filter_id: UUID of an existing filter to use for the query |
|
2251 | name: Name or identifier of the requested information |
|
2252 | details: Whether to include information about references to this |
|
2253 | information |
|
2254 | ||
2255 | Returns: |
|
2256 | The response. See :py:meth:`send_command` for details. |
|
2257 | """ |
|
2258 | if not info_type: |
|
2259 | raise RequiredArgument( |
|
2260 | function=self.get_info_list.__name__, argument='info_type' |
|
2261 | ) |
|
2262 | ||
2263 | if not isinstance(info_type, InfoType): |
|
2264 | raise InvalidArgumentType( |
|
2265 | function=self.get_info_list.__name__, |
|
2266 | argument='info_type', |
|
2267 | arg_type=InfoType.__name__, |
|
2268 | ) |
|
2269 | ||
2270 | cmd = XmlCommand("get_info") |
|
2271 | ||
2272 | cmd.set_attribute("type", info_type.value) |
|
2273 | ||
2274 | _add_filter(cmd, filter, filter_id) |
|
2275 | ||
2276 | if name: |
|
2277 | cmd.set_attribute("name", name) |
|
2278 | ||
2279 | if details is not None: |
|
2280 | cmd.set_attribute("details", _to_bool(details)) |
|
2281 | ||
2282 | return self._send_xml_command(cmd) |
|
2283 | ||
2284 | def get_info(self, info_id: str, info_type: InfoType) -> Any: |
|
2285 | """Request a single secinfo |