Exemple #1
0
def jump_host_delete(hostname):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized', return_code=HTTP_NOT_AUTHORIZED)
        return api_jump_host.api_delete_jump_host(hostname)
    except Exception as e:
        return failed_response(e.message)
Exemple #2
0
def jump_host_delete(hostname):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized',
                                   return_code=HTTP_NOT_AUTHORIZED)
        return api_jump_host.api_delete_jump_host(hostname)
    except Exception as e:
        return failed_response(e.message)
Exemple #3
0
def custom_command_profile_delete(profile_name):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized', return_code=HTTP_NOT_AUTHORIZED)

        return api_custom_command_profile.api_delete_custom_command_profile(profile_name)
    except Exception as e:
        return failed_response(e.message)
Exemple #4
0
def server_repository_delete(hostname):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized', return_code=HTTP_NOT_AUTHORIZED)
        else:
            return api_server_repository.api_delete_server_repositories(hostname)
    except Exception as e:
        return failed_response(e.message)
Exemple #5
0
def region_delete(name):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized', return_code=HTTP_NOT_AUTHORIZED)
        else:
            return api_region.api_delete_region(name)
    except Exception as e:
        return failed_response(e.message)
Exemple #6
0
def region_delete(name):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized',
                                   return_code=HTTP_NOT_AUTHORIZED)
        else:
            return api_region.api_delete_region(name)
    except Exception as e:
        return failed_response(e.message)
Exemple #7
0
def custom_command_profile_delete(profile_name):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized',
                                   return_code=HTTP_NOT_AUTHORIZED)

        return api_custom_command_profile.api_delete_custom_command_profile(
            profile_name)
    except Exception as e:
        return failed_response(e.message)
Exemple #8
0
def server_repository_delete(hostname):
    try:
        if not can_delete(g.api_user):
            return failed_response('Not Authorized',
                                   return_code=HTTP_NOT_AUTHORIZED)
        else:
            return api_server_repository.api_delete_server_repositories(
                hostname)
    except Exception as e:
        return failed_response(e.message)
Exemple #9
0
def server_delete(hostname):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()
    try:
        delete_server_repository(db_session, hostname)
        return jsonify({'status': 'OK'})
    except:
        return jsonify({'status': 'Failed'})
Exemple #10
0
def region_delete(region_name):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_region(db_session, region_name)
        return jsonify({'status': 'OK'})
    except:
        return jsonify({'status': 'Failed'})
Exemple #11
0
def jump_host_delete(hostname):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_jump_host(db_session, hostname)
        return jsonify({'status': 'OK'})
    except:
        abort(404)
Exemple #12
0
def software_profile_delete(software_profile_name):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_software_profile(db_session, software_profile_name)
        return jsonify({'status': 'OK'})
    except Exception as e:
        logger.exception('software_profile_delete hit exception.')
        return jsonify({'status': e.message})
Exemple #13
0
def software_profile_delete(software_profile_name):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_software_profile(db_session, software_profile_name)
        return jsonify({'status': 'OK'})
    except Exception as e:
        logger.exception('software_profile_delete hit exception.')
        return jsonify({'status': e.message})
Exemple #14
0
def custom_command_profile_delete(profile_name):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_custom_command_profile(db_session, profile_name)
        return jsonify({'status': 'OK'})
    except Exception as e:
        logger.exception('custom_command_profile_delete hit exception.')
        return jsonify({'status': e.message})
Exemple #15
0
def host_delete(hostname):
    if not can_delete(current_user):
        abort(401)

    db_session = DBSession()

    try:
        delete_host(db_session, hostname)
    except:
        logger.exception('delete_host hit exception')
        abort(404)

    return jsonify({'status': 'OK'})