Here's a snippet of shell I use:

JTOKEN is the api token for the user
JOB is the job name
JCONF is the path to the config.xml you're posting.

The content-type header is required when creating a job, otherwise it
throws an error.

CURL="http://$DEST:8080/createItem?name=$JOB&token=$JTOKEN";

wget --verbose --auth-no-challenge --http-user=jenkins
--header='Content-type: application/xml;
charset=ISO-8859-1' --http-password=$JTOKEN -O /dev/null --post-file=$JCONF
$CURL



On Mon, Oct 21, 2013 at 3:51 PM, Fred Jabbari <[email protected]> wrote:

> Could someone point me to an example of creating a new Job through rest
> API.
> I can't get /createItem?name=jobxxx
> to work.  I do a get request and get the config.xml for a current job and
> trying to use the current job to create a new job.
> Please point me to the best practices for creating a new JOB using REST
> API.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Marc MacIntyre

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to