示例#1
0
def get_telemetry_collection_config():
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help', 403)

    try:
        enabled = get_system_config_telemetry_enabled()
    except APIException as e:
        return make_error_from_exception(e)

    return make_ok(enabled=enabled)
示例#2
0
def get_telemetry_collection_config():
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help',
                          403)

    try:
        enabled = get_system_config_telemetry_enabled()
    except APIException as e:
        return make_error_from_exception(e)

    return make_ok(enabled=enabled)
示例#3
0
def get_system_network_resolve(system_id):
    if not first_init_admin_access():
        return make_error('Request forbidden', 403)

    (success, data) = dns_resolution(system_id)
    if not success:
        current_app.logger.error(
            "network: get_system_network_resolve error: " + str(data))
        return make_error(data, 500)

    return make_ok(dns_resolution=data)
示例#4
0
def set_telemetry_collection_config():
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help', 403)

    enabled = is_json_true(request.args.get('enabled'))
    try:
        set_system_config_telemetry_enabled(enabled=enabled)
    except APIException as e:
        return make_error_from_exception(e)

    return make_ok()
示例#5
0
def set_telemetry_collection_config():
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help',
                          403)

    enabled = is_json_true(request.args.get('enabled'))
    try:
        set_system_config_telemetry_enabled(enabled=enabled)
    except APIException as e:
        return make_error_from_exception(e)

    return make_ok()
示例#6
0
def get_license_version(system_id):
    """
    Get the current versions
    """
    if not first_init_admin_access():
        return make_error ('Request forbidden -- authorization will not help', 403)

    (success, msg) = get_current_version(system_id)
    if not success:
        api_log.error("license: get_license_versions error: " + str(msg))
        return make_error("An internet connection is needed in order to activate your version.", 500)

    return make_ok(**msg)
示例#7
0
def get_license_pro(system_id):
    if not first_init_admin_access():
        return make_error ('Request forbidden -- authorization will not help', 403)

    # Retrieve URL parameters.
    key = request.args.get('key')
    if key is None:
        current_app.logger.error("license: get_license_pro error: Missing param 'key'")
        return make_error('Missing param key', 400)

    (success, msg) = register_appliance_pro(key, system_id, False)
    if not success:
        current_app.logger.error("license: get_license_pro error: " + str(msg))
        return make_error(msg, 500)

    return make_ok()
示例#8
0
def get_license_trial(system_id):
    if not first_init_admin_access():
        return make_error ('Request forbidden -- authorization will not help', 403)

    # Retrieve URL parameters.
    email = request.args.get('email')
    if email is None:
        current_app.logger.error("license: get_license_trial error: Bad param 'email'")
        return make_error('Bad parameter email', 400)

    (success, msg) = register_appliance_trial(email, system_id, False)
    if not success:
        current_app.logger.error("license: get_license_trial error: " + str(msg))
        return make_error(msg, 500)

    return make_ok()
示例#9
0
def get_license_version(system_id):
    """
    Get the current versions
    """
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help',
                          403)

    (success, msg) = get_current_version(system_id)
    if not success:
        api_log.error("license: get_license_versions error: " + str(msg))
        return make_error(
            "An internet connection is needed in order to activate your version.",
            500)

    return make_ok(**msg)
示例#10
0
def get_license_pro(system_id):
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help',
                          403)

    # Retrieve URL parameters.
    key = request.args.get('key')
    if key is None:
        current_app.logger.error(
            "license: get_license_pro error: Missing param 'key'")
        return make_error('Missing param key', 400)

    (success, msg) = register_appliance_pro(key, system_id, False)
    if not success:
        current_app.logger.error("license: get_license_pro error: " + str(msg))
        return make_error(msg, 500)

    return make_ok()
示例#11
0
def get_license_trial(system_id):
    if not first_init_admin_access():
        return make_error('Request forbidden -- authorization will not help',
                          403)

    # Retrieve URL parameters.
    email = request.args.get('email')
    if email is None:
        current_app.logger.error(
            "license: get_license_trial error: Bad param 'email'")
        return make_error('Bad parameter email', 400)

    (success, msg) = register_appliance_trial(email, system_id, False)
    if not success:
        current_app.logger.error("license: get_license_trial error: " +
                                 str(msg))
        return make_error(msg, 500)

    return make_ok()