gbox_sdk.resources.v1 package¶
Subpackages¶
- gbox_sdk.resources.v1.boxes package
- Submodules
- gbox_sdk.resources.v1.boxes.actions module
ActionsResourceActionsResource.click()ActionsResource.clipboard_get()ActionsResource.clipboard_set()ActionsResource.drag()ActionsResource.elements_detect()ActionsResource.extract()ActionsResource.long_press()ActionsResource.move()ActionsResource.press_button()ActionsResource.press_key()ActionsResource.recording_start()ActionsResource.recording_stop()ActionsResource.rewind_disable()ActionsResource.rewind_enable()ActionsResource.rewind_extract()ActionsResource.screen_layout()ActionsResource.screen_rotation()ActionsResource.screenshot()ActionsResource.scroll()ActionsResource.settings()ActionsResource.settings_reset()ActionsResource.settings_update()ActionsResource.swipe()ActionsResource.tap()ActionsResource.touch()ActionsResource.type()ActionsResource.with_raw_responseActionsResource.with_streaming_response
AsyncActionsResourceAsyncActionsResource.click()AsyncActionsResource.clipboard_get()AsyncActionsResource.clipboard_set()AsyncActionsResource.drag()AsyncActionsResource.elements_detect()AsyncActionsResource.extract()AsyncActionsResource.long_press()AsyncActionsResource.move()AsyncActionsResource.press_button()AsyncActionsResource.press_key()AsyncActionsResource.recording_start()AsyncActionsResource.recording_stop()AsyncActionsResource.rewind_disable()AsyncActionsResource.rewind_enable()AsyncActionsResource.rewind_extract()AsyncActionsResource.screen_layout()AsyncActionsResource.screen_rotation()AsyncActionsResource.screenshot()AsyncActionsResource.scroll()AsyncActionsResource.settings()AsyncActionsResource.settings_reset()AsyncActionsResource.settings_update()AsyncActionsResource.swipe()AsyncActionsResource.tap()AsyncActionsResource.touch()AsyncActionsResource.type()AsyncActionsResource.with_raw_responseAsyncActionsResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.android module
AndroidResourceAndroidResource.backup()AndroidResource.backup_all()AndroidResource.close()AndroidResource.close_all()AndroidResource.get()AndroidResource.get_app()AndroidResource.get_connect_address()AndroidResource.install()AndroidResource.list_activities()AndroidResource.list_app()AndroidResource.list_pkg()AndroidResource.list_pkg_simple()AndroidResource.open()AndroidResource.restart()AndroidResource.restore()AndroidResource.uninstall()AndroidResource.with_raw_responseAndroidResource.with_streaming_response
AsyncAndroidResourceAsyncAndroidResource.backup()AsyncAndroidResource.backup_all()AsyncAndroidResource.close()AsyncAndroidResource.close_all()AsyncAndroidResource.get()AsyncAndroidResource.get_app()AsyncAndroidResource.get_connect_address()AsyncAndroidResource.install()AsyncAndroidResource.list_activities()AsyncAndroidResource.list_app()AsyncAndroidResource.list_pkg()AsyncAndroidResource.list_pkg_simple()AsyncAndroidResource.open()AsyncAndroidResource.restart()AsyncAndroidResource.restore()AsyncAndroidResource.uninstall()AsyncAndroidResource.with_raw_responseAsyncAndroidResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.boxes module
AsyncBoxesResourceAsyncBoxesResource.actionsAsyncBoxesResource.androidAsyncBoxesResource.browserAsyncBoxesResource.create_android()AsyncBoxesResource.create_linux()AsyncBoxesResource.display()AsyncBoxesResource.execute_commands()AsyncBoxesResource.fsAsyncBoxesResource.list()AsyncBoxesResource.live_view_url()AsyncBoxesResource.mediaAsyncBoxesResource.proxyAsyncBoxesResource.resolution_set()AsyncBoxesResource.retrieve()AsyncBoxesResource.run_code()AsyncBoxesResource.start()AsyncBoxesResource.stop()AsyncBoxesResource.storageAsyncBoxesResource.terminate()AsyncBoxesResource.web_terminal_url()AsyncBoxesResource.websocket_url()AsyncBoxesResource.with_raw_responseAsyncBoxesResource.with_streaming_response
BoxesResourceBoxesResource.actionsBoxesResource.androidBoxesResource.browserBoxesResource.create_android()BoxesResource.create_linux()BoxesResource.display()BoxesResource.execute_commands()BoxesResource.fsBoxesResource.list()BoxesResource.live_view_url()BoxesResource.mediaBoxesResource.proxyBoxesResource.resolution_set()BoxesResource.retrieve()BoxesResource.run_code()BoxesResource.start()BoxesResource.stop()BoxesResource.storageBoxesResource.terminate()BoxesResource.web_terminal_url()BoxesResource.websocket_url()BoxesResource.with_raw_responseBoxesResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.browser module
AsyncBrowserResourceAsyncBrowserResource.cdp_url()AsyncBrowserResource.clear_proxy()AsyncBrowserResource.close()AsyncBrowserResource.close_tab()AsyncBrowserResource.get_proxy()AsyncBrowserResource.get_tabs()AsyncBrowserResource.open()AsyncBrowserResource.open_tab()AsyncBrowserResource.set_proxy()AsyncBrowserResource.switch_tab()AsyncBrowserResource.update_tab()AsyncBrowserResource.with_raw_responseAsyncBrowserResource.with_streaming_response
BrowserResourceBrowserResource.cdp_url()BrowserResource.clear_proxy()BrowserResource.close()BrowserResource.close_tab()BrowserResource.get_proxy()BrowserResource.get_tabs()BrowserResource.open()BrowserResource.open_tab()BrowserResource.set_proxy()BrowserResource.switch_tab()BrowserResource.update_tab()BrowserResource.with_raw_responseBrowserResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.fs module
- Module contents
ActionsResourceActionsResource.click()ActionsResource.clipboard_get()ActionsResource.clipboard_set()ActionsResource.drag()ActionsResource.elements_detect()ActionsResource.extract()ActionsResource.long_press()ActionsResource.move()ActionsResource.press_button()ActionsResource.press_key()ActionsResource.recording_start()ActionsResource.recording_stop()ActionsResource.rewind_disable()ActionsResource.rewind_enable()ActionsResource.rewind_extract()ActionsResource.screen_layout()ActionsResource.screen_rotation()ActionsResource.screenshot()ActionsResource.scroll()ActionsResource.settings()ActionsResource.settings_reset()ActionsResource.settings_update()ActionsResource.swipe()ActionsResource.tap()ActionsResource.touch()ActionsResource.type()ActionsResource.with_raw_responseActionsResource.with_streaming_response
ActionsResourceWithRawResponseActionsResourceWithStreamingResponseAndroidResourceAndroidResource.backup()AndroidResource.backup_all()AndroidResource.close()AndroidResource.close_all()AndroidResource.get()AndroidResource.get_app()AndroidResource.get_connect_address()AndroidResource.install()AndroidResource.list_activities()AndroidResource.list_app()AndroidResource.list_pkg()AndroidResource.list_pkg_simple()AndroidResource.open()AndroidResource.restart()AndroidResource.restore()AndroidResource.uninstall()AndroidResource.with_raw_responseAndroidResource.with_streaming_response
AndroidResourceWithRawResponseAndroidResourceWithStreamingResponseAsyncActionsResourceAsyncActionsResource.click()AsyncActionsResource.clipboard_get()AsyncActionsResource.clipboard_set()AsyncActionsResource.drag()AsyncActionsResource.elements_detect()AsyncActionsResource.extract()AsyncActionsResource.long_press()AsyncActionsResource.move()AsyncActionsResource.press_button()AsyncActionsResource.press_key()AsyncActionsResource.recording_start()AsyncActionsResource.recording_stop()AsyncActionsResource.rewind_disable()AsyncActionsResource.rewind_enable()AsyncActionsResource.rewind_extract()AsyncActionsResource.screen_layout()AsyncActionsResource.screen_rotation()AsyncActionsResource.screenshot()AsyncActionsResource.scroll()AsyncActionsResource.settings()AsyncActionsResource.settings_reset()AsyncActionsResource.settings_update()AsyncActionsResource.swipe()AsyncActionsResource.tap()AsyncActionsResource.touch()AsyncActionsResource.type()AsyncActionsResource.with_raw_responseAsyncActionsResource.with_streaming_response
AsyncActionsResourceWithRawResponseAsyncActionsResourceWithStreamingResponseAsyncAndroidResourceAsyncAndroidResource.backup()AsyncAndroidResource.backup_all()AsyncAndroidResource.close()AsyncAndroidResource.close_all()AsyncAndroidResource.get()AsyncAndroidResource.get_app()AsyncAndroidResource.get_connect_address()AsyncAndroidResource.install()AsyncAndroidResource.list_activities()AsyncAndroidResource.list_app()AsyncAndroidResource.list_pkg()AsyncAndroidResource.list_pkg_simple()AsyncAndroidResource.open()AsyncAndroidResource.restart()AsyncAndroidResource.restore()AsyncAndroidResource.uninstall()AsyncAndroidResource.with_raw_responseAsyncAndroidResource.with_streaming_response
AsyncAndroidResourceWithRawResponseAsyncAndroidResourceWithStreamingResponseAsyncBoxesResourceAsyncBoxesResource.actionsAsyncBoxesResource.androidAsyncBoxesResource.browserAsyncBoxesResource.create_android()AsyncBoxesResource.create_linux()AsyncBoxesResource.display()AsyncBoxesResource.execute_commands()AsyncBoxesResource.fsAsyncBoxesResource.list()AsyncBoxesResource.live_view_url()AsyncBoxesResource.mediaAsyncBoxesResource.proxyAsyncBoxesResource.resolution_set()AsyncBoxesResource.retrieve()AsyncBoxesResource.run_code()AsyncBoxesResource.start()AsyncBoxesResource.stop()AsyncBoxesResource.storageAsyncBoxesResource.terminate()AsyncBoxesResource.web_terminal_url()AsyncBoxesResource.websocket_url()AsyncBoxesResource.with_raw_responseAsyncBoxesResource.with_streaming_response
AsyncBoxesResourceWithRawResponseAsyncBoxesResourceWithStreamingResponseAsyncBoxesResourceWithStreamingResponse.actionsAsyncBoxesResourceWithStreamingResponse.androidAsyncBoxesResourceWithStreamingResponse.browserAsyncBoxesResourceWithStreamingResponse.fsAsyncBoxesResourceWithStreamingResponse.mediaAsyncBoxesResourceWithStreamingResponse.proxyAsyncBoxesResourceWithStreamingResponse.storage
AsyncBrowserResourceAsyncBrowserResource.cdp_url()AsyncBrowserResource.clear_proxy()AsyncBrowserResource.close()AsyncBrowserResource.close_tab()AsyncBrowserResource.get_proxy()AsyncBrowserResource.get_tabs()AsyncBrowserResource.open()AsyncBrowserResource.open_tab()AsyncBrowserResource.set_proxy()AsyncBrowserResource.switch_tab()AsyncBrowserResource.update_tab()AsyncBrowserResource.with_raw_responseAsyncBrowserResource.with_streaming_response
AsyncBrowserResourceWithRawResponseAsyncBrowserResourceWithStreamingResponseAsyncFsResourceAsyncFsResourceWithRawResponseAsyncFsResourceWithStreamingResponseAsyncMediaResourceAsyncMediaResource.create_album()AsyncMediaResource.delete_album()AsyncMediaResource.delete_media()AsyncMediaResource.download_media()AsyncMediaResource.get_album_detail()AsyncMediaResource.get_media()AsyncMediaResource.get_media_support()AsyncMediaResource.list_albums()AsyncMediaResource.list_media()AsyncMediaResource.update_album()AsyncMediaResource.with_raw_responseAsyncMediaResource.with_streaming_response
AsyncMediaResourceWithRawResponseAsyncMediaResourceWithStreamingResponseAsyncProxyResourceAsyncProxyResourceWithRawResponseAsyncProxyResourceWithStreamingResponseAsyncStorageResourceAsyncStorageResourceWithRawResponseAsyncStorageResourceWithStreamingResponseBoxesResourceBoxesResource.actionsBoxesResource.androidBoxesResource.browserBoxesResource.create_android()BoxesResource.create_linux()BoxesResource.display()BoxesResource.execute_commands()BoxesResource.fsBoxesResource.list()BoxesResource.live_view_url()BoxesResource.mediaBoxesResource.proxyBoxesResource.resolution_set()BoxesResource.retrieve()BoxesResource.run_code()BoxesResource.start()BoxesResource.stop()BoxesResource.storageBoxesResource.terminate()BoxesResource.web_terminal_url()BoxesResource.websocket_url()BoxesResource.with_raw_responseBoxesResource.with_streaming_response
BoxesResourceWithRawResponseBoxesResourceWithStreamingResponseBrowserResourceBrowserResource.cdp_url()BrowserResource.clear_proxy()BrowserResource.close()BrowserResource.close_tab()BrowserResource.get_proxy()BrowserResource.get_tabs()BrowserResource.open()BrowserResource.open_tab()BrowserResource.set_proxy()BrowserResource.switch_tab()BrowserResource.update_tab()BrowserResource.with_raw_responseBrowserResource.with_streaming_response
BrowserResourceWithRawResponseBrowserResourceWithStreamingResponseFsResourceFsResourceWithRawResponseFsResourceWithStreamingResponseMediaResourceMediaResource.create_album()MediaResource.delete_album()MediaResource.delete_media()MediaResource.download_media()MediaResource.get_album_detail()MediaResource.get_media()MediaResource.get_media_support()MediaResource.list_albums()MediaResource.list_media()MediaResource.update_album()MediaResource.with_raw_responseMediaResource.with_streaming_response
MediaResourceWithRawResponseMediaResourceWithStreamingResponseProxyResourceProxyResourceWithRawResponseProxyResourceWithStreamingResponseStorageResourceStorageResourceWithRawResponseStorageResourceWithStreamingResponse
Submodules¶
gbox_sdk.resources.v1.v1 module¶
- class gbox_sdk.resources.v1.v1.AsyncV1Resource(client)¶
Bases:
AsyncAPIResource- property boxes: AsyncBoxesResource¶
- property devices: AsyncDevicesResource¶
- property with_raw_response: AsyncV1ResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: AsyncV1ResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.v1.V1Resource(client)¶
Bases:
SyncAPIResource- property boxes: BoxesResource¶
- property devices: DevicesResource¶
- property with_raw_response: V1ResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: V1ResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
Module contents¶
- class gbox_sdk.resources.v1.AsyncBoxesResource(client)¶
Bases:
AsyncAPIResource- property actions: AsyncActionsResource¶
- property android: AsyncAndroidResource¶
- property browser: AsyncBrowserResource¶
- async create_android(*, config=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Provisions a new Android box that you can operate through the GBOX SDK.
Use this endpoint when you want to create a fresh Android environment for testing, automation, or agent execution.
- Return type:
- Args:
config: Configuration for a Android box instance
- api_timeout: Timeout for waiting the box to transition from pending to running state, default
is 30s. If the box doesn’t reach running state within this timeout, the API will return HTTP status code 408. The timed-out box will be automatically deleted and will not count towards your quota.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s Maximum allowed: 5m
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async create_linux(*, config=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Provisions a new Linux box that you can operate through the GBOX SDK.
Use this endpoint when you want to create a fresh Linux environment for testing, automation, or agent execution.
- Return type:
- Args:
config: Configuration for a Linux box instance
- api_timeout: Timeout for waiting the box to transition from pending to running state, default
is 30s. If the box doesn’t reach running state within this timeout, the API will return HTTP status code 408. The timed-out box will be automatically deleted and will not count towards your quota.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s Maximum allowed: 5m
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async display(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Retrieve the current display properties for a running box.
This endpoint provides details about the box’s screen resolution, orientation, and other visual properties.
- Return type:
BoxDisplayResponse
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async execute_commands(box_id, *, command, envs=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, working_dir=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Execute a command on a running box.
This endpoint allows you to send commands to the box and receive the output
- Return type:
- Args:
command: The command to run
envs: The environment variables to run the command
- api_timeout: The timeout of the command. If the command times out, the exit code will be 124.
For example: ‘timeout 5s sleep 10s’ will result in exit code 124.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s
- working_dir: The working directory of the command. It not provided, the command will be run
in the box.config.workingDir directory.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property fs: AsyncFsResource¶
- async list(*, device_type=<gbox_sdk.Omit object>, labels=<gbox_sdk.Omit object>, page=<gbox_sdk.Omit object>, page_size=<gbox_sdk.Omit object>, status=<gbox_sdk.Omit object>, type=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Returns a paginated list of box instances.
Use this endpoint to monitor environments, filter by status or type, or retrieve boxes by labels or device type.
- Return type:
- Args:
device_type: Filter boxes by their device type (virtual, physical)
- labels: Filter boxes by their labels. Labels are key-value pairs that help identify and
categorize boxes. Use this to filter boxes that match specific label criteria. For example, you can filter by project, environment, team, or any custom labels you’ve added to your boxes.
page: Page number
page_size: Page size
- status: Filter boxes by their current status (pending, running, stopped, error,
terminated, all). Must be an array of statuses. Use ‘all’ to get boxes with any status.
- type: Filter boxes by their type (linux, android, all). Must be an array of types. Use
‘all’ to get boxes of any type.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async live_view_url(box_id, *, expires_in=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint allows you to generate a pre-signed URL for accessing the live view of a running box. The URL is valid for a limited time and can be used to view the box’s live stream.
- Return type:
- Args:
expires_in: The live view will be alive for the given duration
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 180m
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property media: AsyncMediaResource¶
- property proxy: AsyncProxyResource¶
- async resolution_set(box_id, *, height, width, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Set the screen resolution
- Return type:
BoxResolutionSetResponse
- Args:
height: The height of the screen
width: The width of the screen
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async retrieve(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint retrieves information about a box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async run_code(box_id, *, code, argv=<gbox_sdk.Omit object>, envs=<gbox_sdk.Omit object>, language=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, working_dir=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Executes code inside the specified box.
Supports multiple languages (bash, Python, TypeScript) and allows you to configure environment variables, arguments, working directory, and timeouts.
- Return type:
- Args:
code: The code to run
- argv: The arguments to run the code. For example, if you want to run “python index.py
–help”, you should pass [”–help”] as arguments.
envs: The environment variables to run the code
language: The language of the code.
- api_timeout: The timeout of the code execution. If the code execution times out, the exit
code will be 124.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s
- working_dir: The working directory of the code. It not provided, the code will be run in the
box.config.workingDir directory.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async start(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Start box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async stop(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Stop box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property storage: AsyncStorageResource¶
- async terminate(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Terminate a running box.
This action will stop the box and release its resources.
- Return type:
None
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async web_terminal_url(box_id, *, expires_in=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint allows you to generate a pre-signed URL for accessing the web terminal of a running box. The URL is valid for a limited time and can be used to access the box’s terminal interface.
- Return type:
- Args:
expires_in: The web terminal will be alive for the given duration
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 180m
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async websocket_url(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get the websocket url for the box.
This endpoint provides the WebSocket URLs for executing shell commands and running code snippets in the box environment. These URLs allow real-time communication and data exchange with the box, enabling interactive terminal sessions and code execution.
- Return type:
BoxWebsocketURLResponse
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property with_raw_response: AsyncBoxesResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: AsyncBoxesResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.AsyncBoxesResourceWithRawResponse(boxes)¶
Bases:
object- property actions: AsyncActionsResourceWithRawResponse¶
- property android: AsyncAndroidResourceWithRawResponse¶
- property browser: AsyncBrowserResourceWithRawResponse¶
- property fs: AsyncFsResourceWithRawResponse¶
- property media: AsyncMediaResourceWithRawResponse¶
- property proxy: AsyncProxyResourceWithRawResponse¶
- property storage: AsyncStorageResourceWithRawResponse¶
- class gbox_sdk.resources.v1.AsyncBoxesResourceWithStreamingResponse(boxes)¶
Bases:
object- property actions: AsyncActionsResourceWithStreamingResponse¶
- property android: AsyncAndroidResourceWithStreamingResponse¶
- property browser: AsyncBrowserResourceWithStreamingResponse¶
- property fs: AsyncFsResourceWithStreamingResponse¶
- property media: AsyncMediaResourceWithStreamingResponse¶
- property proxy: AsyncProxyResourceWithStreamingResponse¶
- property storage: AsyncStorageResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.AsyncDevicesResource(client)¶
Bases:
AsyncAPIResource- async get(device_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get device info
- Return type:
DeviceInfo
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async list(*, x_device_ap, page=<gbox_sdk.Omit object>, page_size=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get device list
- Return type:
GetDeviceListResponse
- Args:
page: Page number
page_size: Page size
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- async to_box(device_id, *, force=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create a new box using a physical device
- Return type:
str
- Args:
- force: If true, the device will be forcibly created as a new Box, which will forcibly
terminate any existing box that is currently using this device. If false, an error will be thrown with HTTP 423 status code when the device is already occupied by a box.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property with_raw_response: AsyncDevicesResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: AsyncDevicesResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.AsyncDevicesResourceWithRawResponse(devices)¶
Bases:
object
- class gbox_sdk.resources.v1.AsyncDevicesResourceWithStreamingResponse(devices)¶
Bases:
object
- class gbox_sdk.resources.v1.AsyncV1Resource(client)¶
Bases:
AsyncAPIResource- property boxes: AsyncBoxesResource¶
- property devices: AsyncDevicesResource¶
- property with_raw_response: AsyncV1ResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: AsyncV1ResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.AsyncV1ResourceWithRawResponse(v1)¶
Bases:
object- property boxes: AsyncBoxesResourceWithRawResponse¶
- property devices: AsyncDevicesResourceWithRawResponse¶
- class gbox_sdk.resources.v1.AsyncV1ResourceWithStreamingResponse(v1)¶
Bases:
object- property boxes: AsyncBoxesResourceWithStreamingResponse¶
- property devices: AsyncDevicesResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.BoxesResource(client)¶
Bases:
SyncAPIResource- property actions: ActionsResource¶
- property android: AndroidResource¶
- property browser: BrowserResource¶
- create_android(*, config=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Provisions a new Android box that you can operate through the GBOX SDK.
Use this endpoint when you want to create a fresh Android environment for testing, automation, or agent execution.
- Return type:
- Args:
config: Configuration for a Android box instance
- api_timeout: Timeout for waiting the box to transition from pending to running state, default
is 30s. If the box doesn’t reach running state within this timeout, the API will return HTTP status code 408. The timed-out box will be automatically deleted and will not count towards your quota.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s Maximum allowed: 5m
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- create_linux(*, config=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Provisions a new Linux box that you can operate through the GBOX SDK.
Use this endpoint when you want to create a fresh Linux environment for testing, automation, or agent execution.
- Return type:
- Args:
config: Configuration for a Linux box instance
- api_timeout: Timeout for waiting the box to transition from pending to running state, default
is 30s. If the box doesn’t reach running state within this timeout, the API will return HTTP status code 408. The timed-out box will be automatically deleted and will not count towards your quota.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s Maximum allowed: 5m
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- display(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Retrieve the current display properties for a running box.
This endpoint provides details about the box’s screen resolution, orientation, and other visual properties.
- Return type:
BoxDisplayResponse
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- execute_commands(box_id, *, command, envs=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, working_dir=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Execute a command on a running box.
This endpoint allows you to send commands to the box and receive the output
- Return type:
- Args:
command: The command to run
envs: The environment variables to run the command
- api_timeout: The timeout of the command. If the command times out, the exit code will be 124.
For example: ‘timeout 5s sleep 10s’ will result in exit code 124.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s
- working_dir: The working directory of the command. It not provided, the command will be run
in the box.config.workingDir directory.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property fs: FsResource¶
- list(*, device_type=<gbox_sdk.Omit object>, labels=<gbox_sdk.Omit object>, page=<gbox_sdk.Omit object>, page_size=<gbox_sdk.Omit object>, status=<gbox_sdk.Omit object>, type=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Returns a paginated list of box instances.
Use this endpoint to monitor environments, filter by status or type, or retrieve boxes by labels or device type.
- Return type:
- Args:
device_type: Filter boxes by their device type (virtual, physical)
- labels: Filter boxes by their labels. Labels are key-value pairs that help identify and
categorize boxes. Use this to filter boxes that match specific label criteria. For example, you can filter by project, environment, team, or any custom labels you’ve added to your boxes.
page: Page number
page_size: Page size
- status: Filter boxes by their current status (pending, running, stopped, error,
terminated, all). Must be an array of statuses. Use ‘all’ to get boxes with any status.
- type: Filter boxes by their type (linux, android, all). Must be an array of types. Use
‘all’ to get boxes of any type.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- live_view_url(box_id, *, expires_in=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint allows you to generate a pre-signed URL for accessing the live view of a running box. The URL is valid for a limited time and can be used to view the box’s live stream.
- Return type:
- Args:
expires_in: The live view will be alive for the given duration
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 180m
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property media: MediaResource¶
- property proxy: ProxyResource¶
- resolution_set(box_id, *, height, width, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Set the screen resolution
- Return type:
BoxResolutionSetResponse
- Args:
height: The height of the screen
width: The width of the screen
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- retrieve(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint retrieves information about a box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- run_code(box_id, *, code, argv=<gbox_sdk.Omit object>, envs=<gbox_sdk.Omit object>, language=<gbox_sdk.Omit object>, api_timeout=<gbox_sdk.Omit object>, working_dir=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Executes code inside the specified box.
Supports multiple languages (bash, Python, TypeScript) and allows you to configure environment variables, arguments, working directory, and timeouts.
- Return type:
- Args:
code: The code to run
- argv: The arguments to run the code. For example, if you want to run “python index.py
–help”, you should pass [”–help”] as arguments.
envs: The environment variables to run the code
language: The language of the code.
- api_timeout: The timeout of the code execution. If the code execution times out, the exit
code will be 124.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 30s
- working_dir: The working directory of the code. It not provided, the code will be run in the
box.config.workingDir directory.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- start(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Start box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- stop(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Stop box
- Return type:
Union[LinuxBox,AndroidBox]
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property storage: StorageResource¶
- terminate(box_id, *, wait=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Terminate a running box.
This action will stop the box and release its resources.
- Return type:
None
- Args:
wait: Wait for the box operation to be completed, default is true
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- web_terminal_url(box_id, *, expires_in=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
This endpoint allows you to generate a pre-signed URL for accessing the web terminal of a running box. The URL is valid for a limited time and can be used to access the box’s terminal interface.
- Return type:
- Args:
expires_in: The web terminal will be alive for the given duration
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: “500ms”, “30s”, “5m”, “1h” Default: 180m
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- websocket_url(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get the websocket url for the box.
This endpoint provides the WebSocket URLs for executing shell commands and running code snippets in the box environment. These URLs allow real-time communication and data exchange with the box, enabling interactive terminal sessions and code execution.
- Return type:
BoxWebsocketURLResponse
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property with_raw_response: BoxesResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: BoxesResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.BoxesResourceWithRawResponse(boxes)¶
Bases:
object- property actions: ActionsResourceWithRawResponse¶
- property android: AndroidResourceWithRawResponse¶
- property browser: BrowserResourceWithRawResponse¶
- property fs: FsResourceWithRawResponse¶
- property media: MediaResourceWithRawResponse¶
- property proxy: ProxyResourceWithRawResponse¶
- property storage: StorageResourceWithRawResponse¶
- class gbox_sdk.resources.v1.BoxesResourceWithStreamingResponse(boxes)¶
Bases:
object- property actions: ActionsResourceWithStreamingResponse¶
- property android: AndroidResourceWithStreamingResponse¶
- property browser: BrowserResourceWithStreamingResponse¶
- property fs: FsResourceWithStreamingResponse¶
- property media: MediaResourceWithStreamingResponse¶
- property proxy: ProxyResourceWithStreamingResponse¶
- property storage: StorageResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.DevicesResource(client)¶
Bases:
SyncAPIResource- get(device_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get device info
- Return type:
DeviceInfo
- Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- list(*, x_device_ap, page=<gbox_sdk.Omit object>, page_size=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get device list
- Return type:
GetDeviceListResponse
- Args:
page: Page number
page_size: Page size
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- to_box(device_id, *, force=<gbox_sdk.Omit object>, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create a new box using a physical device
- Return type:
str
- Args:
- force: If true, the device will be forcibly created as a new Box, which will forcibly
terminate any existing box that is currently using this device. If false, an error will be thrown with HTTP 423 status code when the device is already occupied by a box.
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
- property with_raw_response: DevicesResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: DevicesResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.DevicesResourceWithRawResponse(devices)¶
Bases:
object
- class gbox_sdk.resources.v1.DevicesResourceWithStreamingResponse(devices)¶
Bases:
object
- class gbox_sdk.resources.v1.V1Resource(client)¶
Bases:
SyncAPIResource- property boxes: BoxesResource¶
- property devices: DevicesResource¶
- property with_raw_response: V1ResourceWithRawResponse¶
This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#accessing-raw-response-data-eg-headers
- property with_streaming_response: V1ResourceWithStreamingResponse¶
An alternative to .with_raw_response that doesn’t eagerly read the response body.
For more information, see https://www.github.com/babelcloud/gbox-sdk-py#with_streaming_response
- class gbox_sdk.resources.v1.V1ResourceWithRawResponse(v1)¶
Bases:
object- property boxes: BoxesResourceWithRawResponse¶
- property devices: DevicesResourceWithRawResponse¶
- class gbox_sdk.resources.v1.V1ResourceWithStreamingResponse(v1)¶
Bases:
object- property boxes: BoxesResourceWithStreamingResponse¶
- property devices: DevicesResourceWithStreamingResponse¶