Python modules - Platform - BlueCat Gateway - 19.8.1

Gateway Administration Guide

prodname
BlueCat Gateway
version_custom
19.8.1

Each UI Component Field inherits from WTForm fields. Appropriate examples of how to use and customize UI Component Fields can be found in the example workflows shipped together with BlueCat Gateway. For details on full UI Component Field references, see BlueCat Python API documentation.

Here is a quick overview on UI Component Field Python modules found in the <bluecat_gateway> directory:

  • wtform_fields.py—contains the actual UI Component Fields and their parent classes. Use these fields directly in workflows. Refer to example workflows for details.
  • wtform_extensions.py—contains customizations and common code which are not Component Field classes.
  • server_endpoints.py—contains all UI Component Fields’ server-side logic to retrieve data as well as endpoint creation. The default JSON format for all messages sent to client is as follows:
    {'status':     FAIL or SUCCESS to indicate if call was successful.
     'message':    String message, error description for example.
     'data':{}     Dictionary with the actual data; can be empty if there is no data found.
    }

There is a hook passed to each of the endpoints to allow for data customization and data manipulation before returning to the client side. Each component has a result_decorator function parameter to permit this. For usage examples refer to the “Add Host Record Example” workflow. Those server data retrieval functions can be used outside of a UI Component Field if desired.

  • wtform_util.py—helper module for methods the UI Component Fields are using, especially in regards to JavaScript generation. Except for a reference point to see the default behavior, you should not call these methods directly.
  • wtform_widget.py—BlueCat customization on the default WTform classes which specify how HTML for each field is rendered with the addition of extra JavaScript. They are used in UI Component Fields directly.