gbox_sdk.resources.v1 package¶
Subpackages¶
- gbox_sdk.resources.v1.boxes package
- Submodules
- gbox_sdk.resources.v1.boxes.actions module
ActionsResource
ActionsResource.ai()
ActionsResource.click()
ActionsResource.drag()
ActionsResource.extract()
ActionsResource.move()
ActionsResource.press_button()
ActionsResource.press_key()
ActionsResource.screen_rotation()
ActionsResource.screenshot()
ActionsResource.scroll()
ActionsResource.swipe()
ActionsResource.touch()
ActionsResource.type()
ActionsResource.with_raw_response
ActionsResource.with_streaming_response
AsyncActionsResource
AsyncActionsResource.ai()
AsyncActionsResource.click()
AsyncActionsResource.drag()
AsyncActionsResource.extract()
AsyncActionsResource.move()
AsyncActionsResource.press_button()
AsyncActionsResource.press_key()
AsyncActionsResource.screen_rotation()
AsyncActionsResource.screenshot()
AsyncActionsResource.scroll()
AsyncActionsResource.swipe()
AsyncActionsResource.touch()
AsyncActionsResource.type()
AsyncActionsResource.with_raw_response
AsyncActionsResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.android module
AndroidResource
AndroidResource.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_response
AndroidResource.with_streaming_response
AsyncAndroidResource
AsyncAndroidResource.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_response
AsyncAndroidResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.boxes module
AsyncBoxesResource
AsyncBoxesResource.actions
AsyncBoxesResource.android
AsyncBoxesResource.browser
AsyncBoxesResource.create_android()
AsyncBoxesResource.create_linux()
AsyncBoxesResource.display()
AsyncBoxesResource.execute_commands()
AsyncBoxesResource.fs
AsyncBoxesResource.list()
AsyncBoxesResource.live_view_url()
AsyncBoxesResource.retrieve()
AsyncBoxesResource.run_code()
AsyncBoxesResource.start()
AsyncBoxesResource.stop()
AsyncBoxesResource.terminate()
AsyncBoxesResource.web_terminal_url()
AsyncBoxesResource.with_raw_response
AsyncBoxesResource.with_streaming_response
BoxesResource
BoxesResource.actions
BoxesResource.android
BoxesResource.browser
BoxesResource.create_android()
BoxesResource.create_linux()
BoxesResource.display()
BoxesResource.execute_commands()
BoxesResource.fs
BoxesResource.list()
BoxesResource.live_view_url()
BoxesResource.retrieve()
BoxesResource.run_code()
BoxesResource.start()
BoxesResource.stop()
BoxesResource.terminate()
BoxesResource.web_terminal_url()
BoxesResource.with_raw_response
BoxesResource.with_streaming_response
- gbox_sdk.resources.v1.boxes.browser module
- gbox_sdk.resources.v1.boxes.fs module
- Module contents
ActionsResource
ActionsResource.ai()
ActionsResource.click()
ActionsResource.drag()
ActionsResource.extract()
ActionsResource.move()
ActionsResource.press_button()
ActionsResource.press_key()
ActionsResource.screen_rotation()
ActionsResource.screenshot()
ActionsResource.scroll()
ActionsResource.swipe()
ActionsResource.touch()
ActionsResource.type()
ActionsResource.with_raw_response
ActionsResource.with_streaming_response
ActionsResourceWithRawResponse
ActionsResourceWithStreamingResponse
AndroidResource
AndroidResource.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_response
AndroidResource.with_streaming_response
AndroidResourceWithRawResponse
AndroidResourceWithStreamingResponse
AsyncActionsResource
AsyncActionsResource.ai()
AsyncActionsResource.click()
AsyncActionsResource.drag()
AsyncActionsResource.extract()
AsyncActionsResource.move()
AsyncActionsResource.press_button()
AsyncActionsResource.press_key()
AsyncActionsResource.screen_rotation()
AsyncActionsResource.screenshot()
AsyncActionsResource.scroll()
AsyncActionsResource.swipe()
AsyncActionsResource.touch()
AsyncActionsResource.type()
AsyncActionsResource.with_raw_response
AsyncActionsResource.with_streaming_response
AsyncActionsResourceWithRawResponse
AsyncActionsResourceWithStreamingResponse
AsyncAndroidResource
AsyncAndroidResource.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_response
AsyncAndroidResource.with_streaming_response
AsyncAndroidResourceWithRawResponse
AsyncAndroidResourceWithStreamingResponse
AsyncBoxesResource
AsyncBoxesResource.actions
AsyncBoxesResource.android
AsyncBoxesResource.browser
AsyncBoxesResource.create_android()
AsyncBoxesResource.create_linux()
AsyncBoxesResource.display()
AsyncBoxesResource.execute_commands()
AsyncBoxesResource.fs
AsyncBoxesResource.list()
AsyncBoxesResource.live_view_url()
AsyncBoxesResource.retrieve()
AsyncBoxesResource.run_code()
AsyncBoxesResource.start()
AsyncBoxesResource.stop()
AsyncBoxesResource.terminate()
AsyncBoxesResource.web_terminal_url()
AsyncBoxesResource.with_raw_response
AsyncBoxesResource.with_streaming_response
AsyncBoxesResourceWithRawResponse
AsyncBoxesResourceWithStreamingResponse
AsyncBrowserResource
AsyncBrowserResourceWithRawResponse
AsyncBrowserResourceWithStreamingResponse
AsyncFsResource
AsyncFsResourceWithRawResponse
AsyncFsResourceWithStreamingResponse
BoxesResource
BoxesResource.actions
BoxesResource.android
BoxesResource.browser
BoxesResource.create_android()
BoxesResource.create_linux()
BoxesResource.display()
BoxesResource.execute_commands()
BoxesResource.fs
BoxesResource.list()
BoxesResource.live_view_url()
BoxesResource.retrieve()
BoxesResource.run_code()
BoxesResource.start()
BoxesResource.stop()
BoxesResource.terminate()
BoxesResource.web_terminal_url()
BoxesResource.with_raw_response
BoxesResource.with_streaming_response
BoxesResourceWithRawResponse
BoxesResourceWithStreamingResponse
BrowserResource
BrowserResourceWithRawResponse
BrowserResourceWithStreamingResponse
FsResource
FsResourceWithRawResponse
FsResourceWithStreamingResponse
Submodules¶
gbox_sdk.resources.v1.v1 module¶
- class gbox_sdk.resources.v1.v1.AsyncV1Resource(client)¶
Bases:
AsyncAPIResource
- property boxes: AsyncBoxesResource¶
- 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 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=NOT_GIVEN, wait=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create android box
- Return type:
- Args:
config: Configuration for a Android box instance
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=NOT_GIVEN, wait=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create linux box
- Return type:
- Args:
config: Configuration for a Linux box instance
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, *, commands, envs=NOT_GIVEN, api_timeout=NOT_GIVEN, working_dir=NOT_GIVEN, 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:
commands: The command to run. Can be a single string or an array of strings
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=NOT_GIVEN, labels=NOT_GIVEN, page=NOT_GIVEN, page_size=NOT_GIVEN, status=NOT_GIVEN, type=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
List box
- 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=NOT_GIVEN, 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
- async retrieve(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get 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=NOT_GIVEN, envs=NOT_GIVEN, language=NOT_GIVEN, api_timeout=NOT_GIVEN, working_dir=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Run code on the box
- 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=NOT_GIVEN, 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=NOT_GIVEN, 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
- async terminate(box_id, *, wait=NOT_GIVEN, 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=NOT_GIVEN, 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
- 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¶
- class gbox_sdk.resources.v1.AsyncBoxesResourceWithStreamingResponse(boxes)¶
Bases:
object
- property actions: AsyncActionsResourceWithStreamingResponse¶
- property android: AsyncAndroidResourceWithStreamingResponse¶
- property browser: AsyncBrowserResourceWithStreamingResponse¶
- property fs: AsyncFsResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.AsyncV1Resource(client)¶
Bases:
AsyncAPIResource
- property boxes: AsyncBoxesResource¶
- 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¶
- class gbox_sdk.resources.v1.AsyncV1ResourceWithStreamingResponse(v1)¶
Bases:
object
- property boxes: AsyncBoxesResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.BoxesResource(client)¶
Bases:
SyncAPIResource
- property actions: ActionsResource¶
- property android: AndroidResource¶
- property browser: BrowserResource¶
- create_android(*, config=NOT_GIVEN, wait=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create android box
- Return type:
- Args:
config: Configuration for a Android box instance
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=NOT_GIVEN, wait=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Create linux box
- Return type:
- Args:
config: Configuration for a Linux box instance
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, *, commands, envs=NOT_GIVEN, api_timeout=NOT_GIVEN, working_dir=NOT_GIVEN, 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:
commands: The command to run. Can be a single string or an array of strings
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=NOT_GIVEN, labels=NOT_GIVEN, page=NOT_GIVEN, page_size=NOT_GIVEN, status=NOT_GIVEN, type=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
List box
- 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=NOT_GIVEN, 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
- retrieve(box_id, *, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Get 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=NOT_GIVEN, envs=NOT_GIVEN, language=NOT_GIVEN, api_timeout=NOT_GIVEN, working_dir=NOT_GIVEN, extra_headers=None, extra_query=None, extra_body=None, timeout=NOT_GIVEN)¶
Run code on the box
- 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=NOT_GIVEN, 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=NOT_GIVEN, 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
- terminate(box_id, *, wait=NOT_GIVEN, 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=NOT_GIVEN, 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
- 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¶
- class gbox_sdk.resources.v1.BoxesResourceWithStreamingResponse(boxes)¶
Bases:
object
- property actions: ActionsResourceWithStreamingResponse¶
- property android: AndroidResourceWithStreamingResponse¶
- property browser: BrowserResourceWithStreamingResponse¶
- property fs: FsResourceWithStreamingResponse¶
- class gbox_sdk.resources.v1.V1Resource(client)¶
Bases:
SyncAPIResource
- property boxes: BoxesResource¶
- 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¶
- class gbox_sdk.resources.v1.V1ResourceWithStreamingResponse(v1)¶
Bases:
object
- property boxes: BoxesResourceWithStreamingResponse¶