@@ -657,6 +657,173 @@ def modify_alert(
657657
658658 return self ._send_xml_command (cmd )
659659
660+ def modify_audit (
661+ self ,
662+ audit_id : str ,
663+ * ,
664+ name : Optional [str ] = None ,
665+ policy_id : Optional [str ] = None ,
666+ target_id : Optional [str ] = None ,
667+ scanner_id : Optional [str ] = None ,
668+ alterable : Optional [bool ] = None ,
669+ hosts_ordering : Optional [HostsOrdering ] = None ,
670+ schedule_id : Optional [str ] = None ,
671+ schedule_periods : Optional [int ] = None ,
672+ comment : Optional [str ] = None ,
673+ alert_ids : Optional [List [str ]] = None ,
674+ observers : Optional [List [str ]] = None ,
675+ preferences : Optional [dict ] = None
676+ ) -> Any :
677+ """Modifies an existing task.
678+
679+ Arguments:
680+ audit_id: UUID of audit to modify.
681+ name: The name of the audit.
682+ policy_id: UUID of policy to use by the audit
683+ target_id: UUID of target to be scanned
684+ scanner_id: UUID of scanner to use for scanning the target
685+ comment: The comment on the audit.
686+ alert_ids: List of UUIDs for alerts to be applied to the audit
687+ hosts_ordering: The order hosts are scanned in
688+ schedule_id: UUID of a schedule when the audit should be run.
689+ schedule_periods: A limit to the number of times the audit will be
690+ scheduled, or 0 for no limit.
691+ observers: List of names or ids of users which should be allowed to
692+ observe this audit
693+ preferences: Name/Value pairs of scanner preferences.
694+
695+ Returns:
696+ The response. See :py:meth:`send_command` for details.
697+ """
698+ self .modify_task (
699+ task_id = audit_id ,
700+ name = name ,
701+ config_id = policy_id ,
702+ target_id = target_id ,
703+ scanner_id = scanner_id ,
704+ alterable = alterable ,
705+ hosts_ordering = hosts_ordering ,
706+ schedule_id = schedule_id ,
707+ schedule_periods = schedule_periods ,
708+ comment = comment ,
709+ alert_ids = alert_ids ,
710+ observers = observers ,
711+ preferences = preferences ,
712+ )
713+
714+ def modify_policy_set_nvt_preference (
715+ self ,
716+ policy_id : str ,
717+ name : str ,
718+ nvt_oid : str ,
719+ * ,
720+ value : Optional [str ] = None
721+ ) -> Any :
722+ """Modifies the nvt preferences of an existing policy.
723+
724+ Arguments:
725+ policy_id: UUID of policy to modify.
726+ name: Name for preference to change.
727+ nvt_oid: OID of the NVT associated with preference to modify
728+ value: New value for the preference. None to delete the preference
729+ and to use the default instead.
730+ """
731+ self .modify_config_set_nvt_preference (
732+ config_id = policy_id ,
733+ name = name ,
734+ nvt_oid = nvt_oid ,
735+ value = value ,
736+ )
737+
738+ def modify_policy_set_name (self , policy_id : str , name : str ) -> Any :
739+ """Modifies the name of an existing policy
740+
741+ Arguments:
742+ config_id: UUID of policy to modify.
743+ name: New name for the config.
744+ """
745+ self .modify_config_set_name (
746+ config_id = policy_id ,
747+ name = name ,
748+ )
749+
750+ def modify_policy_set_comment (
751+ self , policy_id : str , comment : Optional [str ] = ""
752+ ) -> Any :
753+ """Modifies the comment of an existing policy
754+
755+ Arguments:
756+ policy_id: UUID of policy to modify.
757+ comment: Comment to set on a config. Default: ''
758+ """
759+ self .modify_config_set_comment (
760+ config_id = policy_id ,
761+ comment = comment ,
762+ )
763+
764+ def modify_policy_set_scanner_preference (
765+ self , policy_id : str , name : str , * , value : Optional [str ] = None
766+ ) -> Any :
767+ """Modifies the scanner preferences of an existing policy
768+
769+ Arguments:
770+ policy_id: UUID of policy to modify.
771+ name: Name of the scanner preference to change
772+ value: New value for the preference. None to delete the preference
773+ and to use the default instead.
774+
775+ """
776+ self .modify_config_set_scanner_preference (
777+ config_id = policy_id ,
778+ name = name ,
779+ value = value ,
780+ )
781+
782+ def modify_policy_set_nvt_selection (
783+ self , policy_id : str , family : str , nvt_oids : List [str ]
784+ ) -> Any :
785+ """Modifies the selected nvts of an existing policy
786+
787+ The manager updates the given family in the config to include only the
788+ given NVTs.
789+
790+ Arguments:
791+ policy_id: UUID of policy to modify.
792+ family: Name of the NVT family to include NVTs from
793+ nvt_oids: List of NVTs to select for the family.
794+ """
795+ self .modify_config_set_nvt_selection (
796+ config_id = policy_id ,
797+ family = family ,
798+ nvt_oids = nvt_oids ,
799+ )
800+
801+ def modify_policy_set_family_selection (
802+ self ,
803+ policy_id : str ,
804+ families : List [str ],
805+ * ,
806+ auto_add_new_families : Optional [bool ] = True ,
807+ auto_add_new_nvts : Optional [bool ] = True
808+ ) -> Any :
809+ """
810+ Selected the NVTs of a policy at a family level.
811+
812+ Arguments:
813+ policy_id: UUID of policy to modify.
814+ families: List of NVT family names to select.
815+ auto_add_new_families: Whether new families should be added to the
816+ policy automatically. Default: True.
817+ auto_add_new_nvts: Whether new NVTs in the selected families should
818+ be added to the policy automatically. Default: True.
819+ """
820+ self .modify_config_set_family_selection (
821+ config_id = policy_id ,
822+ families = families ,
823+ auto_add_new_families = auto_add_new_families ,
824+ auto_add_new_nvts = auto_add_new_nvts ,
825+ )
826+
660827 def modify_tls_certificate (
661828 self ,
662829 tls_certificate_id : str ,
0 commit comments