Appearance
Class: AGB
📖 Related Tutorial
- Quick Start Guide - Get started with the AGB Python SDK
Overview
The main AGB module provides the core functionality for creating and managing sessions with the AGB cloud platform. It serves as the entry point for all SDK operations.
Main class for interacting with the AGB cloud runtime environment. Use this class to create, list, and manage sessions.
Table of contents
Properties
Methods
Properties
typescript
apiKey: `string`
client: ``Client``
config: ``Config``
context: [`ContextService`](data_context/context.md)Methods
create
▸ create(params?): Promise<SessionResult>
Create a new session in the AGB cloud environment.
Parameters
| Name | Type | Description |
|---|---|---|
params? | null | CreateSessionParams | Parameters for creating the session (imageId is required) |
Returns
Promise<SessionResult>
Promise resolving to SessionResult with success, session, requestId, and optional errorMessage
Example
typescript
const agb = new AGB({ apiKey: 'your_api_key' });
const result = await agb.create({ imageId: 'agb-code-space-1' });
if (result.success && result.session) {
await result.session.file.readFile('/etc/hostname');
await agb.delete(result.session);
}delete
▸ delete(session, syncContext?): Promise<DeleteResult>
Delete (release) a session.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
session | Session | undefined | The session to delete |
syncContext | boolean | false | If true, sync context before releasing (e.g. upload browser data) |
Returns
Promise<DeleteResult>
Promise resolving to DeleteResult with success and requestId
get
▸ get(sessionId): Promise<SessionResult>
Get a Session instance by session ID.
Parameters
| Name | Type | Description |
|---|---|---|
sessionId | string | The session ID |
Returns
Promise<SessionResult>
Promise resolving to SessionResult with a Session object or error
list
▸ list(labels?, page?, limit?): Promise<SessionListResult>
List sessions filtered by labels with pagination.
Parameters
| Name | Type | Description |
|---|---|---|
labels? | Record<string, string> | Optional key-value pairs to filter sessions |
page? | number | Page number (1-based). If provided, fetches that page. |
limit? | number | Maximum number of sessions per page (default 10) |
Returns
Promise<SessionListResult>
Promise resolving to SessionListResult with sessionIds, nextToken, totalCount, etc.
toJSON
▸ toJSON(): Record<string, unknown>
Serialize client configuration to a plain object.
Returns
Record<string, unknown>
Object with endpoint and timeoutMs