Code Duplication    Length = 60-60 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 5002-5061 (lines=60) @@
4999
        cmd.set_attribute("details", "1")
5000
        return self._send_xml_command(cmd)
5001
5002
    def get_nvts(
5003
        self,
5004
        *,
5005
        details: Optional[bool] = None,
5006
        preferences: Optional[bool] = None,
5007
        preference_count: Optional[bool] = None,
5008
        timeout: Optional[bool] = None,
5009
        config_id: Optional[str] = None,
5010
        preferences_config_id: Optional[str] = None,
5011
        family: Optional[str] = None,
5012
        sort_order: Optional[str] = None,
5013
        sort_field: Optional[str] = None,
5014
    ):
5015
        """Request a list of nvts
5016
5017
        Arguments:
5018
            details: Whether to include full details
5019
            preferences: Whether to include nvt preferences
5020
            preference_count: Whether to include preference count
5021
            timeout: Whether to include the special timeout preference
5022
            config_id: UUID of scan config to which to limit the NVT listing
5023
            preferences_config_id: UUID of scan config to use for preference
5024
                values
5025
            family: Family to which to limit NVT listing
5026
            sort_order: Sort order
5027
            sort_field: Sort field
5028
5029
        Returns:
5030
            The response. See :py:meth:`send_command` for details.
5031
        """
5032
        cmd = XmlCommand("get_nvts")
5033
5034
        if details is not None:
5035
            cmd.set_attribute("details", _to_bool(details))
5036
5037
        if preferences is not None:
5038
            cmd.set_attribute("preferences", _to_bool(preferences))
5039
5040
        if preference_count is not None:
5041
            cmd.set_attribute("preference_count", _to_bool(preference_count))
5042
5043
        if timeout is not None:
5044
            cmd.set_attribute("timeout", _to_bool(timeout))
5045
5046
        if config_id:
5047
            cmd.set_attribute("config_id", config_id)
5048
5049
        if preferences_config_id:
5050
            cmd.set_attribute("preferences_config_id", preferences_config_id)
5051
5052
        if family:
5053
            cmd.set_attribute("family", family)
5054
5055
        if sort_order:
5056
            cmd.set_attribute("sort_order", sort_order)
5057
5058
        if sort_field:
5059
            cmd.set_attribute("sort_field", sort_field)
5060
5061
        return self._send_xml_command(cmd)
5062
5063
    def get_nvt(self, nvt_oid: str):
5064
        """Request a single nvt

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 3368-3427 (lines=60) @@
3365
        cmd.set_attribute("details", "1")
3366
        return self._send_xml_command(cmd)
3367
3368
    def get_nvts(
3369
        self,
3370
        *,
3371
        details: Optional[bool] = None,
3372
        preferences: Optional[bool] = None,
3373
        preference_count: Optional[bool] = None,
3374
        timeout: Optional[bool] = None,
3375
        config_id: Optional[str] = None,
3376
        preferences_config_id: Optional[str] = None,
3377
        family: Optional[str] = None,
3378
        sort_order: Optional[str] = None,
3379
        sort_field: Optional[str] = None,
3380
    ):
3381
        """Request a list of nvts
3382
3383
        Arguments:
3384
            details: Whether to include full details
3385
            preferences: Whether to include nvt preferences
3386
            preference_count: Whether to include preference count
3387
            timeout: Whether to include the special timeout preference
3388
            config_id: UUID of scan config to which to limit the NVT listing
3389
            preferences_config_id: UUID of scan config to use for preference
3390
                values
3391
            family: Family to which to limit NVT listing
3392
            sort_order: Sort order
3393
            sort_field: Sort field
3394
3395
        Returns:
3396
            The response. See :py:meth:`send_command` for details.
3397
        """
3398
        cmd = XmlCommand("get_nvts")
3399
3400
        if details is not None:
3401
            cmd.set_attribute("details", _to_bool(details))
3402
3403
        if preferences is not None:
3404
            cmd.set_attribute("preferences", _to_bool(preferences))
3405
3406
        if preference_count is not None:
3407
            cmd.set_attribute("preference_count", _to_bool(preference_count))
3408
3409
        if timeout is not None:
3410
            cmd.set_attribute("timeout", _to_bool(timeout))
3411
3412
        if config_id:
3413
            cmd.set_attribute("config_id", config_id)
3414
3415
        if preferences_config_id:
3416
            cmd.set_attribute("preferences_config_id", preferences_config_id)
3417
3418
        if family:
3419
            cmd.set_attribute("family", family)
3420
3421
        if sort_order:
3422
            cmd.set_attribute("sort_order", sort_order)
3423
3424
        if sort_field:
3425
            cmd.set_attribute("sort_field", sort_field)
3426
3427
        return self._send_xml_command(cmd)
3428
3429
    def get_nvt(self, nvt_oid: str):
3430
        """Request a single nvt