Info API Documentation

Provides API functions for retrieving server-specific information.

This module offers read-only functions to query details about individual Bedrock server instances. It wraps methods of the BedrockServer class to expose information such as:

Each function returns a dictionary suitable for JSON serialization, indicating the outcome of the request and the retrieved data. These are exposed to the plugin system via plugin_method().

bedrock_server_manager.api.info.get_server_running_status(server_name: str, app_context: AppContext | None = None) Dict[str, Any]

Checks if the server process is currently running.

This function queries the operating system to determine if the Bedrock server process associated with the given server name is active by calling is_running().

Parameters:

server_name (str) – The name of the server to check.

Returns:

A dictionary with the operation result. On success: {"status": "success", "is_running": bool} (is_running is True if the process is active, False otherwise). On error: {"status": "error", "message": "<error_message>"}.

Return type:

Dict[str, Any]

Raises:
bedrock_server_manager.api.info.get_server_config_status(server_name: str, app_context: AppContext | None = None) Dict[str, Any]

Gets the status from the server’s configuration file.

This function reads the ‘status’ field (e.g., ‘RUNNING’, ‘STOPPED’) from the server’s JSON configuration file via get_status_from_config(). Note that this reflects the last known state written to the configuration and may not match the actual live process status if the server crashed or was managed externally.

Parameters:

server_name (str) – The name of the server.

Returns:

A dictionary with the operation result. On success: {"status": "success", "config_status": "<status_string>"} (e.g., “RUNNING”, “STOPPED”, “UNKNOWN”). On error: {"status": "error", "message": "<error_message>"}.

Return type:

Dict[str, Any]

Raises:
bedrock_server_manager.api.info.get_server_installed_version(server_name: str, app_context: AppContext | None = None) Dict[str, Any]

Gets the installed version from the server’s configuration file.

This function reads the ‘installed_version’ field from the server’s JSON configuration file via get_version(). If the version is not found or an error occurs during retrieval, it typically returns ‘UNKNOWN’.

Parameters:

server_name (str) – The name of the server.

Returns:

A dictionary with the operation result. On success: {"status": "success", "installed_version": "<version_string>"} (e.g., “1.20.10.01”, “UNKNOWN”). On error: {"status": "error", "message": "<error_message>"}.

Return type:

Dict[str, Any]

Raises: