Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

What are Pipeline Objects?

Inside any automation pipeline there are objects automatically provided to you at execution time which can be accessed without any further allocation steps. Such an object is called Pipeline Object. These objects can be accessed using the Pipeline Expression Language (PEL). Some of them are read-only and some are read-write. Here is an example how to use such an implicite object inside a pipeline:

Code Block

...

language

...

headers

...

body

...

request

...

response

yaml
pipeline:
  - body.set: "This pipeline was called with id: ${request.params['id']}"

Also see: https://logabit.atlassian.net/wiki/spaces/PA/pages/2543026496/Pipeline+Expression+Language+PEL#Accessing-Implicite-Pipeline-Objects%E2%80%8B .

Here is the reference documentation of these objects:

Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

vars

Status
colourBlue
titleSince version 1.0

...

Here is an example of a pipeline which accesses the header attribute contentType and writes it to the body:

Code Block
languageyaml
headers:
  contentType: "text/plain"

pipeline:
  - body.set:
      value: "The type is: ${headers.contentType}"

...

Here is an example which defines an initial body value and replaces this with another text in the pipeline:

Code Block
languageyaml
body: "Hello World"

pipeline:
  - body.set:
      value: "The text from body is: ${body}"

...

Here is an example which sets the HTTP 401 on the current request:

Code Block
languageyaml
pipeline: 
  - body.set: ${context.response.statusCode = 401}

...

You can also use the command http.response.set in order to set the response values:

Code Block
languageyaml
pipeline: 
  - http.response.set: 
      statusCode: 401
      headers:
        X-Special: "MyValue"

...

A key-value map of all HTT request query parameters of the current request.

Example:

Code Block
languageyaml
pipeline:
  - body.set: "This pipeline was called with id: ${request.params['id']'}"

request.protocol

Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1.

...

Status
colourBlue
titleSince version 9.0

Also see: Pipeline Error Handling

In case an exception happened in this pipeline, this object will contain all required information about it. Otherwise this object is null.

...