def post(self):
        """Create a new configuration namespace"""
        self.reqparse.add_argument('namespacePrefix', type=str, required=True)
        self.reqparse.add_argument('name', type=str, required=True)
        self.reqparse.add_argument('sortOrder', type=int, required=True)
        args = self.reqparse.parse_args()

        if self.dbconfig.namespace_exists(args['namespacePrefix']):
            return self.make_response('Namespace {} already exists'.format(args['namespacePrefix']), HTTP.CONFLICT)

        ns = ConfigNamespace()

        ns.namespace_prefix = args['namespacePrefix']
        ns.name = args['name']
        ns.sort_order = args['sortOrder']

        db.session.add(ns)
        db.session.commit()

        self.dbconfig.reload_data()
        auditlog(event='configNamespace.create', actor=session['user'].username, data=args)

        return self.make_response('Namespace created', HTTP.CREATED)
def post ( self ) : self . reqparse . add_argument ( 'namespacePrefix' , type = str , required = True ) self . reqparse . add_argument ( 'name' , type = str , required = True ) self . reqparse . add_argument ( 'sortOrder' , type = int , required = True ) args = self . reqparse . parse_args ( ) if self . dbconfig . namespace_exists ( args [ 'namespacePrefix' ] ) : return self . make_response ( 'Namespace {} already exists' . format ( args [ 'namespacePrefix' ] ) , HTTP . CONFLICT ) ns = ConfigNamespace ( ) ns . namespace_prefix = args [ 'namespacePrefix' ] ns . name = args [ 'name' ] ns . sort_order = args [ 'sortOrder' ] db . session . add ( ns ) db . session . commit ( ) self . dbconfig . reload_data ( ) auditlog ( event = 'configNamespace.create' , actor = session [ 'user' ] . username , data = args ) return self . make_response ( 'Namespace created' , HTTP . CREATED )
Create a new configuration namespace