Skip to content

ServerNamespace

pymoonraker.api.ServerNamespace

Moonraker server administration.

Auto-generated from schema/moonraker_api.yaml.

Source code in src/pymoonraker/api/_generated.py
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
class ServerNamespace:
    """Moonraker server administration.

    Auto-generated from schema/moonraker_api.yaml.
    """

    def __init__(self, client: MoonrakerClient) -> None:
        self._client = client

    async def info(self) -> ServerInfo:
        """Get Moonraker server information."""
        raw = await self._client.call("server.info")
        return ServerInfo.model_validate(raw)

    async def config(self) -> ServerConfigResponse:
        """Get the full Moonraker configuration."""
        raw = await self._client.call("server.config")
        return ServerConfigResponse.model_validate(raw)

    async def temperature_store(
        self,
        include_monitors: bool | None = None,
    ) -> TemperatureStoreResponse:
        """Get cached temperature history.

        Args:
            include_monitors: Include temperature monitors in the response

        """
        params: dict[str, Any] = {}
        if include_monitors is not None:
            params["include_monitors"] = include_monitors
        raw = await self._client.call("server.temperature_store", params)
        return TemperatureStoreResponse.model_validate(raw)

    async def gcode_store(self, count: int | None = None) -> GcodeStoreResponse:
        """Get cached G-code console responses.

        Args:
            count: Number of responses to return

        """
        params: dict[str, Any] = {}
        if count is not None:
            params["count"] = count
        raw = await self._client.call("server.gcode_store", params)
        return GcodeStoreResponse.model_validate(raw)

    async def restart(self) -> str:
        """Restart the Moonraker server."""
        raw = await self._client.call("server.restart")
        return cast("str", raw)

    async def connection_identify(
        self,
        client_name: str,
        version: str,
        type: str,
        url: str,
    ) -> ConnectionIdentifyResult:
        """Identify this client connection to the server.

        Args:
            client_name: Name of the client application
            version: Client version string
            type: Client type: web, desktop, mobile, agent, other
            url: Client homepage or repository URL

        """
        params: dict[str, Any] = {}
        params["client_name"] = client_name
        params["version"] = version
        params["type"] = type
        params["url"] = url
        raw = await self._client.call("server.connection.identify", params)
        return ConnectionIdentifyResult.model_validate(raw)

config async

config() -> ServerConfigResponse

Get the full Moonraker configuration.

Source code in src/pymoonraker/api/_generated.py
176
177
178
179
async def config(self) -> ServerConfigResponse:
    """Get the full Moonraker configuration."""
    raw = await self._client.call("server.config")
    return ServerConfigResponse.model_validate(raw)

connection_identify async

connection_identify(client_name: str, version: str, type: str, url: str) -> ConnectionIdentifyResult

Identify this client connection to the server.

Parameters:

Name Type Description Default
client_name str

Name of the client application

required
version str

Client version string

required
type str

Client type: web, desktop, mobile, agent, other

required
url str

Client homepage or repository URL

required
Source code in src/pymoonraker/api/_generated.py
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
async def connection_identify(
    self,
    client_name: str,
    version: str,
    type: str,
    url: str,
) -> ConnectionIdentifyResult:
    """Identify this client connection to the server.

    Args:
        client_name: Name of the client application
        version: Client version string
        type: Client type: web, desktop, mobile, agent, other
        url: Client homepage or repository URL

    """
    params: dict[str, Any] = {}
    params["client_name"] = client_name
    params["version"] = version
    params["type"] = type
    params["url"] = url
    raw = await self._client.call("server.connection.identify", params)
    return ConnectionIdentifyResult.model_validate(raw)

gcode_store async

gcode_store(count: int | None = None) -> GcodeStoreResponse

Get cached G-code console responses.

Parameters:

Name Type Description Default
count int | None

Number of responses to return

None
Source code in src/pymoonraker/api/_generated.py
197
198
199
200
201
202
203
204
205
206
207
208
async def gcode_store(self, count: int | None = None) -> GcodeStoreResponse:
    """Get cached G-code console responses.

    Args:
        count: Number of responses to return

    """
    params: dict[str, Any] = {}
    if count is not None:
        params["count"] = count
    raw = await self._client.call("server.gcode_store", params)
    return GcodeStoreResponse.model_validate(raw)

info async

info() -> ServerInfo

Get Moonraker server information.

Source code in src/pymoonraker/api/_generated.py
171
172
173
174
async def info(self) -> ServerInfo:
    """Get Moonraker server information."""
    raw = await self._client.call("server.info")
    return ServerInfo.model_validate(raw)

restart async

restart() -> str

Restart the Moonraker server.

Source code in src/pymoonraker/api/_generated.py
210
211
212
213
async def restart(self) -> str:
    """Restart the Moonraker server."""
    raw = await self._client.call("server.restart")
    return cast("str", raw)

temperature_store async

temperature_store(include_monitors: bool | None = None) -> TemperatureStoreResponse

Get cached temperature history.

Parameters:

Name Type Description Default
include_monitors bool | None

Include temperature monitors in the response

None
Source code in src/pymoonraker/api/_generated.py
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
async def temperature_store(
    self,
    include_monitors: bool | None = None,
) -> TemperatureStoreResponse:
    """Get cached temperature history.

    Args:
        include_monitors: Include temperature monitors in the response

    """
    params: dict[str, Any] = {}
    if include_monitors is not None:
        params["include_monitors"] = include_monitors
    raw = await self._client.call("server.temperature_store", params)
    return TemperatureStoreResponse.model_validate(raw)