Skip to content

[JENKINS-8797] Add support for retrieving job configuration via Jenkins CLI #15631

Closed

Description

@jenkins-infra-bot

The Jenkins CLI is missing support for retrieving the configuration of a job. The http://jenkins/job/name/config.xml URL only works when no authentication/authorization is required to access the file. The new command for the Jenkins CLI would complement the already existing create-job command.


Originally reported by sebastian_bergmann, imported from: Add support for retrieving job configuration via Jenkins CLI
  • status: Resolved
  • priority: Major
  • component(s): cli
  • resolution: Fixed
  • resolved: 2011-08-10T02:30:20+00:00
  • votes: 2
  • watchers: 4
  • imported: 2025-11-24
Raw content of original issue

The Jenkins CLI is missing support for retrieving the configuration of a job. The http://jenkins/job/name/config.xml URL only works when no authentication/authorization is required to access the file. The new command for the Jenkins CLI would complement the already existing create-job command.

Activity

  1. jenkins-infra-bot commented on Mar 11, 2011

    @jenkins-infra-bot
    Author
    anthonyjeffery:
    • Original comment link
    • Raw content of original comment:

      I am also interested in this. In addition to getting the job config via CLI, we also need capability to set the job config via CLI. This is a legit use case for several of my customers and a CLI capability which other CI toolkits include.

      Parameters to the edit-job would be the job name and/or updated xml file on the filesystem. Seems easy to implement.

      -Anthony

    I am also interested in this. In addition to getting the job config via CLI, we also need capability to set the job config via CLI. This is a legit use case for several of my customers and a CLI capability which other CI toolkits include.

    Parameters to the edit-job would be the job name and/or updated xml file on the filesystem. Seems easy to implement.

    -Anthony

  2. jenkins-infra-bot commented on Apr 1, 2011

    @jenkins-infra-bot
    Author
    mfriedenhagen:

    Hm, curl -u USERNAME http://jenkins/job/name/config.xml works for me. curl wants me to enter the password then or I could provide it via -uUSERNAME:PASSWORD.

  3. jenkins-infra-bot commented on Jun 22, 2011

    @jenkins-infra-bot
    Author
    kscheer:
    • Original comment link
    • Raw content of original comment:

      Additionally, if you want to use wget, you can use

      wget --user=username --password=password http://jenkins/job/name/config.xml.

      This also works for the node toggleOffline command.

    Additionally, if you want to use wget, you can use

    wget --user=username --password=password http://jenkins/job/name/config.xml.

    This also works for the node toggleOffline command.

  4. jenkins-infra-bot commented on Aug 10, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    core/src/main/java/hudson/cli/GetJobXmlCommand.java
    core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
    core/src/main/java/hudson/model/AbstractItem.java
    http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
    Log:
    [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
    definitions.

    Compare: 297aff0...6b2af91

  5. jenkins-infra-bot commented on Aug 10, 2011

    @jenkins-infra-bot
    Author
    dogfood:
    • Original comment link
    • Raw content of original comment:

      Integrated in jenkins_main_trunk #1038 [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML

      Kohsuke Kawaguchi : 6b2af9157a45d26f549bd2279d0f57fe8484bef9 Files :

      • changelog.html
      • core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
      • core/src/main/java/hudson/model/AbstractItem.java
      • core/src/main/java/hudson/cli/GetJobXmlCommand.java

    Integrated in jenkins_main_trunk #1038
    [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML

    Kohsuke Kawaguchi : 6b2af9157a45d26f549bd2279d0f57fe8484bef9
    Files :

    • changelog.html
    • core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
    • core/src/main/java/hudson/model/AbstractItem.java
    • core/src/main/java/hudson/cli/GetJobXmlCommand.java
  6. jenkins-infra-bot commented on Sep 12, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/cli/GetJobXmlCommand.java core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9 Log: [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML definitions.

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    core/src/main/java/hudson/cli/GetJobXmlCommand.java
    core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
    core/src/main/java/hudson/model/AbstractItem.java
    http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
    Log:
    [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
    definitions.

  7. jenkins-infra-bot commented on Oct 20, 2011

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/cli/GetJobXmlCommand.java core/src/main/java/hudson/cli/UpdateJobXmlCommand.java core/src/main/java/hudson/model/AbstractItem.java http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9 Log: [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML definitions.

    Code changed in jenkins
    User: Kohsuke Kawaguchi
    Path:
    changelog.html
    core/src/main/java/hudson/cli/GetJobXmlCommand.java
    core/src/main/java/hudson/cli/UpdateJobXmlCommand.java
    core/src/main/java/hudson/model/AbstractItem.java
    http://jenkins-ci.org/commit/jenkins/6b2af9157a45d26f549bd2279d0f57fe8484bef9
    Log:
    [FIXED JENKINS-8797] added CLI commands to manipulate jobs by their XML
    definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions