Creating a REST API Workflow - Platform - BlueCat Gateway - 21.11.2

Gateway Administration Guide

Locale
English
Product name
BlueCat Gateway
Version
21.11.2
  1. Log in to BlueCat Gateway.
  2. Select Administration > Create Workflow.


  3. Complete all of the required fields, then select Workflow using only REST API.
  4. Click Submit.
    Since the new workflow was created as a REST API workflow, it will not show up on the Available Actions menu. The files for the new API are all created underneath <bluecat_gateway>/workflows/Examples/example_rest_workflow (for the current example). If you now look at the example_rest_workflow_page.py from that directory you will see:
    # Copyright 2020 BlueCat Networks. All rights reserved.
    from flask import request, g, abort, jsonify
    
    from bluecat import route, util
    from main_app import app
    
    
    @route(app, '/example_rest_workflow/example_rest_workflow_endpoint', methods=['GET', 'PUT', 'POST'])
    @util.rest_workflow_permission_required('example_rest_workflow_page')
    @util.rest_exception_catcher
    def example_rest_workflow_example_rest_workflow_page():
        # Put endpoint logic here
        g.user.logger.info('SUCCESS')
        return jsonify({"method": request.method})

    Again, you can place your own implementation in this file. Once done, it can be called by any suitable REST client using Basic authentication.