Parameter Groups
albert.collections.parameter_groups
AlbertHTTPError
Bases: AlbertException
Base class for all erors due to HTTP responses.
Source code in src/albert/exceptions.py
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
client_credentials: ClientCredentials | None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
The base URL to prefix to all requests. (e.g., "https://sandbox.albertinvent.com") |
required |
retries
|
int
|
The number of retries for failed requests. Defaults to 3. |
None
|
client_credentials
|
ClientCredentials | None
|
The client credentials for programmatic authentication. Optional if token is provided. |
None
|
token
|
str | None
|
The JWT token for authentication. Optional if client credentials are provided. |
None
|
Methods:
Name | Description |
---|---|
request |
|
Source code in src/albert/session.py
request
Source code in src/albert/session.py
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
OrderBy
PGType
ParameterGroup
Bases: BaseTaggedResource
Use 'Standards' key in metadata to store standards
acl
class-attribute
instance-attribute
documents
class-attribute
instance-attribute
documents: list[EntityLink] = Field(
default_factory=list, exclude=True, frozen=True
)
metadata
class-attribute
instance-attribute
parameters
class-attribute
instance-attribute
parameters: list[ParameterValue] = Field(
default_factory=list, alias="Parameters"
)
security_class
class-attribute
instance-attribute
verified
class-attribute
instance-attribute
verified: bool = Field(
default=False, exclude=True, frozen=True
)
ParameterGroupCollection
ParameterGroupCollection(*, session: AlbertSession)
Bases: BaseCollection
ParameterGroupCollection is a collection class for managing ParameterGroup entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session to use for making requests. |
required |
Methods:
Name | Description |
---|---|
create |
Create a new parameter group. |
delete |
Delete a parameter group by its ID. |
get_by_id |
Get a parameter group by its ID. |
get_by_ids |
|
get_by_name |
Get a parameter group by its name. |
list |
Search for Parameter Groups matching the given criteria. |
update |
Update a parameter group. |
Source code in src/albert/collections/parameter_groups.py
create
create(
*, parameter_group: ParameterGroup
) -> ParameterGroup
Create a new parameter group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter_group
|
ParameterGroup
|
The parameter group to create. |
required |
Returns:
Type | Description |
---|---|
ParameterGroup
|
The created parameter group. |
Source code in src/albert/collections/parameter_groups.py
delete
delete(*, id: str) -> None
Delete a parameter group by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the parameter group to delete |
required |
Source code in src/albert/collections/parameter_groups.py
get_by_id
get_by_id(*, id: str) -> ParameterGroup
Get a parameter group by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the parameter group to retrieve. |
required |
Returns:
Type | Description |
---|---|
ParameterGroup
|
The parameter group with the given ID. |
Source code in src/albert/collections/parameter_groups.py
get_by_ids
get_by_ids(*, ids: list[str]) -> ParameterGroup
Source code in src/albert/collections/parameter_groups.py
get_by_name
get_by_name(*, name: str) -> ParameterGroup | None
Get a parameter group by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the parameter group to retrieve. |
required |
Returns:
Type | Description |
---|---|
ParameterGroup | None
|
The parameter group with the given name, or None if not found. |
Source code in src/albert/collections/parameter_groups.py
list
list(
*,
text: str | None = None,
types: PGType | list[PGType] | None = None,
order_by: OrderBy = DESCENDING,
limit: int = 25,
offset: int | None = None,
) -> Iterator[ParameterGroup]
Search for Parameter Groups matching the given criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str | None
|
Text to search for, by default None |
None
|
types
|
PGType | list[PGType] | None
|
Filer the returned Parameter Groups by Type, by default None |
None
|
order_by
|
OrderBy
|
The order in which to return results, by default OrderBy.DESCENDING |
DESCENDING
|
Yields:
Type | Description |
---|---|
Iterator[ParameterGroup]
|
An iterator of Parameter Groups matching the given criteria. |
Source code in src/albert/collections/parameter_groups.py
update
update(
*, parameter_group: ParameterGroup
) -> ParameterGroup
Update a parameter group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter_group
|
ParameterGroup
|
The updated ParameterGroup. The ParameterGroup must have an ID. |
required |
Returns:
Type | Description |
---|---|
ParameterGroup
|
The updated ParameterGroup as returned by the server. |