Skip to content
Dashboard

Execute multiple actions

computers.batch(strid, ComputerBatchParams**kwargs) -> ComputerBatchResponse
POST/computers/{id}/batch

Execute a batch of actions in sequence, stopping on first error

ParametersExpand Collapse
id: str
actions: Optional[Iterable[ComputerActionParam]]
auto_detect_encoding: Optional[bool]

For get_html_content

base64: Optional[bool]

For screenshot

button: Optional[str]
debug: Optional[Debug]
command: Optional[str]
cwd: Optional[str]
env: Optional[Dict[str, str]]
max_output_length: Optional[int]
request_id: Optional[str]
stream: Optional[bool]
timeout_seconds: Optional[int]
dx: Optional[float]

For scrolling

dy: Optional[float]
height: Optional[int]
include_context: Optional[bool]

Include page context in response

key: Optional[str]

For key_down/key_up

keys: Optional[List[str]]
ms: Optional[int]
proxy_url: Optional[str]
request_id: Optional[str]

RequestId is used for correlating streaming output to the originating request. Set on ActionRequest, not individual action types.

scale_factor: Optional[float]
tab_id: Optional[str]

For tab management (browser sessions only)

text: Optional[str]
type: Optional[str]

click|double_click|right_click|drag|type|keypress|scroll|wait|screenshot|go_to_url|debug|get_html_content|set_viewport|list_tabs|new_tab|switch_tab|close_tab|key_down|key_up|mouse_down|mouse_up

url: Optional[str]
width: Optional[int]

For set_viewport

x: Optional[float]
x1: Optional[float]

For dragging/scrolling

x2: Optional[float]

For dragging

y: Optional[float]
y1: Optional[float]
y2: Optional[float]
ReturnsExpand Collapse
Dict[str, object]

Execute multiple actions

import os
from tzafon import Lightcone

client = Lightcone(
    api_key=os.environ.get("TZAFON_API_KEY"),  # This is the default and can be omitted
)
response = client.computers.batch(
    id="id",
)
print(response)
{
  "foo": "bar"
}
Returns Examples
{
  "foo": "bar"
}