Appearance
Context Manager API Reference
🗂️ Related Tutorial
- Context Usage Guide - Advanced context management features
Overview
The Context Manager module provides advanced context management capabilities including context synchronization and lifecycle management.
ContextStatusData
python
class ContextStatusData()ContextInfoResult
python
class ContextInfoResult(ApiResponse)ContextSyncResult
python
class ContextSyncResult(ApiResponse)ContextManager
python
class ContextManager()Manages context operations within a session in the AGB cloud environment.
The ContextManager provides methods to get information about context synchronization status and to synchronize contexts with the session.
info
python
def info(context_id: Optional[str] = None,
path: Optional[str] = None,
task_type: Optional[str] = None) -> ContextInfoResultGet detailed information about context synchronization status.
Arguments:
context_idOptional[str] - The ID of the context to query.pathOptional[str] - Specific path within the context to query.task_typeOptional[str] - Filter by task type (e.g., "upload", "download").
Returns:
ContextInfoResult: Result object containing status information.
sync
python
async def sync(context_id: Optional[str] = None,
path: Optional[str] = None,
mode: Optional[str] = None,
callback: Optional[Callable[[bool], None]] = None,
max_retries: int = 150,
retry_interval: int = 1500) -> ContextSyncResultSynchronizes context with support for both async and sync calling patterns.
Usage:
Async call - wait for completion
result = await session.context.sync()
Sync call - immediate return with callback
session.context.sync(callback=lambda success: logger.info(f"Done: {success}"))
Arguments:
context_idOptional[str] - Optional ID of the context to synchronize. If provided,pathmust also be provided.pathOptional[str] - Optional path where the context should be mounted. If provided,context_idmust also be provided.modeOptional[str] - Optional synchronization mode (e.g., "upload", "download")callbackOptional[Callable[[bool], None]] - Optional callback function that receives success status. If provided, the method runs in background and calls callback when completemax_retriesint - Maximum number of retries for polling. Defaults to 150.retry_intervalint - Milliseconds to wait between retries. Defaults to 1500.
Returns:
ContextSyncResult: Result object containing success status and request ID
Related Resources
Documentation generated automatically from source code using pydoc-markdown.