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

Gateway Administration Guide

prodname
BlueCat Gateway
version_custom
18.6.1
  1. Under Available Actions, click Create Workflow.


  2. Complete all of the required fields, then select Workflow using only REST API.
  3. 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 <dns_integrity_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 2018 BlueCat Networks. All rights reserved.
    
    from flask import request, g, abort, jsonify
    
    from bluecat import route, util
    from main_app import app
    
    # application config
    
    #
    # GET, PUT or POST
    #
    @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():
        # are we authenticated?
        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.