Appearance
Session API Reference
Related Tutorial
- Session Management Guide - Detailed tutorial on session lifecycle and management
Overview
The Session module provides methods for creating, managing, and terminating sessions in the AGB cloud environment. Sessions are the foundation for all operations.
Session
python
class Session()Session represents a session in the AGB cloud environment.
set_labels
python
def set_labels(labels: Dict[str, str]) -> OperationResultSets the labels for this session.
Arguments:
labelsDict[str, str] - The labels to set for the session.
Returns:
OperationResult: Result indicating success or failure with request ID.
Raises:
SessionError: If the operation fails.
get_labels
python
def get_labels() -> OperationResultGets the labels for this session.
Returns:
OperationResult: Result containing the labels as data and request ID.
Raises:
SessionError: If the operation fails.
info
python
def info() -> OperationResultGet session information including resource details.
Returns:
OperationResult: Result containing the session information as data and
request ID.
get_link
python
def get_link(protocol_type: Optional[str] = None,
port: Optional[int] = None) -> OperationResultGet a link associated with the current session.
Arguments:
protocol_typeOptional[str] - The protocol type to use for the link. Defaults to None.portOptional[int] - The port to use for the link.
Returns:
OperationResult: Result containing the link as data and request ID.
Raises:
SessionError: If the request fails or the response is invalid.
delete
python
def delete(sync_context: bool = False) -> DeleteResultDelete this session and release all associated resources.
Arguments:
sync_contextbool, optional - Whether to sync context data (trigger file uploads) before deleting the session. Defaults to False.
Returns:
DeleteResult: Result indicating success or failure with request ID.
- success (bool): True if deletion succeeded
- error_message (str): Error details if deletion failed
- request_id (str): Unique identifier for this API request
get_status
python
def get_status() -> "SessionStatusResult"Get basic session status.
Returns:
SessionStatusResult: Result containing session status only.
Related Resources
Documentation generated automatically from source code using pydoc-markdown.