def build_discarder(registry, xml_parent, data):
 base_sub = XML.SubElement(xml_parent, 'jenkins.model.BuildDiscarderProperty')
 strategy = XML.SubElement(base_sub, 'strategy')
 strategy.set('class', 'hudson.tasks.LogRotator')
 mappings = [('days-to-keep', 'daysToKeep', (-1)), ('num-to-keep', 'numToKeep', (-1)), ('artifact-days-to-keep', 'artifactDaysToKeep', (-1)), ('artifact-num-to-keep', 'artifactNumToKeep', (-1))]
 helpers.convert_mapping_to_xml(strategy, data, mappings, fail_required=True)

def build_discarder ( registry , xml_parent , data ) : base_sub = XML . SubElement ( xml_parent , 'jenkins.model.BuildDiscarderProperty' ) strategy = XML . SubElement ( base_sub , 'strategy' ) strategy . set ( 'class' , 'hudson.tasks.LogRotator' ) mappings = [ ( 'days-to-keep' , 'daysToKeep' , ( - 1 ) ) , ( 'num-to-keep' , 'numToKeep' , ( - 1 ) ) , ( 'artifact-days-to-keep' , 'artifactDaysToKeep' , ( - 1 ) ) , ( 'artifact-num-to-keep' , 'artifactNumToKeep' , ( - 1 ) ) ] helpers . convert_mapping_to_xml ( strategy , data , mappings , fail_required = True )
yaml: build-discarder :arg int days-to-keep: number of days to keep builds for :arg int num-to-keep: number of builds to keep :arg int artifact-days-to-keep: number of days to keep builds with artifacts :arg int artifact-num-to-keep: number of builds with artifacts to keep example: .