Skip to content

System

You can get information about system components, including cluster status and component health.

Status

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    status = await sandbox.ui.get_system_status()
    print(status)

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.get_system_status async

get_system_status() -> SandboxSystemStatusResponse

Get information about the system status

For full information, look at the documentation of the SandboxSystemStatusResponse model.

Returns:

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

  • ValidationError

    if the response body does not match the expected model

Cluster status

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    cluster = await sandbox.ui.get_system_cluster_status()
    print(cluster)

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.get_system_cluster_status async

get_system_cluster_status() -> SandboxClusterStatusResponse

Get information about the cluster status

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

  • ValidationError

    if the response body does not match the expected model

Components status

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    components = await sandbox.ui.get_system_components_status()
    print(components)

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.get_system_components_status async

get_system_components_status() -> SandboxComponentsResponse

Get information about the components status

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

  • ValidationError

    if the response body does not match the expected model

Settings

Get information

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    settings = await sandbox.ui.get_system_settings()
    print(settings)

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.get_system_settings async

get_system_settings() -> SandboxSystemSettingsResponse

Get information about the system settings

Returns:

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

  • ValidationError

    if the response body does not match the expected model

Update information

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey
from ptsandbox.models import SandboxUpdateSystemSettingsRequest

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    await sandbox.ui.update_system_settings(
        SandboxUpdateSystemSettingsRequest(
            quarantine=SandboxUpdateSystemSettingsRequest.Quarantine(
                retention_period=30000,
            )
        )
    )

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.update_system_settings async

update_system_settings(
    settings: SandboxUpdateSystemSettingsRequest,
) -> None

Update system settings

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

Version

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    version = await sandbox.ui.get_system_version()
    print(version)

asyncio.run(main())

ptsandbox.sandbox.ui._system.SystemMixin.get_system_version async

get_system_version() -> SandboxSystemVersionResponse

Get the version of the installed product

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

  • ValidationError

    if the response body does not match the expected model

System Logs

Code example
import aiofiles
import asyncio
from ptsandbox import Sandbox, SandboxKey

async def main():
    sandbox = Sandbox(...)
    await sandbox.ui.authorize()

    async with aiofiles.open("logs.zip", "wb") as fd:
        async for chunk in sandbox.ui.get_system_logs(): # (1)!
            await fd.write(chunk)

asyncio.run(main())
  1. ⚠ Without parameters, all logs will be downloaded. This can be several gigabytes.

ptsandbox.sandbox.ui._system.SystemMixin.get_system_logs async

get_system_logs(
    since: int | None = None,
    components: list[str] | None = None,
) -> AsyncIterator[bytes]

Download the archive with system logs

Parameters:

  • since (int | None, default: None ) –

    the time period for uploading logs in seconds

  • components (list[str] | None, default: None ) –

    component names in the format {namespace}/{component}, {namespace}/{component}, ... If the field is empty, all components will be downloaded

Returns:

  • AsyncIterator[bytes]

    Archive with logs

Raises:

  • SandboxException

    if not authorized or token refresh fails

  • ClientResponseError

    if the server returns an error status

  • ClientError

    on connection or transport errors

License

License management methods are documented on the License page.