SovLabs RESTipe™ Guide

The SovLabs RESTipe™ is a single JSON or YAML formatted script, based on the SovLabs Template Engine

Anatomy

Define global variables, then define steps

Variables

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }}
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
                          

Steps

Creates the logic and control flow

Execute vRO workflow

stepName
description: Description of step
method: workflow
params:
  List all input parameter fieldNames and the value.
  Reference a global variable by {{ restipe.varName }}
  *Currently only supports string or number field inputs
nextStep: Define the next step to go to when workflow succeeds

*To reference the vRO workflow output(s) in following steps:
{{ restipe.stepName.outputVarName }}

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }},
                           "steps": {
                            "stepName1": {
                             "description": "Step description",
                             "workflowId": "vRO workflow ID",
                             "method": "workflow",
                             "params": {
                              "inputVarName": "{{ restipe.var1 }}"
                             }
                             "nextStep": "stepName2"
                            }
                           }
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
    
                          ####################
                          #  Restipe Steps
                          ####################
                          steps:
                           stepName1
                            description: "Step description"
                            workflowId: "vRO workflow ID"
                            method: workflow
                            params:
                             inputVarName: "{{ restipe.var1 }}"
                            nextStep: "stepName2"
                          

Execute a conditional

Step to determine a condition (if/else)
stepName
description: Description of step
method: condition
nextStep: Define the next step to go to when workflow based on the condition in an if/elsif/else statement
  {% if var1 == 'Yes' %}nextStep2{% elsif var1 == 'Maybe' %}nextStep3{% else %}nextStep4{% endif %}

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }},
                           "steps": {
                            "stepName1": {
                             "description": "Step description",
                             "method": "condition",
                             "nextStep": "{% if var1 == 'Yes' %}nextStep2{% elsif var1 == 'Maybe' %}nextStep3{% else %}nextStep4{% endif %}"
                            }
                           }
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
    
                          ####################
                          #  Restipe Steps
                          ####################
                          steps:
                           stepName1
                            description: Step description
                            method: condition
                            nextStep: "{% if var1 == 'Yes' %}nextStep2{% elsif var1 == 'Maybe' %}nextStep3{% else %}nextStep4{% endif %}"
                          

Execute a GET

stepName
description: Description of step
method: get
url: Define the URL
params:
  param1: paramValue1  nextStep: Define the next step to go to based on return

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }},
                           "steps": {
                            "stepName1": {
                             "description": "Step description",
                             "method": "get",
                             "url": "{{ restipe.baseurl }}/api/action",
                             "params": {
                              "var1": "{{ restipe.var1 }}"
                             }
                             "nextStep": "{% if restipe.stepName1.status == '200' %}nextStep2{% else %}FAILURE{% endif %}"
                            }
                           }
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
    
                          ####################
                          #  Restipe Steps
                          ####################
                          steps:
                           stepName1
                            description: Step description
                            method: get
                            url: "{{ restipe.baseurl }}/api/action"
                            params:
                             var1: "{{ restipe.var1 }}"
                            nextStep: "{% if restipe.stepName1.status == '200' %}nextStep2{% else %}FAILURE{% endif %}"
                          

Execute a POST/PATCH

stepName
description: Description of step
method: post or patch
url: Define the URL
body:
  param1: paramValue1  nextStep: Define the next step to go to based on return

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }},
                           "steps": {
                            "stepName1": {
                             "description": "Step description",
                             "method": "patch",
                             "url": "{{ restipe.baseurl }}/api/action",
                             "body": {
                              "var1": "{{ restipe.var1 }}"
                             }
                             "nextStep": "{% if restipe.stepName1.status == '200' %}nextStep2{% else %}FAILURE{% endif %}"
                            }
                           }
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
    
                          ####################
                          #  Restipe Steps
                          ####################
                          steps:
                           stepName1
                            description: Step description
                            method: patch
                            url: "{{ restipe.baseurl }}/api/action"
                            body:
                             var1: "{{ restipe.var1 }}"
                            nextStep: "{% if restipe.stepName1.status == '200' %}nextStep2{% else %}FAILURE{% endif %}"
                          

Execute a DELETE

stepName
description: Description of step
method: delete
url: Define the URL
nextStep: Define the next step to go to based on return

Example
  • Global variables in JSON

    {
                           "restipeName": "SovLabs (module) vRA Integration",
                           "description": "SovLabs (module vRA description",
                           "debugLoggin: true,
                           "user: "{{ restipe.host.user }}",
                           "password": "{{ restipe.host.password }}",
                           "useBasicAuth": true,
                           "baseurl": "{{ restipe.host.protocol://{{ restipe.host.hostname }}:{{ restipe.host.port }}/api",
                           "var1": {{ myvar1 }},
                           "steps": {
                            "stepName1": {
                             "description": "Step description",
                             "method": "delete",
                             "url": "{{ restipe.baseurl }}/api/action/{{ restipe.var1 }}",
                             "nextStep": "{% if restipe.stepName1.status == '200' %}SUCCESS{% else %}FAILURE{% endif %}"
                            }
                           }
                        }
                          
  • Global variables in YAML

    ---
                          restipeName: SovLabs F5 vRA Integration
    
                          #  debugLogging enables verbose logging about the METHOD, URL, and Parameters/body being sent to the rest calls
                          debugLogging: true
    
                          #  Use basic authentication to connect to
                          useBasicAuth: true
    
                          #  Set the Base URL for all of the Rest calls.
                          baseurl: "{{restipe.host.protocol}}://{{restipe.host.hostname}}:{{restipe.host.port}}/mgmt/tm"
    
                          ####################
                          #  Input Variables
                          ####################
                          var1: "{{ myvar1 }}"
    
                          ####################
                          #  Restipe Steps
                          ####################
                          steps:
                           stepName1
                            description: Step description
                            method: delete
                            url: "{{ restipe.baseurl }}/api/action/{{ restipe.var1 }}"
                            nextStep: "{% if restipe.stepName1.status == '200' %}SUCCESS{% else %}FAILURE{% endif %}"
                          

End a RESTipe

Set SUCCESS or FAILURE to end a RESTipe in nextStep
stepName

description: Description of step
method: condition
nextStep: {% if var1 == 'true' %}SUCCESS{% else %}FAILURE{% endif %}