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)
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)
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)
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)
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)
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)
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'})
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'})
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)
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})
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})
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'})