Exemple #1
0
from flask import current_app, Blueprint, request

from al_ui.api_base import api_login, make_api_response

API_PREFIX = "/api/v3"
apiv3 = Blueprint("apiv3", __name__, url_prefix=API_PREFIX)
apiv3._doc = "Api Documentation"
def make_subapi_blueprint(name):
    """ Create a flask Blueprint for a subapi in a standard way. """
    return Blueprint("apiv3." + name, name, url_prefix='/'.join([API_PREFIX, name]))

#####################################
## API DOCUMENTATION
@apiv3.route("/")
@api_login(audit=False, required_priv=['R', 'W'])
def get_api_documentation(*args, **kwargs):
    """
    Full API doc.
    
    Loop through all registered API paths and display their documentation. 
    Returns a list of API definition.
    
    Variables: 
    None
    
    Arguments: 
    None
    
    Data Block:
    None
Exemple #2
0
from flask import current_app, Blueprint, request

from assemblyline_ui.api.base import api_login, make_api_response
from assemblyline_ui.config import config

API_PREFIX = "/api/v4"
apiv4 = Blueprint("apiv4", __name__, url_prefix=API_PREFIX)
apiv4._doc = "Version 4 Api Documentation"


#####################################
# API DOCUMENTATION
# noinspection PyProtectedMember,PyBroadException
@apiv4.route("/")
@api_login(
    audit=False,
    required_priv=['R', 'W'],
    require_type=["user", "signature_importer", "signature_manager", "admin"])
def get_api_documentation(**kwargs):
    """
    Full API doc.

    Loop through all registered API paths and display their documentation.
    Returns a list of API definition.

    Variables:
    None

    Arguments:
    None
Exemple #3
0
from flask import current_app, Blueprint, request

from assemblyline_service_server.api.base import make_api_response

API_PREFIX = "/api/v1"
apiv1 = Blueprint("apiv1", __name__, url_prefix=API_PREFIX)
apiv1._doc = "Version 1 Api Documentation"


#####################################
# API DOCUMENTATION
# noinspection PyProtectedMember,PyBroadException
@apiv1.route("/")
def get_api_documentation(**kwargs):
    """
    Full API doc.

    Loop through all registered API paths and display their documentation.
    Returns a list of API definition.

    Variables:
    None

    Arguments:
    None

    Data Block:
    None

    Result example:
    [                            # LIST of: