Code Duplication    Length = 52-53 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 350-402 (lines=53) @@
347
348
        return self._send_xml_command(cmd)
349
350
    def create_audit(
351
        self,
352
        name: str,
353
        policy_id: str,
354
        target_id: str,
355
        scanner_id: str,
356
        *,
357
        alterable: Optional[bool] = None,
358
        hosts_ordering: Optional[HostsOrdering] = None,
359
        schedule_id: Optional[str] = None,
360
        alert_ids: Optional[List[str]] = None,
361
        comment: Optional[str] = None,
362
        schedule_periods: Optional[int] = None,
363
        observers: Optional[List[str]] = None,
364
        preferences: Optional[dict] = None,
365
    ) -> Any:
366
        """Create a new audit task
367
368
        Arguments:
369
            name: Name of the new audit
370
            policy_id: UUID of policy to use by the audit
371
            target_id: UUID of target to be scanned
372
            scanner_id: UUID of scanner to use for scanning the target
373
            comment: Comment for the audit
374
            alterable: Whether the task should be alterable
375
            alert_ids: List of UUIDs for alerts to be applied to the audit
376
            hosts_ordering: The order hosts are scanned in
377
            schedule_id: UUID of a schedule when the audit should be run.
378
            schedule_periods: A limit to the number of times the audit will be
379
                scheduled, or 0 for no limit
380
            observers: List of names or ids of users which should be allowed to
381
                observe this audit
382
            preferences: Name/Value pairs of scanner preferences.
383
384
        Returns:
385
            The response. See :py:meth:`send_command` for details.
386
        """
387
388
        return self.__create_task(
389
            name=name,
390
            config_id=policy_id,
391
            target_id=target_id,
392
            scanner_id=scanner_id,
393
            usage_type=UsageType.AUDIT,
394
            function=self.create_audit.__name__,
395
            alterable=alterable,
396
            hosts_ordering=hosts_ordering,
397
            schedule_id=schedule_id,
398
            alert_ids=alert_ids,
399
            comment=comment,
400
            schedule_periods=schedule_periods,
401
            observers=observers,
402
            preferences=preferences,
403
        )
404
405
    def create_config(
@@ 644-695 (lines=52) @@
641
642
        return self._send_xml_command(cmd)
643
644
    def create_task(
645
        self,
646
        name: str,
647
        config_id: str,
648
        target_id: str,
649
        scanner_id: str,
650
        *,
651
        alterable: Optional[bool] = None,
652
        hosts_ordering: Optional[HostsOrdering] = None,
653
        schedule_id: Optional[str] = None,
654
        alert_ids: Optional[List[str]] = None,
655
        comment: Optional[str] = None,
656
        schedule_periods: Optional[int] = None,
657
        observers: Optional[List[str]] = None,
658
        preferences: Optional[dict] = None,
659
    ) -> Any:
660
        """Create a new scan task
661
662
        Arguments:
663
            name: Name of the task
664
            config_id: UUID of scan config to use by the task
665
            target_id: UUID of target to be scanned
666
            scanner_id: UUID of scanner to use for scanning the target
667
            comment: Comment for the task
668
            alterable: Whether the task should be alterable
669
            alert_ids: List of UUIDs for alerts to be applied to the task
670
            hosts_ordering: The order hosts are scanned in
671
            schedule_id: UUID of a schedule when the task should be run.
672
            schedule_periods: A limit to the number of times the task will be
673
                scheduled, or 0 for no limit
674
            observers: List of names or ids of users which should be allowed to
675
                observe this task
676
            preferences: Name/Value pairs of scanner preferences.
677
678
        Returns:
679
            The response. See :py:meth:`send_command` for details.
680
        """
681
        return self.__create_task(
682
            name=name,
683
            config_id=config_id,
684
            target_id=target_id,
685
            scanner_id=scanner_id,
686
            usage_type=UsageType.SCAN,
687
            function=self.create_task.__name__,
688
            alterable=alterable,
689
            hosts_ordering=hosts_ordering,
690
            schedule_id=schedule_id,
691
            alert_ids=alert_ids,
692
            comment=comment,
693
            schedule_periods=schedule_periods,
694
            observers=observers,
695
            preferences=preferences,
696
        )
697
698
    def create_tls_certificate(