def disable_service(ctx): """Disable CSE server.""" try: restore_session(ctx) client = ctx.obj['client'] system = System(client) result = system.update_service_status(action=ServerAction.DISABLE) stdout(result, ctx) except Exception as e: stderr(e, ctx)
def stop_service(ctx): """Stop CSE server.""" try: restore_session(ctx) client = ctx.obj['client'] system = System(client) result = system.update_service_status(action=ServerAction.STOP) stdout(result, ctx) except Exception as e: stderr(e, ctx)
def disable_service(ctx): """Disable CSE server.""" CLIENT_LOGGER.debug(f'Executing command: {ctx.command_path}') try: restore_session(ctx) client = ctx.obj['client'] system = System(client) result = system.update_service_status(action=ServerAction.DISABLE) stdout(result, ctx) CLIENT_LOGGER.debug(result) except Exception as e: stderr(e, ctx) CLIENT_LOGGER.error(str(e))
def enable_service(ctx): """Enable CSE server.""" CLIENT_LOGGER.debug(f'Executing command: {ctx.command_path}') try: client_utils.cse_restore_session(ctx) client = ctx.obj['client'] system = System(client) result = system.update_service_status(action=shared_constants.ServerAction.ENABLE) # noqa: E501 stdout(result, ctx) CLIENT_LOGGER.debug(result) except Exception as e: stderr(e, ctx) CLIENT_LOGGER.error(str(e))