Targets (🧪Beta)
albert.resources.targets
ComparisonOperator
NumericRange
Bases: BaseAlbertModel
Represents a range value for a target (used with the 'between' operator).
Attributes:
| Name | Type | Description |
|---|---|---|
min |
float
|
The minimum value. |
max |
float
|
The maximum value. |
Show JSON schema:
{
"description": "Represents a range value for a target (used with the 'between' operator).\n\nAttributes\n----------\nmin : float\n The minimum value.\nmax : float\n The maximum value.",
"properties": {
"min": {
"title": "Min",
"type": "number"
},
"max": {
"title": "Max",
"type": "number"
}
},
"required": [
"min",
"max"
],
"title": "NumericRange",
"type": "object"
}
Fields:
Criterion
Bases: BaseAlbertModel
Represents the target value constraint.
Attributes:
| Name | Type | Description |
|---|---|---|
operator |
ComparisonOperator
|
The comparison operator. |
value |
NumericRange | str | float | list
|
The target value. Can be a range, single value, or list of values. |
Show JSON schema:
{
"$defs": {
"ComparisonOperator": {
"description": "Enumeration of value comparison operators.\n\nAttributes\n----------\nEQ : str\n Equal to.\nGTE : str\n Greater than or equal to.\nLTE : str\n Less than or equal to.\nBETWEEN : str\n Between a range.\nIN_SET : str\n In a set of values.",
"enum": [
"eq",
"gt",
"gte",
"lt",
"lte",
"between",
"in-set"
],
"title": "ComparisonOperator",
"type": "string"
},
"NumericRange": {
"description": "Represents a range value for a target (used with the 'between' operator).\n\nAttributes\n----------\nmin : float\n The minimum value.\nmax : float\n The maximum value.",
"properties": {
"min": {
"title": "Min",
"type": "number"
},
"max": {
"title": "Max",
"type": "number"
}
},
"required": [
"min",
"max"
],
"title": "NumericRange",
"type": "object"
}
},
"description": "Represents the target value constraint.\n\nAttributes\n----------\noperator : ComparisonOperator\n The comparison operator.\nvalue : NumericRange | str | float | list\n The target value. Can be a range, single value, or list of values.",
"properties": {
"operator": {
"$ref": "#/$defs/ComparisonOperator"
},
"value": {
"anyOf": [
{
"$ref": "#/$defs/NumericRange"
},
{
"type": "string"
},
{
"type": "number"
},
{
"items": {},
"type": "array"
}
],
"title": "Value"
}
},
"required": [
"operator",
"value"
],
"title": "Criterion",
"type": "object"
}
Fields:
-
operator(ComparisonOperator) -
value(NumericRange | str | float | list)
TargetType
Enumeration of target types.
Attributes:
| Name | Type | Description |
|---|---|---|
PERFORMANCE |
str
|
A performance target. |
TargetParameter
Bases: BaseAlbertModel
Represents a parameter filter condition at which a target is measured.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The parameter ID. |
parameter_group_id |
str | None
|
The parameter group ID. |
category |
ParameterCategory
|
The parameter category. |
unit_id |
str | None
|
The unit ID for this parameter. |
value |
Criterion | None
|
The value filter. Accepts an operator/value-pair object with one of the
following operators: |
sequence |
str
|
The parameter sequence. |
Show JSON schema:
{
"$defs": {
"ComparisonOperator": {
"description": "Enumeration of value comparison operators.\n\nAttributes\n----------\nEQ : str\n Equal to.\nGTE : str\n Greater than or equal to.\nLTE : str\n Less than or equal to.\nBETWEEN : str\n Between a range.\nIN_SET : str\n In a set of values.",
"enum": [
"eq",
"gt",
"gte",
"lt",
"lte",
"between",
"in-set"
],
"title": "ComparisonOperator",
"type": "string"
},
"Criterion": {
"description": "Represents the target value constraint.\n\nAttributes\n----------\noperator : ComparisonOperator\n The comparison operator.\nvalue : NumericRange | str | float | list\n The target value. Can be a range, single value, or list of values.",
"properties": {
"operator": {
"$ref": "#/$defs/ComparisonOperator"
},
"value": {
"anyOf": [
{
"$ref": "#/$defs/NumericRange"
},
{
"type": "string"
},
{
"type": "number"
},
{
"items": {},
"type": "array"
}
],
"title": "Value"
}
},
"required": [
"operator",
"value"
],
"title": "Criterion",
"type": "object"
},
"NumericRange": {
"description": "Represents a range value for a target (used with the 'between' operator).\n\nAttributes\n----------\nmin : float\n The minimum value.\nmax : float\n The maximum value.",
"properties": {
"min": {
"title": "Min",
"type": "number"
},
"max": {
"title": "Max",
"type": "number"
}
},
"required": [
"min",
"max"
],
"title": "NumericRange",
"type": "object"
},
"ParameterCategory": {
"description": "The category of a parameter",
"enum": [
"Normal",
"Special"
],
"title": "ParameterCategory",
"type": "string"
}
},
"description": "Represents a parameter filter condition at which a target is measured.\n\nAttributes\n----------\nid : str\n The parameter ID.\nparameter_group_id : str | None\n The parameter group ID.\ncategory : ParameterCategory\n The parameter category.\nunit_id : str | None\n The unit ID for this parameter.\nvalue : Criterion | None\n The value filter. Accepts an operator/value-pair object with one of the\n following operators: ``eq``, ``gte``, ``lte``, ``between``, ``in-set``.\n For ``between``, the value must be ``{\"min\": ..., \"max\": ...}``.\n For ``in-set``, the value must be a list.\n Legacy bare scalars (numeric or string) are coerced on read: a numeric\n scalar becomes ``{\"operator\": \"eq\", \"value\": <n>}`` and a string becomes\n ``{\"operator\": \"in-set\", \"value\": [<s>]}``.\nsequence : str\n The parameter sequence.",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"parameterGroupId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parametergroupid"
},
"category": {
"$ref": "#/$defs/ParameterCategory"
},
"unitId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Unitid"
},
"value": {
"anyOf": [
{
"$ref": "#/$defs/Criterion"
},
{
"type": "null"
}
],
"default": null
},
"sequence": {
"title": "Sequence",
"type": "string"
}
},
"required": [
"id",
"category",
"sequence"
],
"title": "TargetParameter",
"type": "object"
}
Fields:
-
id(ParameterId) -
parameter_group_id(ParameterGroupId | None) -
category(ParameterCategory) -
unit_id(UnitId | None) -
value(Criterion | None) -
sequence(str)
Validators:
-
_coerce_legacy_value→value
Target
Bases: BaseResource
Represents a target entity.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
The unique identifier of the target. Set when retrieved from Albert. |
name |
str
|
The name of the target. |
type |
TargetType
|
The type of target. |
parent_id |
str | None
|
The ID of the project this target belongs to. When set, the target inherits its ACL policy from the referenced project. |
data_template_id |
str
|
The ID of the associated data template. |
data_column_id |
str
|
The ID of the associated data column. |
unit_id |
str | None
|
The unit ID for this target. |
parameters |
list[TargetParameter] | None
|
Parameter filter conditions for the target. |
validation |
list[dict] | None
|
Validation rules for the target value. |
target_value |
Criterion
|
The target value constraint. |
is_required |
bool
|
Whether this target is required. |
validation |
list[dict] | None
|
Validation rules for the target. |