首页 > 解决方案 > 获取 jenkins 作业 xml 配置

问题描述

如何在不使用用户名和密码的情况下获取 jenkins 作业 xml 配置?

server=jenkins.Jenkins(jenkins_url,*username="",password=""*)
job_name = 'Test Job'

job_xml = server.get_job_config(job_name)

使用用户名和密码详细信息,正在获取 xml,但是当不使用凭据时,作业会引发错误。

Authentication required

     <!-- You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't):
hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
    </body> </html>

标签: pythonjenkins

解决方案


推荐阅读