Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Last active August 29, 2015 14:21
Show Gist options
  • Save yuuichi-fujioka/f112a9f76651b6a76533 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/f112a9f76651b6a76533 to your computer and use it in GitHub Desktop.
Jenkins REST? API
# Get jobs
curl http://192.168.0.1:8080/api/json
# Get job config
curl http://192.168.0.1:8080/job/${JOB_NAME}/config.xml
# Create a job
curl http://192.168.0.1:8080/createItem -d "name=${new_job_name}&mode=hudson.model.FreeStyleProject"
# Delete a job
curl http://192.168.0.1:8080/job/${JOB_NAME}/doDelete -X POST
# Update a job config
curl http://192.168.0.1:8080/job/${JOB_NAME}/config.xml -d @new_config.xml
# with Authentication
curl --user ${USERNAME}:${PASSWORD} http://192.168.0.1:8080/foo/bar
curl --data ${TOKEN} http://192.168.0.1:8080/foo/bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment