Get configuration

get

/v1/yaml/pipelines/{pipelineName}

Returns pipeline configuration in YAML format

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

{pipeline configuration in YAML}

400 Response

ERROR: Pipeline {pipelineName} does not exist
Back to Top

Examples

Two examples are shown. Both return a YAML definition for the named pipeline, the first one in structured format and the second in graph format. The pipeline in the examples contains six jobs: JobA, JobB, JobC, JobD, JobE, and JobF.

Tip:

Click pipeline diagrams to see a graphic representations of the pipeline and job flows showing what happens when you manually start the pipeline or run each of the trigger jobs from outside the pipeline. The diagrams were generated using the Pipeline Designer in Visual Builder Studio and should help you visualize the order and flow of jobs in the pipeline.

In the diagram, JobC and JobD are triggers. When JobC runs and completes successfully, JobA runs. If JobA completes successfully but fails tests or any post build action, JobE is run. If JobA runs and fails, JobF runs. When the other trigger, JobD, runs and completes successfully, JobB runs. When the pipeline is manually started, both JobA and JobB run but JobC and JobD do not.

Generate a YAML Definition in Structured Format

The first example shows how to generate a YAML definition, in structured format, for the TestPlacement pipeline. The example uses curl to implicitly submit a GET request on the REST resource.

~$ curl -u alex.admin https://myinstance.oracle.com/myorg/rest/myorg_bobtest_1/cibuild/v1/yaml/pipelines/TestPlacement
Enter host password for user 'alex.admin':
pipeline:
  name: TestPlacement
  auto-start: true
  allow-external-builds: true
  start:
    - triggers:
      - JobC
      - JobD
    - parallel:
      - JobA
      - on succeed,test-fail:
        - JobE
      - on fail:
        - JobF
      - JobB

You could use the same curl command with -X GET but, if you do and specify -verbose with any recent version of curl, you'll see a warning. Why? Because there is no need to specify the method using -X because curl already knows which method request to use without it.

Generate a YAML Definition in Graph Format

The second example shows how to generate a YAML definition, in graph format, that represents the pipeline's jobs. This example also uses curl to implicitly submit a GET request on the REST resource. Whenever you specify the graph option with a true value (y, Y, yes, or YES), a graphic representation will always be generated.

~$ curl -u alex.admin https://myinstance.mycompany.com/myorg/rest/myorg-dev_bobtest_1/cibuild/v1/yaml/pipelines/JobPlacement?graph=y
Enter host password for user 'alex.admin':
pipeline:
  name: JobPlacement
  auto-start: true
  allow-external-builds: true
  # Pipeline as graph because output graph specified
  graph:
  - JobC -> JobA
  - JobD -> JobB
  - [Start] -> JobA
  - [Start] -> JobB
  - JobA -> JobE ? succeed,test-fail
  - JobA -> JobF ? fail
Back to Top