Example of usage

from pbuster import PhantomBuster

pb = PhantomBuster()

pb.container.list(agent_id="1234567890")

pbuster.container.Container(req)

Initialize Container API client

Parameters:
  • req (RequestHandler) –

    Request handler instance for making API requests

list(agent_id)

Fetch all containers for a specific agent

Parameters:
  • agent_id (str) –

    Agent ID to fetch containers for

Returns:
  • dict

    A dictionary containing all containers for the specified agent.

get(container_id)

Fetch a specific container by ID with results and output

Parameters:
  • container_id (str) –

    Container ID to fetch

Returns:
  • dict

    A dictionary containing the container details.

output(container_id, raw=False)

Fetch the output of a specific container by ID

Parameters:
  • container_id (str) –

    Container ID to fetch output for

  • raw (bool, default: False ) –

    If True, fetch raw output

Returns:
  • dict

    A dictionary containing the container's output.

results(container_id)

Fetch the results of a specific container by ID

Parameters:
  • container_id (str) –

    Container ID to fetch results for

Returns:
  • dict

    A dictionary containing the container's results.

wait(container_id)

Wait for completion of a specific container by ID

Parameters:
  • container_id (str) –

    Container ID to wait for

Returns:
  • dict

    A dictionary containing the container's output after it has finished executing.