All API endpoints are exposed under JENKINS_URL/pipeline-model-converter
currently.
- URL:
JENKINS_URL/pipeline-model-converter/schema
- Parameters: None
- Info: JSON schema for the JSON representation of the model.
- Returns: The JSON schema
- URL:
JENKINS_URL/pipeine-model-converter/validateJenkinsfile
- Parameters:
jenkinsfile
- theJenkinsfile
contents - Info: Takes a
Jenkinsfile
and validates its syntax, semantics, steps, parameters etc on the Jenkins master. - 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/pipeine-model-converter/validateJson
- Parameters:
json
- the JSON representation - Info: Takes a JSON representation of the model and validates its syntax, semantics, steps, parameters etc on the Jenkins master.
- 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
- 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
- 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
- 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
- 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.