Skip to content

Data Models API

This page lists request, response, and enum data models.

Enums

SandboxStatus


              flowchart TD
              ms_enclave.sandbox.model.base.SandboxStatus[SandboxStatus]

              

              click ms_enclave.sandbox.model.base.SandboxStatus href "" "ms_enclave.sandbox.model.base.SandboxStatus"
            

Sandbox status enumeration.

SandboxType


              flowchart TD
              ms_enclave.sandbox.model.base.SandboxType[SandboxType]

              

              click ms_enclave.sandbox.model.base.SandboxType href "" "ms_enclave.sandbox.model.base.SandboxType"
            

Sandbox type enumeration.

Methods:

get_compatible_types classmethod

get_compatible_types(sandbox_type: SandboxType) -> Set[SandboxType]

Get all compatible sandbox types for a given sandbox type.

A sandbox type is compatible with itself and all its "parent" types. For example, DOCKER_NOTEBOOK is compatible with both DOCKER_NOTEBOOK and DOCKER.

Parameters:

  • sandbox_type

    (SandboxType) –

    The sandbox type to check compatibility for

Returns:

Source code in ms_enclave/sandbox/model/base.py
@classmethod
def get_compatible_types(cls, sandbox_type: 'SandboxType') -> Set['SandboxType']:
    """
    Get all compatible sandbox types for a given sandbox type.

    A sandbox type is compatible with itself and all its "parent" types.
    For example, DOCKER_NOTEBOOK is compatible with both DOCKER_NOTEBOOK and DOCKER.

    Args:
        sandbox_type: The sandbox type to check compatibility for

    Returns:
        Set of compatible sandbox types
    """
    # Define inheritance hierarchy: child -> parents
    # DOCKER_NOTEBOOK inherits from DOCKER (can use DOCKER tools)
    # VOLCENGINE is a standalone stateless remote sandbox (no inheritance)
    inheritance_map = {
        cls.DOCKER: {cls.DOCKER},
        cls.DOCKER_NOTEBOOK: {cls.DOCKER_NOTEBOOK, cls.DOCKER},
        cls.VOLCENGINE: {cls.VOLCENGINE},
    }

    return inheritance_map.get(sandbox_type, {sandbox_type})

is_compatible classmethod

Check if a sandbox type is compatible with a required type.

Parameters:

  • sandbox_type

    (SandboxType) –

    The actual sandbox type

  • required_type

    (SandboxType) –

    The required sandbox type by a tool

Returns:

  • bool

    True if sandbox_type can use tools requiring required_type

Source code in ms_enclave/sandbox/model/base.py
@classmethod
def is_compatible(cls, sandbox_type: 'SandboxType', required_type: 'SandboxType') -> bool:
    """
    Check if a sandbox type is compatible with a required type.

    Args:
        sandbox_type: The actual sandbox type
        required_type: The required sandbox type by a tool

    Returns:
        True if sandbox_type can use tools requiring required_type
    """
    compatible_types = cls.get_compatible_types(sandbox_type)
    return required_type in compatible_types

SandboxManagerType


              flowchart TD
              ms_enclave.sandbox.model.base.SandboxManagerType[SandboxManagerType]

              

              click ms_enclave.sandbox.model.base.SandboxManagerType href "" "ms_enclave.sandbox.model.base.SandboxManagerType"
            

Sandbox manager type enumeration.

ExecutionStatus


              flowchart TD
              ms_enclave.sandbox.model.base.ExecutionStatus[ExecutionStatus]

              

              click ms_enclave.sandbox.model.base.ExecutionStatus href "" "ms_enclave.sandbox.model.base.ExecutionStatus"
            

Execution status enumeration.

ToolType


              flowchart TD
              ms_enclave.sandbox.model.base.ToolType[ToolType]

              

              click ms_enclave.sandbox.model.base.ToolType href "" "ms_enclave.sandbox.model.base.ToolType"
            

Tool type enumeration.

Request Models

ExecuteCodeRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.ExecuteCodeRequest[ExecuteCodeRequest]

              

              click ms_enclave.sandbox.model.requests.ExecuteCodeRequest href "" "ms_enclave.sandbox.model.requests.ExecuteCodeRequest"
            

Request model for code execution.

ExecuteCommandRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.ExecuteCommandRequest[ExecuteCommandRequest]

              

              click ms_enclave.sandbox.model.requests.ExecuteCommandRequest href "" "ms_enclave.sandbox.model.requests.ExecuteCommandRequest"
            

Request model for shell command execution.

ToolExecutionRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.ToolExecutionRequest[ToolExecutionRequest]

              

              click ms_enclave.sandbox.model.requests.ToolExecutionRequest href "" "ms_enclave.sandbox.model.requests.ToolExecutionRequest"
            

Request model for tool execution.

FileOperationRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.FileOperationRequest[FileOperationRequest]

              

              click ms_enclave.sandbox.model.requests.FileOperationRequest href "" "ms_enclave.sandbox.model.requests.FileOperationRequest"
            

Base request model for file operations.

ReadFileRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.ReadFileRequest[ReadFileRequest]
              ms_enclave.sandbox.model.requests.FileOperationRequest[FileOperationRequest]

                              ms_enclave.sandbox.model.requests.FileOperationRequest --> ms_enclave.sandbox.model.requests.ReadFileRequest
                


              click ms_enclave.sandbox.model.requests.ReadFileRequest href "" "ms_enclave.sandbox.model.requests.ReadFileRequest"
              click ms_enclave.sandbox.model.requests.FileOperationRequest href "" "ms_enclave.sandbox.model.requests.FileOperationRequest"
            

Request model for reading files.

WriteFileRequest


              flowchart TD
              ms_enclave.sandbox.model.requests.WriteFileRequest[WriteFileRequest]
              ms_enclave.sandbox.model.requests.FileOperationRequest[FileOperationRequest]

                              ms_enclave.sandbox.model.requests.FileOperationRequest --> ms_enclave.sandbox.model.requests.WriteFileRequest
                


              click ms_enclave.sandbox.model.requests.WriteFileRequest href "" "ms_enclave.sandbox.model.requests.WriteFileRequest"
              click ms_enclave.sandbox.model.requests.FileOperationRequest href "" "ms_enclave.sandbox.model.requests.FileOperationRequest"
            

Request model for writing files.

Response Models

SandboxInfo


              flowchart TD
              ms_enclave.sandbox.model.responses.SandboxInfo[SandboxInfo]

              

              click ms_enclave.sandbox.model.responses.SandboxInfo href "" "ms_enclave.sandbox.model.responses.SandboxInfo"
            

Information about a sandbox instance.

ToolResult


              flowchart TD
              ms_enclave.sandbox.model.responses.ToolResult[ToolResult]
              ms_enclave.sandbox.model.responses.ExecutionResult[ExecutionResult]

                              ms_enclave.sandbox.model.responses.ExecutionResult --> ms_enclave.sandbox.model.responses.ToolResult
                


              click ms_enclave.sandbox.model.responses.ToolResult href "" "ms_enclave.sandbox.model.responses.ToolResult"
              click ms_enclave.sandbox.model.responses.ExecutionResult href "" "ms_enclave.sandbox.model.responses.ExecutionResult"
            

Result of tool execution.

Attributes:

  • success (bool) –

    Check if the tool execution was successful.

success property

success: bool

Check if the tool execution was successful.

CommandResult


              flowchart TD
              ms_enclave.sandbox.model.responses.CommandResult[CommandResult]
              ms_enclave.sandbox.model.responses.ExecutionResult[ExecutionResult]

                              ms_enclave.sandbox.model.responses.ExecutionResult --> ms_enclave.sandbox.model.responses.CommandResult
                


              click ms_enclave.sandbox.model.responses.CommandResult href "" "ms_enclave.sandbox.model.responses.CommandResult"
              click ms_enclave.sandbox.model.responses.ExecutionResult href "" "ms_enclave.sandbox.model.responses.ExecutionResult"
            

Command execution result.

HealthCheckResult


              flowchart TD
              ms_enclave.sandbox.model.responses.HealthCheckResult[HealthCheckResult]

              

              click ms_enclave.sandbox.model.responses.HealthCheckResult href "" "ms_enclave.sandbox.model.responses.HealthCheckResult"
            

Health check result.