def run_in_dev_mode(): config = ServerConfig() configure_logging(config['logging'], plain=True) server = TAXIIServer(config) app = create_app(server) app.debug = True app.run(port=9000)
def setup_logging(): configure_logging({'': 'debug'})
from opentaxii.server import TAXIIServer from opentaxii.config import ServerConfig from opentaxii.middleware import create_app from opentaxii.utils import configure_logging config = ServerConfig() configure_logging(config['logging'], plain=True) server = TAXIIServer(config) app = create_app(server) app.debug = True
import anyconfig import argparse import structlog from opentaxii.config import ServerConfig from opentaxii.server import TAXIIServer from opentaxii.utils import configure_logging from opentaxii.taxii.entities import CollectionEntity config = ServerConfig() configure_logging(config.get('logging'), plain=True) log = structlog.getLogger(__name__) def get_parser(): parser = argparse.ArgumentParser( description = "Create services via OpenTAXII Auth API", formatter_class = argparse.ArgumentDefaultsHelpFormatter ) return parser def create_services(): parser = get_parser() parser.add_argument("-c", "--services-config", dest="config", help="YAML file with services configuration", required=True) args = parser.parse_args()
import argparse import structlog from opentaxii.server import TAXIIServer from opentaxii.config import ServerConfig from opentaxii.utils import configure_logging config = ServerConfig() configure_logging(config.get('logging'), plain=True) log = structlog.getLogger(__name__) def get_parser(): parser = argparse.ArgumentParser( description = "Create Account via OpenTAXII Auth API", formatter_class = argparse.ArgumentDefaultsHelpFormatter ) return parser def create_account(): parser = get_parser() parser.add_argument("-u", "--username", dest="username", help="Username for the new account", required=True) parser.add_argument("-p", "--password", dest="password", help="Password for the new account", required=True) args = parser.parse_args() server = TAXIIServer(config)