job

更新时间:2024年7月4日 08:06 浏览:164

创建

<jenkins url>/createItem

curl -X POST <jenkins url>/createItem?name=<job name> \
  --data-binary "@jobConfig.xml" \
  -H "Content-Type: text/xml" \
  --user <username>:<api token>

删除

<jenkins url>/job/<job name>/doDelete

curl -X POST <jenkins url>/job/<job name>/doDelete \
  --user <username>:<api token>

查询状态

<jenkins url>/view/<view name>/job/<job name>/api/json

curl -X GET <jenkins url>/view/<view name>/job/<job name>/api/json \
  --user <username>:<api token>

启用

<jenkins url>/view/<view name>/job/<job name>/enable

禁用

<jenkins url>/view/<view name>/job/<job name>/disable

查询配置

<jenkins url>/view/<view name>/job/<job name>/config.xml

curl -X GET <jenkins url>/view/<view name>/job/<job name>/config.xml \
  --user <username>:<api token>

更新配置

<jenkins url>/view/<view name>/job/<job name>/config.xml

curl -X POST <jenkins url>/view/<view name>/job/<job name>/config.xml \
  --data-binary "@newCofnig.xml" \
  -H "Content-Type: text/xml"  \
  --user <username>:<api token>

 

 

 

 

导航