All API endpoints are exposed under JENKINS_URL/pipeline-model-schema
or JENKINS_URL/pipeline-model-converter
currently.
- URL:
JENKINS_URL/pipeline-model-schema/json
- Method: GET/POST
- Parameters: None
- Info: JSON schema for the JSON representation of the model.
- Returns: The JSON schema
- URL:
JENKINS_URL/pipeline-model-converter/validateJenkinsfile
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
jenkinsfile
- theJenkinsfile
contents - Info: Takes a
Jenkinsfile
and validates its syntax, semantics, steps, parameters etc on the Jenkins controller. - Returns: JSON with a
result
field that will either besuccess
orfailure
. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/validateJson
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
json
- the JSON representation - Info: Takes a JSON representation of the model and validates its syntax, semantics, steps, parameters etc on the Jenkins controller.
- Returns: JSON with a
result
field that will either besuccess
orfailure
. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/toJson
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
jenkinsfile
- theJenkinsfile
contents - Info: Takes a
Jenkinsfile
and converts it to the JSON representation for itspipeline
step. - Returns: JSON with a
result
field that will either besuccess
orfailure
. Ifsuccess
, the JSON representation will be in thejson
field. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/toJenkinsfile
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
json
- the JSON representation of the model - Info: Takes the JSON representation of the model and converts it to the contents for a
Jenkinsfile
invoking thepipeline
step. - Returns: JSON with a
result
field that will either besuccess
orfailure
. Ifsuccess
, theJenkinsfile
contents will be in thejenkinsfile
field. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/stepsToJson
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
jenkinsfile
- the Groovy representation of the steps - Info: Takes a snippet of Groovy code containing one or more steps and converts it to the JSON representation for the step(s) it contains.
- Returns: JSON with a
result
field that will either besuccess
orfailure
. Ifsuccess
, the JSON representation will be in thejson
field. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/stepsToJenkinsfile
- Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
json
- the JSON representation of the steps - Info: Takes the JSON representation of the steps and converts it to a snippet of Groovy code executing those steps.
- Returns: JSON with a
result
field that will either besuccess
orfailure
. Ifsuccess
, the Groovy contents will be in thejenkinsfile
field. Iffailure
, there'll be an additional array in theerrors
field of the error messages encountered.
- API call:
org.jenkinsci.plugins.pipeline.parser.Converter.getJSONSchema()
- Parameters: None
- Returns: Returns the JSON representation schema
- API call:
someWorkflowRun.getAction(ExecutionModelAction.class).getStages()
- Parameters: None
- Returns: The
ModelASTStages
for a particularWorkflowRun
. This is generated at the beginning of build execution, stripped ofsourceLocation
references for serialization purposes, and attached to theWorkflowRun
. Stage and branch execution order can be found here, even when the build hasn't gotten to those stages or branches yet, since the model dictates execution order.