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- theJenkinsfilecontents - Info: Takes a
Jenkinsfileand validates its syntax, semantics, steps, parameters etc on the Jenkins controller. - Returns: JSON with a
resultfield that will either besuccessorfailure. Iffailure, there'll be an additional array in theerrorsfield 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
resultfield that will either besuccessorfailure. Iffailure, there'll be an additional array in theerrorsfield of the error messages encountered.
- URL:
JENKINS_URL/pipeline-model-converter/toJson - Method: POST
- Content-Type: application/x-www-form-urlencoded
- Parameters:
jenkinsfile- theJenkinsfilecontents - Info: Takes a
Jenkinsfileand converts it to the JSON representation for itspipelinestep. - Returns: JSON with a
resultfield that will either besuccessorfailure. Ifsuccess, the JSON representation will be in thejsonfield. Iffailure, there'll be an additional array in theerrorsfield 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
Jenkinsfileinvoking thepipelinestep. - Returns: JSON with a
resultfield that will either besuccessorfailure. Ifsuccess, theJenkinsfilecontents will be in thejenkinsfilefield. Iffailure, there'll be an additional array in theerrorsfield 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
resultfield that will either besuccessorfailure. Ifsuccess, the JSON representation will be in thejsonfield. Iffailure, there'll be an additional array in theerrorsfield 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
resultfield that will either besuccessorfailure. Ifsuccess, the Groovy contents will be in thejenkinsfilefield. Iffailure, there'll be an additional array in theerrorsfield 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
ModelASTStagesfor a particularWorkflowRun. This is generated at the beginning of build execution, stripped ofsourceLocationreferences 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.