REST API for Accessing YAML Files

You can use an API testing tool, such as Postman, or curl commands to run REST API methods. To run curl commands, either download curl to your computer or use the Git CLI to run curl commands.

To create the REST API URL, you need your VB Studio user name and password, the base URL of your instance, the unique organization ID, and the project ID, which you can get from any of the project's Git repository URLs.

In a Git repository URL, the project's ID is located before /scm/<repo-name>.git. For example, if https://alex.admin%40example.com@mydevcsinstance-mydomain.developer.ocp.oraclecloud.com/mydevcsinstance-mydomain/s/mydevcsinstance-mydomain_my-project_123/scm/NodeJSDocker.git is the Git repository's URL in a project, the project's unique ID will be mydevcsinstance-mydomain_my-project_123.

How Do I Validate a Job or Pipeline Configuration?

To validate a job (or pipeline) configuration, use this URL with the syntax shown, passing in the local (on your computer) YAML file as a parameter:

https://<base-url>/<identity-domain>/rest/<identity-domain>_<unique-projectID>/cibuild/v1/yaml/validate

Here's an example with a curl command that validates a job configuration on a Windows computer:

curl -X POST -H "Content-Type: text/plain" --data-binary @d:/myApps/myPHPapp/.ci-build/my_yaml_job.yml -u alex.admin@example.com:My123Password https://mydevcsinstance-mydomain.developer.ocp.oraclecloud.com/myorg/rest/myorg_my-project_1234/cibuild/v1/yaml/validate

Here's an example with a curl command that validates a pipeline configuration on a Windows computer:

curl -X POST -H "Content-Type: text/plain" --data-binary @d:/myApps/myPHPapp/.ci-build/my_yaml_pipeline.yml -u alex.admin@example.com:My123Password https://mydevcsinstance-mydomain.developer.ocp.oraclecloud.com/myorg/rest/myorg_my-project_1234/cibuild/v1/yaml/validate

Create a Job or a Pipeline Without Committing the YAML File

You can create a job or pipeline without first committing its YAML file to your project's Git repository. To do so, use a URL with this syntax, passing in a local (on your computer) YAML file as a parameter:

https://<base-url>/<identity-domain>/rest/<identity-domain>_<unique-projectID>/cibuild/v1/yaml/cibuild/yaml/import

VB Studio will read the YAML job (or pipeline) configuration and, if no errors are detected, create a new job (or pipeline). The job (or pipeline) must be explicitly named in the YAML configuration. After the job (or pipeline) has been created, you can edit its configuration on the Builds page. If errors are detected, the job (or pipeline) will not be created and the Recent Activities feed will display any error messages.

Here's an example that shows how to use a curl command with a YAML file on a Windows computer to create a job:

curl -X POST -H "Content-Type: text/plain" --data-binary @d:/myApps/myPHPapp/my_PHP_yaml_job.yml -u alex.admin@example.com https://mydevcsinstance-mydomain.developer.ocp.oraclecloud.com/myorg/rest/myorg_my-project_1234/cibuild/v1/yaml/import

You'll be prompted for the password:

Enter host password for user 'alex.admin':