Targets (🧪Beta)
albert.collections.targets.TargetCollection
Bases: BaseCollection
A collection for managing targets in the Albert platform (🧪Beta).
Beta Feature!
Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base URL for target API requests. |
Methods:
| Name | Description |
|---|---|
create |
Creates a new target entity. |
get_by_id |
Retrieves a target by its ID. |
get_by_ids |
Fetches multiple targets at once by their IDs. |
delete |
Deletes a target by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Source code in src/albert/collections/targets.py
create
Creates a new target entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
Target
|
The target object to create. |
required |
Returns:
| Type | Description |
|---|---|
Target
|
The created Target entity. |
Source code in src/albert/collections/targets.py
get_by_id
get_by_ids
Fetches multiple targets at once by their IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
list[TargetId]
|
The IDs of the targets to fetch. |
required |
Returns:
| Type | Description |
|---|---|
list[Target]
|
A list of Target entities. |