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 a session by session object.
Arguments:
sync_contextbool - Whether to sync context before deletion. Defaults to False.
Returns:
DeleteResult: Result indicating success or failure and request ID.
Related Resources
Documentation generated automatically from source code using pydoc-markdown.