Skip to content

System Resource

SystemResource(client)

Bases: BaseResource

Access server status and the OpenAPI specification.

Source code in src/aiobsidian/rest/_base.py
def __init__(self, client: ObsidianClient) -> None:
    self._client = client

status() async

Get the current server status.

Returns:

Type Description
ServerStatus

A ServerStatus object with authentication state and

ServerStatus

version information.

Source code in src/aiobsidian/rest/system.py
async def status(self) -> ServerStatus:
    """Get the current server status.

    Returns:
        A `ServerStatus` object with authentication state and
        version information.
    """
    response = await self._client.request("GET", "/")
    return ServerStatus.model_validate(response.json())

openapi() async

Get the OpenAPI specification of the REST API.

Returns:

Type Description
str

The OpenAPI spec as a YAML string.

Source code in src/aiobsidian/rest/system.py
async def openapi(self) -> str:
    """Get the OpenAPI specification of the REST API.

    Returns:
        The OpenAPI spec as a YAML string.
    """
    response = await self._client.request("GET", "/openapi.yaml")
    return response.text