gbox_sdk.types.v1 package

Subpackages

Submodules

gbox_sdk.types.v1.android_box module

class gbox_sdk.types.v1.android_box.AndroidBox(**data)

Bases: BaseModel

config: Config

Complete configuration for Android box instance

created_at: datetime

Creation timestamp of the box

expires_at: Optional[datetime]

Expiration timestamp of the box

id: str

Unique identifier for the box

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

status: Literal['pending', 'running', 'error', 'terminated']

The current status of a box instance

type: Literal['android']

Box type is Android

updated_at: datetime

Last update timestamp of the box

class gbox_sdk.types.v1.android_box.Config(**data)

Bases: BaseModel

cpu: float

CPU cores allocated to the box

device_type: Optional[Literal['virtual', 'physical']]

Device type - virtual or physical Android device

envs: Dict[str, str]

Environment variables for the box.

These variables will be available in all operations including command execution, code running, and other box behaviors

labels: Dict[str, str]

Key-value pairs of labels for the box.

Labels are used to add custom metadata to help identify, categorize, and manage boxes. Common use cases include project names, environments, teams, applications, or any other organizational tags that help you organize and filter your boxes.

memory: float

Memory allocated to the box in MiB

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

os: ConfigOs

Android operating system configuration

storage: float

Storage allocated to the box in GiB

working_dir: Optional[str]

Working directory path for the box.

This directory serves as the default starting point for all operations including command execution, code running, and file system operations. When you execute commands or run code, they will start from this directory unless explicitly specified otherwise.

class gbox_sdk.types.v1.android_box.ConfigOs(**data)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

version: Literal['12', '13', '15']

Supported Android versions

gbox_sdk.types.v1.box_create_android_params module

class gbox_sdk.types.v1.box_create_android_params.BoxCreateAndroidParams

Bases: TypedDict

config: Config

Configuration for a Android box instance

wait: bool

Wait for the box operation to be completed, default is true

class gbox_sdk.types.v1.box_create_android_params.Config

Bases: TypedDict

device_type: Annotated[Literal['virtual', 'physical']]

Device type - virtual or physical Android device

envs: Dict[str, str]

Environment variables for the box.

These variables will be available in all operations including command execution, code running, and other box behaviors

expires_in: Annotated[str]

The box 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: 60m

labels: Dict[str, str]

Key-value pairs of labels for the box.

Labels are used to add custom metadata to help identify, categorize, and manage boxes. Common use cases include project names, environments, teams, applications, or any other organizational tags that help you organize and filter your boxes.

gbox_sdk.types.v1.box_create_linux_params module

class gbox_sdk.types.v1.box_create_linux_params.BoxCreateLinuxParams

Bases: TypedDict

config: Config

Configuration for a Linux box instance

wait: bool

Wait for the box operation to be completed, default is true

class gbox_sdk.types.v1.box_create_linux_params.Config

Bases: TypedDict

envs: Dict[str, str]

Environment variables for the box.

These variables will be available in all operations including command execution, code running, and other box behaviors

expires_in: Annotated[str]

The box 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: 60m

labels: Dict[str, str]

Key-value pairs of labels for the box.

Labels are used to add custom metadata to help identify, categorize, and manage boxes. Common use cases include project names, environments, teams, applications, or any other organizational tags that help you organize and filter your boxes.

gbox_sdk.types.v1.box_execute_commands_params module

class gbox_sdk.types.v1.box_execute_commands_params.BoxExecuteCommandsParams

Bases: TypedDict

api_timeout: Annotated[str]

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

commands: Required[Union[str, List[str]]]

The command to run. Can be a single string or an array of strings

envs: object

The environment variables to run the command

working_dir: Annotated[str]

The working directory of the command.

It not provided, the command will be run in the box.config.workingDir directory.

gbox_sdk.types.v1.box_execute_commands_response module

class gbox_sdk.types.v1.box_execute_commands_response.BoxExecuteCommandsResponse(**data)

Bases: BaseModel

exit_code: float

The exit code of the command

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

stderr: str

The standard error output of the command

stdout: str

The standard output of the command

gbox_sdk.types.v1.box_list_params module

class gbox_sdk.types.v1.box_list_params.BoxListParams

Bases: TypedDict

device_type: Annotated[str]

Filter boxes by their device type (virtual, physical)

labels: object

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: int

Page number

page_size: Annotated[int]

Page size

status: List[Literal['all', 'pending', 'running', 'error', 'terminated']]

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: List[Literal['all', 'linux', 'android']]

Filter boxes by their type (linux, android, all).

Must be an array of types. Use ‘all’ to get boxes of any type.

gbox_sdk.types.v1.box_list_response module

class gbox_sdk.types.v1.box_list_response.BoxListResponse(**data)

Bases: BaseModel

data: List[Union[LinuxBox, AndroidBox]]

A box instance that can be either Linux or Android type

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

page: int

Page number

page_size: int

Page size

total: int

Total number of items

gbox_sdk.types.v1.box_live_view_url_params module

class gbox_sdk.types.v1.box_live_view_url_params.BoxLiveViewURLParams

Bases: TypedDict

expires_in: Annotated[str]

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

gbox_sdk.types.v1.box_live_view_url_response module

class gbox_sdk.types.v1.box_live_view_url_response.BoxLiveViewURLResponse(**data)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str

Live view url

gbox_sdk.types.v1.box_retrieve_response module

gbox_sdk.types.v1.box_run_code_params module

class gbox_sdk.types.v1.box_run_code_params.BoxRunCodeParams

Bases: TypedDict

api_timeout: Annotated[str]

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

argv: List[str]

The arguments to run the code.

For example, if you want to run “python index.py –help”, you should pass [”–help”] as arguments.

code: Required[str]

The code to run

envs: object

The environment variables to run the code

language: Literal['bash', 'python', 'typescript']

The language of the code.

working_dir: Annotated[str]

The working directory of the code.

It not provided, the code will be run in the box.config.workingDir directory.

gbox_sdk.types.v1.box_run_code_response module

class gbox_sdk.types.v1.box_run_code_response.BoxRunCodeResponse(**data)

Bases: BaseModel

exit_code: float

The exit code of the code

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

stderr: str

The stderr of the code

stdout: str

The stdout of the code

gbox_sdk.types.v1.box_start_params module

class gbox_sdk.types.v1.box_start_params.BoxStartParams

Bases: TypedDict

wait: bool

Wait for the box operation to be completed, default is true

gbox_sdk.types.v1.box_start_response module

gbox_sdk.types.v1.box_stop_params module

class gbox_sdk.types.v1.box_stop_params.BoxStopParams

Bases: TypedDict

wait: bool

Wait for the box operation to be completed, default is true

gbox_sdk.types.v1.box_stop_response module

gbox_sdk.types.v1.box_terminate_params module

class gbox_sdk.types.v1.box_terminate_params.BoxTerminateParams

Bases: TypedDict

wait: bool

Wait for the box operation to be completed, default is true

gbox_sdk.types.v1.box_web_terminal_url_params module

class gbox_sdk.types.v1.box_web_terminal_url_params.BoxWebTerminalURLParams

Bases: TypedDict

expires_in: Annotated[str]

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

gbox_sdk.types.v1.box_web_terminal_url_response module

class gbox_sdk.types.v1.box_web_terminal_url_response.BoxWebTerminalURLResponse(**data)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str

Web terminal url

gbox_sdk.types.v1.create_box_config_param module

gbox_sdk.types.v1.linux_box module

class gbox_sdk.types.v1.linux_box.Config(**data)

Bases: BaseModel

cpu: float

CPU cores allocated to the box

envs: Dict[str, str]

Environment variables for the box.

These variables will be available in all operations including command execution, code running, and other box behaviors

labels: Dict[str, str]

Key-value pairs of labels for the box.

Labels are used to add custom metadata to help identify, categorize, and manage boxes. Common use cases include project names, environments, teams, applications, or any other organizational tags that help you organize and filter your boxes.

memory: float

Memory allocated to the box in MiB

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

os: ConfigOs

Linux operating system configuration

storage: float

Storage allocated to the box in GiB.

working_dir: str

Working directory path for the box.

This directory serves as the default starting point for all operations including command execution, code running, and file system operations. When you execute commands or run code, they will start from this directory unless explicitly specified otherwise.

class gbox_sdk.types.v1.linux_box.ConfigOs(**data)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

version: str

OS version string (e.g. ‘ubuntu-20.04’)

class gbox_sdk.types.v1.linux_box.LinuxBox(**data)

Bases: BaseModel

config: Config

Complete configuration for Linux box instance

created_at: datetime

Creation timestamp of the box

expires_at: Optional[datetime]

Expiration timestamp of the box

id: str

Unique identifier for the box

model_config: ClassVar[ConfigDict] = {'defer_build': True, 'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

status: Literal['pending', 'running', 'error', 'terminated']

The current status of a box instance

type: Literal['linux']

Box type is Linux

updated_at: datetime

Last update timestamp of the box

Module contents