带有排除的Jenkins xml API显示太多

时间:2019-04-21 01:29:37

标签: xml jenkins jenkins-api

我正在为Jenkins API使用exclude选项:

http://jenkins:8080/api/xml?tree=jobs[displayName,lastBuild[result],builds[actions[lastBuiltRevision[SHA1]]]]&exclude=hudson/job/build/action/lastBuiltRevision[SHA1!=%270143cddcfab45f3081bcf47a7137b50e07860b41%27]

回复显示了太多信息:

  • 没有我的SHA1的工作
  • 没有我的SHA1的建筑物
  • 空或不相关的action

我该如何解决?

<job _class="hudson.model.FreeStyleProject">
    <displayName>JobName1</displayName>
    <build _class="hudson.model.FreeStyleBuild">
        <action _class="hudson.model.CauseAction" />
        <action _class="hudson.plugins.git.GitTagAction" />
        <action />
        <action />
        <action />
        <action />
        <action />
        <action />
        <action />
    </build>
    <lastBuild _class="hudson.model.FreeStyleBuild">
        <result>SUCCESS</result>
    </lastBuild>
</job>
<job _class="hudson.model.FreeStyleProject">
    <displayName>JobName2</displayName>
    <build _class="hudson.model.FreeStyleBuild">
        <action _class="hudson.model.CauseAction" />
        <action />
        <action _class="hudson.plugins.git.util.BuildData">
            <lastBuiltRevision>
                <SHA1>0143cddcfab45f3081bcf47a7137b50e07860b41</SHA1>
            </lastBuiltRevision>
        </action>
        <action _class="hudson.plugins.git.GitTagAction" />
        <action />
        <action />
        <action />
        <action />
        <action />
        <action />
    </build>
    <build _class="hudson.model.FreeStyleBuild">
        <action _class="hudson.model.CauseAction" />
        <action />
        <action _class="hudson.plugins.git.GitTagAction" />
        <action />
        <action />
        <action />
        <action />
        <action />
        <action />
    </build>

0 个答案:

没有答案