Validate a YAML job or pipeline configuration
/v1/yaml/validate
Request
- text/plain
string
Response
- text/plain
200 Response
Examples
The first example shows how to validate a YAML job (Syntax) or pipeline
configuration (in shellsyntax.yml
) that has no errors by submitting
a POST request on the REST resource using curl. You must have a local file
shellsyntax.yml
in your .ci-build folder for the example to
work.
curl -X POST -H 'Content-Type: text/plain' --data-binary @shellsyntax.yml -u alex.admin https://myinstance.oracle.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/validate Enter host password for user 'alex.admin': Validating job Syntax Summary: 0 errors; 0 warnings
The second example shows how to validate a YAML job (Bob) or pipeline
configuration (in job.yml
) that has errors by submitting a POST
request on the REST resource using curl. As in the previous example, you must have a
local file, job.yml
, in your .ci-build folder for the example to
work.
curl -X POST -H 'Content-Type: text/plain' --data-binary @job.yml -u alex.admin https://myinstance.oracle.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/validate Enter host password for user 'alex.admin': ERROR: Validation errors... Validating job Bob 1 job: 2 name: Bob 3 vm-template: freo ERROR: [3,16] freo is not a valid VM template name for this project ERROR: [3,1] No vm-template specified Summary: 2 errors; 0 warnings