Pipeline

Pipeline module.

A collection of functions for working with vRA Code Stream pipelines.

codestream.api.codestream.pipeline.check_pipeline(bearer_token, name, project, settings=<class 'codestream.common.VRASettings'>)

Check Pipeline.

Checks if a vRA Code Stream Pipeline exists by name.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

Outputs:

  • Output message

  • Status Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/getPipelineByNameUsingGET

codestream.api.codestream.pipeline.delete_pipeline(bearer_token, name, project, delete_deployment=False, settings=<class 'codestream.common.VRASettings'>)

Delete Pipeline.

Delete a pipeline by name and project.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

Outputs:

  • Output message

  • Status Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/deletePipelineByNameUsingDELETE

codestream.api.codestream.pipeline.enable_pipeline(bearer_token, name, project, settings=<class 'codestream.common.VRASettings'>)

Enable Pipeline.

Enables a vRA Code Stream Pipeline by name and project.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

Outputs:

  • Output message

  • Status Code

API reference: ${VRA_URL}/

codestream.api.codestream.pipeline.execute_pipeline(bearer_token, name, project, inputs=None, settings=<class 'codestream.common.VRASettings'>)

Execute Pipeline.

Executes a vRA Code Stream Pipeline by name and project.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

  • Optional input parameters

Outputs:

  • Output message

  • Status Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/executePipelineByNameUsingPOST

codestream.api.codestream.pipeline.export_pipeline(bearer_token, name, project, settings=<class 'codestream.common.VRASettings'>)

Export a Code Stream Pipeline.

Exports a Code Stream Pipeline to a file path in YAML format.

It is not the job of this function to determine if the pipeline already exists.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

  • File path

Outputs:

  • File contents

  • Status Message

  • Return Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/exportUsingGET

codestream.api.codestream.pipeline.get_pipeline(bearer_token, name, project, settings=<class 'codestream.common.VRASettings'>)

Get Code Stream Pipeline information based on provided filter.

By default returns all fields unless return_id_only=True

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

Outputs:

  • Pipeline info or ID

  • Status Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/getAllPipelinesUsingGET

codestream.api.codestream.pipeline.get_pipeline_executions(bearer_token, name, project, settings=<class 'codestream.common.VRASettings'>)

Get Pipeline executions.

Returns executions IDs for a provided pipeline name and project.

Inputs:

  • vRA URL

  • vRA Access Token

  • Pipeline Name

  • Pipeline Project

Outputs:

  • Pipeline execution IDs.

  • Status Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/getExecutionsByNameUsingGET

codestream.api.codestream.pipeline.import_pipeline(bearer_token, pipeline_spec, settings=<class 'codestream.common.VRASettings'>)

Import a Code Stream Pipeline.

Imports a Code Stream Pipeline from a file in YAML format.

Note the API endpoint will not override or update an existing pipeline.

It is not the job of this function to determine if the pipeline already exists. It is not the job of this function to determine if the provided YAML is valid.

Inputs:

  • vRA URL

  • vRA Access Token

  • The YAML contents of a file.

Outputs:

  • Status Message

  • Return Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/importYamlUsingPOST

codestream.api.codestream.pipeline.update_pipeline(bearer_token, pipeline_spec, settings=<class 'codestream.common.VRASettings'>)

Update a Code Stream Pipeline.

Updates an existing Code Stream Pipeline from a file in YAML format.

Note the API endpoint will not create a new pipeline if it doesn’t exist.

It is not the job of this function to determine if the provided YAML is valid.

Inputs:

  • vRA URL

  • vRA Access Token

  • The YAML contents of a file.

Outputs:

  • Status Message

  • Return Code

API reference: ${VRA_URL}/pipeline/api/swagger/swagger-ui.html#/Pipelines/importYamlUsingPOST

codestream.api.codestream.pipeline.validate_pipeline(pipeline_yaml)

Validate Code Stream YAML.

Takes a YAML object of a Code Stream pipeline as input and returns the pipeline specification as a JSON object.

This conformant object can then be used to pass to the vRA API.