Skip to content

BAqueue

You can get information about the Behavioral Analysis queue.

By default, this returns all currently running jobs.

Code example
import asyncio
from ptsandbox import Sandbox, SandboxKey

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

    baqueue = await sandbox.ui.get_baqueue_tasks()
    for task in baqueue.tasks:
        print(task.object_name, task.state)

asyncio.run(main())

ptsandbox.sandbox.ui._tasks.TasksMixin.get_baqueue_tasks async

get_baqueue_tasks(
    query: str = "age < 7d AND state IN (CREATED, STARTING, STARTED, DEDUPLICATION, READY, READY_WITH_ERROR) ORDER BY state DESC, priority.value DESC, ts.created",
    limit: int = 50,
    offset: int = 0,
    utc_offset_seconds: int = 0,
) -> SandboxBaqueueTasksResponse

Listing of tasks in the Behavioral Analysis queue

Parameters:

  • query (str, default: 'age < 7d AND state IN (CREATED, STARTING, STARTED, DEDUPLICATION, READY, READY_WITH_ERROR) ORDER BY state DESC, priority.value DESC, ts.created' ) –

    QL search query (by default, all tasks that are currently running are requested)

  • limit (int, default: 50 ) –

    limit on the number of records to be returned

  • offset (int, default: 0 ) –

    offset of returned records

  • utc_offset_seconds (int, default: 0 ) –

    the offset of the user's time from UTC, which will be used for the time in QL queries

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