Skip to content

HistoryNamespace

pymoonraker.api.HistoryNamespace

Print history.

Auto-generated from schema/moonraker_api.yaml.

Source code in src/pymoonraker/api/_generated.py
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
class HistoryNamespace:
    """Print history.

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

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

    async def list(
        self,
        limit: int | None = None,
        start: int | None = None,
        since: float | None = None,
        before: float | None = None,
        order: str | None = None,
    ) -> HistoryListResponse:
        """List job history entries.

        Args:
            limit: Maximum number of entries to return
            start: Starting index
            since: Unix timestamp; only return jobs after this time
            before: Unix timestamp; only return jobs before this time
            order: Sort order: asc or desc

        """
        params: dict[str, Any] = {}
        if limit is not None:
            params["limit"] = limit
        if start is not None:
            params["start"] = start
        if since is not None:
            params["since"] = since
        if before is not None:
            params["before"] = before
        if order is not None:
            params["order"] = order
        raw = await self._client.call("server.history.list", params)
        return HistoryListResponse.model_validate(raw)

    async def totals(self) -> HistoryTotals:
        """Get aggregate print statistics."""
        raw = await self._client.call("server.history.totals")
        return HistoryTotals.model_validate(raw)

    async def get_job(self, uid: str) -> HistoryJobResponse:
        """Get details of a single history job.

        Args:
            uid: Job ID

        """
        params: dict[str, Any] = {}
        params["uid"] = uid
        raw = await self._client.call("server.history.get_job", params)
        return HistoryJobResponse.model_validate(raw)

    async def delete_job(self, uid: str) -> HistoryDeleteResponse:
        """Delete a history entry.

        Args:
            uid: Job ID to delete

        """
        params: dict[str, Any] = {}
        params["uid"] = uid
        raw = await self._client.call("server.history.delete_job", params)
        return HistoryDeleteResponse.model_validate(raw)

delete_job async

delete_job(uid: str) -> HistoryDeleteResponse

Delete a history entry.

Parameters:

Name Type Description Default
uid str

Job ID to delete

required
Source code in src/pymoonraker/api/_generated.py
456
457
458
459
460
461
462
463
464
465
466
async def delete_job(self, uid: str) -> HistoryDeleteResponse:
    """Delete a history entry.

    Args:
        uid: Job ID to delete

    """
    params: dict[str, Any] = {}
    params["uid"] = uid
    raw = await self._client.call("server.history.delete_job", params)
    return HistoryDeleteResponse.model_validate(raw)

get_job async

get_job(uid: str) -> HistoryJobResponse

Get details of a single history job.

Parameters:

Name Type Description Default
uid str

Job ID

required
Source code in src/pymoonraker/api/_generated.py
444
445
446
447
448
449
450
451
452
453
454
async def get_job(self, uid: str) -> HistoryJobResponse:
    """Get details of a single history job.

    Args:
        uid: Job ID

    """
    params: dict[str, Any] = {}
    params["uid"] = uid
    raw = await self._client.call("server.history.get_job", params)
    return HistoryJobResponse.model_validate(raw)

list async

list(limit: int | None = None, start: int | None = None, since: float | None = None, before: float | None = None, order: str | None = None) -> HistoryListResponse

List job history entries.

Parameters:

Name Type Description Default
limit int | None

Maximum number of entries to return

None
start int | None

Starting index

None
since float | None

Unix timestamp; only return jobs after this time

None
before float | None

Unix timestamp; only return jobs before this time

None
order str | None

Sort order: asc or desc

None
Source code in src/pymoonraker/api/_generated.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
async def list(
    self,
    limit: int | None = None,
    start: int | None = None,
    since: float | None = None,
    before: float | None = None,
    order: str | None = None,
) -> HistoryListResponse:
    """List job history entries.

    Args:
        limit: Maximum number of entries to return
        start: Starting index
        since: Unix timestamp; only return jobs after this time
        before: Unix timestamp; only return jobs before this time
        order: Sort order: asc or desc

    """
    params: dict[str, Any] = {}
    if limit is not None:
        params["limit"] = limit
    if start is not None:
        params["start"] = start
    if since is not None:
        params["since"] = since
    if before is not None:
        params["before"] = before
    if order is not None:
        params["order"] = order
    raw = await self._client.call("server.history.list", params)
    return HistoryListResponse.model_validate(raw)

totals async

totals() -> HistoryTotals

Get aggregate print statistics.

Source code in src/pymoonraker/api/_generated.py
439
440
441
442
async def totals(self) -> HistoryTotals:
    """Get aggregate print statistics."""
    raw = await self._client.call("server.history.totals")
    return HistoryTotals.model_validate(raw)