def _delete_using_service(channel, extension_id): from xivo_dao.data_handler.extension import services as extension_services try: extension = extension_services.get(extension_id) except LookupError: return extension_services.delete(extension)
def delete(extensionid): extension = extension_services.get(extensionid) extension_services.delete(extension) return make_response('', 204)
def edit(extensionid): data = document.parse(request) extension = extension_services.get(extensionid) formatter.update_dict_model(data, extension) extension_services.edit(extension) return make_response('', 204)
def get(extensionid): extension = extension_services.get(extensionid) result = formatter.to_api(extension) return make_response(result, 200)
def check_extension_exists(extension_id): return extension_services.get(extension_id)