Flask-PyMongo support - Platform - BlueCat Gateway - 18.6.1

Gateway Administration Guide

prodname
BlueCat Gateway
version_custom
18.6.1

The DNS Integrity Gateway supports Flask-PyMongo, allowing you to use the Python Flask micro-framework within the DNS Integrity Gateway to configure and connect to MongoDB. Once configured, you can use your MongoDB from within a workflow to persist information between the workflow and executions.

Some options of Flask-PyMongo can be predefined in the config.py file. The primary configurable options are as follows:

  • MONGO_HOST : default ‘localhost’

  • MONGO_PORT : default 27017

  • MONGO_DBNAME : default 'bluecat_portal_DB'

  • MONGO_USERNAME : default None

Path to decoded file that contains the MongoDB password:
  • MONGO_PASSWORD_PATH: default "ps/.mongoDB"

Attention: Once the value for the MongoDB password path is defined, DNS Integrity Gateway will use that file by default. If the password path is not defined or the file is missing in the defined path, the value for MONGO_PASSWORD will be None.

Example:

# imports
from bluecat.util import get_portal_mongo_db

portal_mongoDB = get_portal_mongo_db()
portal_mongoDB.db.example_collection.insert({"company": "BluecatNetworks"})