Models
zenml.models
Pydantic models for the various concepts in ZenML.
Attributes
__all__ = ['BaseRequest', 'BaseResponse', 'BaseUpdate', 'BaseIdentifiedResponse', 'BaseResponseBody', 'BaseResponseMetadata', 'BaseResponseResources', 'BaseDatedResponseBody', 'BaseZenModel', 'BasePluginFlavorResponse', 'UserScopedRequest', 'UserScopedFilter', 'UserScopedResponse', 'UserScopedResponseBody', 'UserScopedResponseMetadata', 'WorkspaceScopedRequest', 'WorkspaceScopedFilter', 'WorkspaceScopedResponse', 'WorkspaceScopedResponseBody', 'WorkspaceScopedResponseMetadata', 'WorkspaceScopedResponseResources', 'WorkspaceScopedFilter', 'BaseFilter', 'StrFilter', 'BoolFilter', 'NumericFilter', 'UUIDFilter', 'TaggableFilter', 'Page', 'ActionFilter', 'ActionRequest', 'ActionResponse', 'ActionResponseBody', 'ActionResponseMetadata', 'ActionResponseResources', 'ActionUpdate', 'ActionFlavorResponse', 'ActionFlavorResponseBody', 'ActionFlavorResponseMetadata', 'ActionFlavorResponseResources', 'APIKey', 'APIKeyRequest', 'APIKeyUpdate', 'APIKeyFilter', 'APIKeyResponse', 'APIKeyResponseBody', 'APIKeyResponseMetadata', 'APIKeyInternalResponse', 'APIKeyInternalUpdate', 'APIKeyRotateRequest', 'ArtifactFilter', 'ArtifactRequest', 'ArtifactResponse', 'ArtifactResponseBody', 'ArtifactResponseMetadata', 'ArtifactUpdate', 'ArtifactVersionRequest', 'ArtifactVersionFilter', 'ArtifactVersionResponse', 'ArtifactVersionResponseBody', 'ArtifactVersionResponseMetadata', 'ArtifactVersionUpdate', 'ArtifactVisualizationRequest', 'ArtifactVisualizationResponse', 'ArtifactVisualizationResponseBody', 'ArtifactVisualizationResponseMetadata', 'CodeReferenceRequest', 'CodeReferenceResponse', 'CodeReferenceResponseBody', 'CodeReferenceResponseMetadata', 'CodeRepositoryUpdate', 'CodeRepositoryFilter', 'CodeRepositoryRequest', 'CodeRepositoryResponse', 'CodeRepositoryResponseBody', 'CodeRepositoryResponseMetadata', 'ComponentBase', 'ComponentRequest', 'ComponentUpdate', 'ComponentFilter', 'ComponentResponse', 'ComponentResponseBody', 'ComponentResponseMetadata', 'ComponentResponseResources', 'EventSourceFlavorResponse', 'EventSourceFlavorResponseBody', 'EventSourceFlavorResponseMetadata', 'EventSourceFlavorResponseResources', 'FlavorRequest', 'FlavorUpdate', 'FlavorFilter', 'FlavorResponse', 'FlavorResponseBody', 'FlavorResponseMetadata', 'LogsRequest', 'LogsResponse', 'LogsResponseBody', 'LogsResponseMetadata', 'ModelFilter', 'ModelRequest', 'ModelResponse', 'ModelResponseBody', 'ModelResponseMetadata', 'ModelUpdate', 'ModelVersionFilter', 'ModelVersionRequest', 'ModelVersionResponse', 'ModelVersionResponseBody', 'ModelVersionResponseMetadata', 'ModelVersionResponseResources', 'ModelVersionUpdate', 'ModelVersionArtifactFilter', 'ModelVersionArtifactRequest', 'ModelVersionArtifactResponse', 'ModelVersionArtifactResponseBody', 'ModelVersionPipelineRunFilter', 'ModelVersionPipelineRunRequest', 'ModelVersionPipelineRunResponse', 'ModelVersionPipelineRunResponseBody', 'OAuthDeviceUpdate', 'OAuthDeviceFilter', 'OAuthDeviceResponse', 'OAuthDeviceResponseBody', 'OAuthDeviceResponseMetadata', 'OAuthDeviceInternalRequest', 'OAuthDeviceInternalUpdate', 'OAuthDeviceInternalResponse', 'PipelineRequest', 'PipelineUpdate', 'PipelineFilter', 'PipelineResponse', 'PipelineResponseBody', 'PipelineResponseMetadata', 'PipelineResponseResources', 'PipelineBuildBase', 'PipelineBuildRequest', 'PipelineBuildFilter', 'PipelineBuildResponse', 'PipelineBuildResponseBody', 'PipelineBuildResponseMetadata', 'PipelineDeploymentBase', 'PipelineDeploymentRequest', 'PipelineDeploymentFilter', 'PipelineDeploymentResponse', 'PipelineDeploymentResponseBody', 'PipelineDeploymentResponseMetadata', 'PipelineRunRequest', 'PipelineRunUpdate', 'PipelineRunFilter', 'PipelineRunResponse', 'PipelineRunResponseBody', 'PipelineRunResponseMetadata', 'PipelineRunResponseResources', 'RunTemplateRequest', 'RunTemplateUpdate', 'RunTemplateResponse', 'RunTemplateResponseBody', 'RunTemplateResponseMetadata', 'RunTemplateResponseResources', 'RunTemplateFilter', 'RunMetadataRequest', 'ScheduleRequest', 'ScheduleUpdate', 'ScheduleFilter', 'ScheduleResponse', 'ScheduleResponseBody', 'ScheduleResponseMetadata', 'SecretFilter', 'SecretRequest', 'SecretResponse', 'SecretResponseBody', 'SecretResponseMetadata', 'SecretUpdate', 'ServiceResponse', 'ServiceResponseBody', 'ServiceResponseMetadata', 'ServiceUpdate', 'ServiceFilter', 'ServiceRequest', 'ServiceResponseResources', 'ServerActivationRequest', 'ServerSettingsResponse', 'ServerSettingsResponseResources', 'ServerSettingsResponseBody', 'ServerSettingsResponseMetadata', 'ServerSettingsUpdate', 'ServiceAccountFilter', 'ServiceAccountResponseBody', 'ServiceAccountResponseMetadata', 'ServiceAccountUpdate', 'ServiceAccountRequest', 'ServiceAccountResponse', 'ServiceConnectorRequest', 'ServiceConnectorUpdate', 'ServiceConnectorFilter', 'ServiceConnectorResponse', 'ServiceConnectorResponseBody', 'ServiceConnectorResponseMetadata', 'StackRequest', 'StackUpdate', 'StackFilter', 'StackResponse', 'StackResponseBody', 'StackResponseMetadata', 'StepRunRequest', 'StepRunUpdate', 'StepRunFilter', 'StepRunResponse', 'StepRunResponseBody', 'StepRunResponseMetadata', 'StepRunResponseResources', 'TagFilter', 'TagResourceResponse', 'TagResourceResponseBody', 'TagResourceRequest', 'TagResponse', 'TagResponseBody', 'TagRequest', 'TagUpdate', 'TriggerResponse', 'TriggerRequest', 'TriggerFilter', 'TriggerUpdate', 'TriggerResponseBody', 'TriggerResponseMetadata', 'TriggerResponseResources', 'TriggerExecutionRequest', 'TriggerExecutionFilter', 'TriggerExecutionResponse', 'TriggerExecutionResponseBody', 'TriggerExecutionResponseMetadata', 'TriggerExecutionResponseResources', 'EventSourceResponse', 'EventSourceRequest', 'EventSourceFilter', 'EventSourceUpdate', 'EventSourceResponseBody', 'EventSourceResponseMetadata', 'EventSourceResponseResources', 'UserRequest', 'UserUpdate', 'UserFilter', 'UserResponse', 'UserResponseBody', 'UserResponseMetadata', 'WorkspaceRequest', 'WorkspaceUpdate', 'WorkspaceFilter', 'WorkspaceResponse', 'WorkspaceResponseBody', 'WorkspaceResponseMetadata', 'AuthenticationMethodModel', 'DeployedStack', 'ServiceConnectorResourcesModel', 'ServiceConnectorTypeModel', 'ServiceConnectorTypedResourcesModel', 'ServiceConnectorRequirements', 'ResourceTypeModel', 'UserAuthModel', 'ExternalUserModel', 'BuildItem', 'LoadedVisualization', 'ServerLoadInfo', 'ServerModel', 'ServerDatabaseType', 'ServerDeploymentType', 'StackDeploymentConfig', 'StackDeploymentInfo', 'OAuthDeviceAuthorizationRequest', 'OAuthDeviceAuthorizationResponse', 'OAuthDeviceTokenRequest', 'OAuthDeviceUserAgentHeader', 'OAuthDeviceVerificationRequest', 'OAuthRedirectResponse', 'OAuthTokenResponse', 'ComponentInfo', 'ServiceConnectorInfo', 'ServiceConnectorResourcesInfo', 'ResourcesInfo', 'RunMetadataEntry', 'RunMetadataResource']
module-attribute
Classes
APIKey
Bases: BaseModel
Encoded model for API keys.
Functions
decode_api_key(encoded_key: str) -> APIKey
classmethod
Decodes an API key from a base64 string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoded_key
|
str
|
The encoded API key. |
required |
Returns:
Type | Description |
---|---|
APIKey
|
The decoded API key. |
Raises:
Type | Description |
---|---|
ValueError
|
If the key is not valid. |
Source code in src/zenml/models/v2/core/api_key.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
encode() -> str
Encodes the API key in a base64 string that includes the key ID and prefix.
Returns:
Type | Description |
---|---|
str
|
The encoded API key. |
Source code in src/zenml/models/v2/core/api_key.py
72 73 74 75 76 77 78 79 |
|
APIKeyFilter
Bases: BaseFilter
Filter model for API keys.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to apply the service account scope as an additional filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/api_key.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
set_service_account(service_account_id: UUID) -> None
Set the service account by which to scope this query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_account_id
|
UUID
|
The service account ID. |
required |
Source code in src/zenml/models/v2/core/api_key.py
377 378 379 380 381 382 383 |
|
APIKeyInternalResponse
Bases: APIKeyResponse
Response model for API keys used internally.
Functions
verify_key(key: str) -> bool
Verifies a given key against the stored (hashed) key(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
Input key to be verified. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the keys match. |
Source code in src/zenml/models/v2/core/api_key.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
|
APIKeyInternalUpdate
APIKeyRequest
APIKeyResponse
Bases: BaseIdentifiedResponse[APIKeyResponseBody, APIKeyResponseMetadata, APIKeyResponseResources]
Response model for API keys.
Attributes
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
key: Optional[str]
property
The key
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
last_rotated: Optional[datetime]
property
The last_rotated
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
retain_period_minutes: int
property
The retain_period_minutes
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
service_account: ServiceAccountResponse
property
The service_account
property.
Returns:
Type | Description |
---|---|
ServiceAccountResponse
|
the value of the property. |
Functions
get_hydrated_version() -> APIKeyResponse
Get the hydrated version of this API key.
Returns:
Type | Description |
---|---|
APIKeyResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/api_key.py
198 199 200 201 202 203 204 205 206 207 208 209 |
|
set_key(key: str) -> None
Sets the API key and encodes it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The API key value to be set. |
required |
Source code in src/zenml/models/v2/core/api_key.py
212 213 214 215 216 217 218 |
|
APIKeyResponseBody
APIKeyResponseMetadata
APIKeyRotateRequest
Bases: BaseModel
Request model for API key rotation.
APIKeyUpdate
ActionFilter
ActionFlavorResponse
Bases: BasePluginFlavorResponse[ActionFlavorResponseBody, ActionFlavorResponseMetadata, ActionFlavorResponseResources]
Response model for Action Flavors.
Attributes
config_schema: Dict[str, Any]
property
The source_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
ActionFlavorResponseBody
ActionFlavorResponseMetadata
ActionFlavorResponseResources
ActionRequest
ActionResponse
Bases: WorkspaceScopedResponse[ActionResponseBody, ActionResponseMetadata, ActionResponseResources]
Response model for actions.
Attributes
auth_window: int
property
The auth_window
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
flavor: str
property
The flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
plugin_subtype: PluginSubType
property
service_account: UserResponse
property
Functions
get_hydrated_version() -> ActionResponse
Get the hydrated version of this action.
Returns:
Type | Description |
---|---|
ActionResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/action.py
184 185 186 187 188 189 190 191 192 |
|
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration
property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/action.py
240 241 242 243 244 245 246 |
|
ActionResponseBody
ActionResponseMetadata
ActionResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the action entity.
ActionUpdate
Bases: BaseUpdate
Update model for actions.
Functions
from_response(response: ActionResponse) -> ActionUpdate
classmethod
Create an update model from a response model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
ActionResponse
|
The response model to create the update model from. |
required |
Returns:
Type | Description |
---|---|
ActionUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/action.py
116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
ArtifactFilter
Bases: TaggableFilter
Model to enable advanced filtering of artifacts.
Functions
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Artifacts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/artifact.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
ArtifactRequest
ArtifactResponse
Bases: BaseIdentifiedResponse[ArtifactResponseBody, ArtifactResponseMetadata, ArtifactResponseResources]
Artifact response model.
Attributes
has_custom_name: bool
property
The has_custom_name
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
versions: Dict[str, ArtifactVersionResponse]
property
Get a list of all versions of this artifact.
Returns:
Type | Description |
---|---|
Dict[str, ArtifactVersionResponse]
|
A list of all versions of this artifact. |
Functions
get_hydrated_version() -> ArtifactResponse
Get the hydrated version of this artifact.
Returns:
Type | Description |
---|---|
ArtifactResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact.py
117 118 119 120 121 122 123 124 125 |
|
ArtifactResponseBody
ArtifactResponseMetadata
ArtifactUpdate
Bases: BaseModel
Artifact update model.
ArtifactVersionFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of artifact versions.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/artifact_version.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
|
ArtifactVersionRequest
Bases: WorkspaceScopedRequest
Request model for artifact versions.
Functions
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
ArtifactVersionResponse
Bases: WorkspaceScopedResponse[ArtifactVersionResponseBody, ArtifactVersionResponseMetadata, ArtifactVersionResponseResources]
Response model for artifact versions.
Attributes
artifact: ArtifactResponse
property
artifact_store_id: Optional[UUID]
property
The artifact_store_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
data_type: Source
property
materializer: Source
property
name: str
property
The name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
producer_pipeline_run_id: Optional[UUID]
property
The producer_pipeline_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
producer_step_run_id: Optional[UUID]
property
The producer_step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
run: PipelineRunResponse
property
Get the pipeline run that produced this artifact.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The pipeline run that produced this artifact. |
run_metadata: Dict[str, MetadataType]
property
save_type: ArtifactSaveType
property
step: StepRunResponse
property
Get the step that produced this artifact.
Returns:
Type | Description |
---|---|
StepRunResponse
|
The step that produced this artifact. |
tags: List[TagResponse]
property
type: ArtifactType
property
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
version: Union[str, int]
property
The version
property.
Returns:
Type | Description |
---|---|
Union[str, int]
|
the value of the property. |
visualizations: Optional[List[ArtifactVisualizationResponse]]
property
The visualizations
property.
Returns:
Type | Description |
---|---|
Optional[List[ArtifactVisualizationResponse]]
|
the value of the property. |
Functions
download_files(path: str, overwrite: bool = False) -> None
Downloads data for an artifact with no materializing.
Any artifacts will be saved as a zip file to the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to save the binary data to. |
required |
overwrite
|
bool
|
Whether to overwrite the file if it already exists. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
If the path does not end with '.zip'. |
Source code in src/zenml/models/v2/core/artifact_version.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
get_hydrated_version() -> ArtifactVersionResponse
Get the hydrated version of this artifact version.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_version.py
261 262 263 264 265 266 267 268 269 |
|
load() -> Any
Materializes (loads) the data stored in this artifact.
Returns:
Type | Description |
---|---|
Any
|
The materialized data. |
Source code in src/zenml/models/v2/core/artifact_version.py
423 424 425 426 427 428 429 430 431 |
|
visualize(title: Optional[str] = None) -> None
Visualize the artifact in notebook environments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
Optional[str]
|
Optional title to show before the visualizations. |
None
|
Source code in src/zenml/models/v2/core/artifact_version.py
459 460 461 462 463 464 465 466 467 |
|
ArtifactVersionResponseBody
Bases: WorkspaceScopedResponseBody
Response body for artifact versions.
Functions
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
ArtifactVersionResponseMetadata
ArtifactVersionUpdate
Bases: BaseModel
Artifact version update model.
ArtifactVisualizationRequest
ArtifactVisualizationResponse
Bases: BaseIdentifiedResponse[ArtifactVisualizationResponseBody, ArtifactVisualizationResponseMetadata, ArtifactVisualizationResponseResources]
Response model for artifact visualizations.
Attributes
artifact_version_id: UUID
property
The artifact_version_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
type: VisualizationType
property
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
Functions
get_hydrated_version() -> ArtifactVisualizationResponse
Get the hydrated version of this artifact visualization.
Returns:
Type | Description |
---|---|
ArtifactVisualizationResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_visualization.py
70 71 72 73 74 75 76 77 78 |
|
ArtifactVisualizationResponseBody
ArtifactVisualizationResponseMetadata
AuthenticationMethodModel(config_class: Optional[Type[BaseModel]] = None, **values: Any)
Bases: BaseModel
Authentication method specification.
Describes the schema for the configuration and secrets that need to be provided to configure an authentication method.
Initialize the authentication method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_class
|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
None
|
**values
|
Any
|
The data to initialize the authentication method with. |
{}
|
Source code in src/zenml/models/v2/misc/service_connector_type.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
Attributes
config_class: Optional[Type[BaseModel]]
property
Get the configuration class for the authentication method.
Returns:
Type | Description |
---|---|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
Functions
supports_temporary_credentials() -> bool
Check if the authentication method supports temporary credentials.
Returns:
Type | Description |
---|---|
bool
|
True if the authentication method supports temporary credentials, |
bool
|
False otherwise. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
157 158 159 160 161 162 163 164 165 166 167 168 |
|
validate_expiration(expiration_seconds: Optional[int]) -> Optional[int]
Validate the expiration time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expiration_seconds
|
Optional[int]
|
The expiration time in seconds. If None, the default expiration time is used, if applicable. |
required |
Returns:
Type | Description |
---|---|
Optional[int]
|
The expiration time in seconds or None if not applicable. |
Raises:
Type | Description |
---|---|
ValueError
|
If the expiration time is not valid. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
BaseDatedResponseBody
Bases: BaseResponseBody
Base body model for entities that track a creation and update timestamp.
Used as a base class for all body models associated with responses. Features a creation and update timestamp.
BaseFilter
Bases: BaseModel
Class to unify all filter, paginate and sort request parameters.
This Model allows fine-grained filtering, sorting and pagination of resources.
Usage example for subclasses of this class:
ResourceListModel(
name="contains:default",
workspace="default"
count_steps="gte:5"
sort_by="created",
page=2,
size=20
)
Attributes
list_of_filters: List[Filter]
property
Converts the class variables into a list of usable Filter Models.
Returns:
Type | Description |
---|---|
List[Filter]
|
A list of Filter models. |
offset: int
property
Returns the offset needed for the query on the data persistence layer.
Returns:
Type | Description |
---|---|
int
|
The offset for the query. |
sorting_params: Tuple[str, SorterOps]
property
Converts the class variables into a list of usable Filter Models.
Returns:
Type | Description |
---|---|
Tuple[str, SorterOps]
|
A tuple of the column to sort by and the sorting operand. |
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/filter.py
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/filter.py
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
|
configure_rbac(authenticated_user_id: UUID, **column_allowed_ids: Optional[Set[UUID]]) -> None
Configure RBAC allowed column values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
authenticated_user_id
|
UUID
|
ID of the authenticated user. All entities owned by this user will be included. |
required |
column_allowed_ids
|
Optional[Set[UUID]]
|
Set of IDs per column to limit the query to.
If given, the remaining filters will be applied to entities
within this set only. If |
{}
|
Source code in src/zenml/models/v2/base/filter.py
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
filter_ops(data: Dict[str, Any]) -> Dict[str, Any]
classmethod
Parse incoming filters to ensure all filters are legal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The values of the class. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The values of the class. |
Source code in src/zenml/models/v2/base/filter.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
|
generate_custom_query_conditions_for_column(value: Any, table: Type[SQLModel], column: str, json_encode_value: bool = False) -> ColumnElement[bool]
staticmethod
Generate custom filter conditions for a column of a table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The filter value. |
required |
table
|
Type[SQLModel]
|
The table which contains the column. |
required |
column
|
str
|
The column name. |
required |
json_encode_value
|
bool
|
Whether to json encode the value. |
False
|
Returns:
Type | Description |
---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
|
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If a valid logical operator is not supplied. |
Source code in src/zenml/models/v2/base/filter.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
|
generate_name_or_id_query_conditions(value: Union[UUID, str], table: Type[NamedSchema], additional_columns: Optional[List[str]] = None) -> ColumnElement[bool]
Generate filter conditions for name or id of a table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Union[UUID, str]
|
The filter value. |
required |
table
|
Type[NamedSchema]
|
The table to filter. |
required |
additional_columns
|
Optional[List[str]]
|
Additional table columns that should also filtered for the given value as part of the or condition. |
None
|
Returns:
Type | Description |
---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 |
|
generate_rbac_filter(table: Type[AnySchema]) -> Optional[ColumnElement[bool]]
Generates an optional RBAC filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
Optional[ColumnElement[bool]]
|
The RBAC filter. |
Source code in src/zenml/models/v2/base/filter.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
This can be overridden by subclasses to define custom filters that are not based on the columns of the underlying table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/filter.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
|
validate_sort_by(value: Any) -> Any
classmethod
Validate that the sort_column is a valid column with a valid operand.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The sort_by field value. |
required |
Returns:
Type | Description |
---|---|
Any
|
The validated sort_by field value. |
Raises:
Type | Description |
---|---|
ValidationError
|
If the sort_by field is not a string. |
ValueError
|
If the resource can't be sorted by this field. |
Source code in src/zenml/models/v2/base/filter.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
|
BaseIdentifiedResponse
Bases: BaseResponse[AnyDatedBody, AnyMetadata, AnyResources]
, Generic[AnyDatedBody, AnyMetadata, AnyResources]
Base domain model for resources with DB representation.
Attributes
created: datetime
property
The created
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
Functions
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for base response models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/base.py
457 458 459 460 461 462 463 464 465 |
|
get_body() -> AnyDatedBody
Fetch the body of the entity.
Returns:
Type | Description |
---|---|
AnyDatedBody
|
The body field of the response. |
Raises:
Type | Description |
---|---|
IllegalOperationError
|
If the user lacks permission to access the entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
|
get_hydrated_version() -> BaseIdentifiedResponse[AnyDatedBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
Type | Description |
---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
407 408 409 410 411 412 413 414 415 416 417 418 |
|
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
Type | Description |
---|---|
AnyMetadata
|
The metadata field of the response. |
Raises:
Type | Description |
---|---|
IllegalOperationError
|
If the user lacks permission to access this entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
BasePluginFlavorResponse
Bases: BaseResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
, Generic[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Base response for all Plugin Flavors.
Functions
get_hydrated_version() -> BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Abstract method to fetch the hydrated version of the model.
Returns:
Type | Description |
---|---|
BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
|
Hydrated version of the PluginFlavorResponse |
Source code in src/zenml/models/v2/base/base_plugin_flavor.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
BaseRequest
BaseResponse
Bases: BaseZenModel
, Generic[AnyBody, AnyMetadata, AnyResources]
Base domain model for all responses.
Functions
get_body() -> AnyBody
Fetch the body of the entity.
Returns:
Type | Description |
---|---|
AnyBody
|
The body field of the response. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the body was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
get_hydrated_version() -> BaseResponse[AnyBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
Type | Description |
---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
226 227 228 229 230 231 232 233 234 235 236 237 |
|
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
Type | Description |
---|---|
AnyMetadata
|
The metadata field of the response. |
Source code in src/zenml/models/v2/base/base.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
get_resources() -> AnyResources
Fetch the resources related to this entity.
Returns:
Type | Description |
---|---|
AnyResources
|
The resources field of the response. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the resources field was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
hydrate() -> None
Hydrate the response.
Source code in src/zenml/models/v2/base/base.py
218 219 220 221 222 223 224 |
|
BaseResponseBody
BaseResponseMetadata
Bases: BaseZenModel
Base metadata model.
Used as a base class for all metadata models associated with responses.
BaseResponseResources
Bases: BaseZenModel
Base resources model.
Used as a base class for all resource models associated with responses.
BaseUpdate
BaseZenModel
Bases: YAMLSerializationMixin
, AnalyticsTrackedModelMixin
Base model class for all ZenML models.
This class is used as a base class for all ZenML models. It provides functionality for tracking analytics events.
BoolFilter
Bases: Filter
Filter for all Boolean fields.
Functions
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a boolean column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The boolean column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
BuildItem
Bases: BaseModel
Pipeline build item.
Attributes:
Name | Type | Description |
---|---|---|
image |
str
|
The image name or digest. |
dockerfile |
Optional[str]
|
The contents of the Dockerfile used to build the image. |
requirements |
Optional[str]
|
The pip requirements installed in the image. This is a string consisting of multiple concatenated requirements.txt files. |
settings_checksum |
Optional[str]
|
Checksum of the settings used for the build. |
contains_code |
bool
|
Whether the image contains user files. |
requires_code_download |
bool
|
Whether the image needs to download files. |
CodeReferenceRequest
CodeReferenceResponse
Bases: BaseIdentifiedResponse[CodeReferenceResponseBody, CodeReferenceResponseMetadata, CodeReferenceResponseResources]
Response model for code references.
Attributes
code_repository: CodeRepositoryResponse
property
The code_repository
property.
Returns:
Type | Description |
---|---|
CodeRepositoryResponse
|
the value of the property. |
commit: str
property
The commit
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
subdirectory: str
property
The subdirectory
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
Functions
get_hydrated_version() -> CodeReferenceResponse
Get the hydrated version of this code reference.
Returns:
Type | Description |
---|---|
CodeReferenceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_reference.py
85 86 87 88 89 90 91 92 93 |
|
CodeReferenceResponseBody
CodeReferenceResponseMetadata
CodeRepositoryFilter
CodeRepositoryRequest
CodeRepositoryResponse
Bases: WorkspaceScopedResponse[CodeRepositoryResponseBody, CodeRepositoryResponseMetadata, CodeRepositoryResponseResources]
Response model for code repositories.
Attributes
config: Dict[str, Any]
property
The config
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
source: Source
property
Functions
get_hydrated_version() -> CodeRepositoryResponse
Get the hydrated version of this code repository.
Returns:
Type | Description |
---|---|
CodeRepositoryResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_repository.py
133 134 135 136 137 138 139 140 141 |
|
CodeRepositoryResponseBody
CodeRepositoryResponseMetadata
CodeRepositoryUpdate
ComponentBase
Bases: BaseModel
Base model for components.
ComponentFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all ComponentModels.
The Component Model needs additional scoping. As such the _scope_user
field can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
Functions
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Stack components can be scoped by type to narrow the search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/component.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
|
set_scope_type(component_type: str) -> None
Set the type of component on which to perform the filtering to scope the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_type
|
str
|
The type of component to scope the query to. |
required |
Source code in src/zenml/models/v2/core/component.py
394 395 396 397 398 399 400 |
|
ComponentInfo
Bases: BaseModel
Information about each stack components when creating a full stack.
ComponentRequest
Bases: ComponentBase
, WorkspaceScopedRequest
Request model for components.
Functions
name_cant_be_a_secret_reference(name: str) -> str
classmethod
Validator to ensure that the given name is not a secret reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
The name if it is not a secret reference. |
Raises:
Type | Description |
---|---|
ValueError
|
If the name is a secret reference. |
Source code in src/zenml/models/v2/core/component.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
ComponentResponse
Bases: WorkspaceScopedResponse[ComponentResponseBody, ComponentResponseMetadata, ComponentResponseResources]
Response model for components.
Attributes
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector: Optional[ServiceConnectorResponse]
property
The connector
property.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorResponse]
|
the value of the property. |
connector_resource_id: Optional[str]
property
The connector_resource_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
flavor: FlavorResponse
property
flavor_name: str
property
The flavor_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
integration: Optional[str]
property
The integration
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, Any]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
type: StackComponentType
property
Functions
get_analytics_metadata() -> Dict[str, Any]
Add the component labels to analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/component.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
get_hydrated_version() -> ComponentResponse
Get the hydrated version of this component.
Returns:
Type | Description |
---|---|
ComponentResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/component.py
253 254 255 256 257 258 259 260 261 |
|
ComponentResponseBody
ComponentResponseMetadata
ComponentResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the component entity.
ComponentUpdate
DeployedStack
Bases: BaseModel
Information about a deployed stack.
EventSourceFilter
EventSourceFlavorResponse
Bases: BasePluginFlavorResponse[EventSourceFlavorResponseBody, EventSourceFlavorResponseMetadata, EventSourceFlavorResponseResources]
Response model for Event Source Flavors.
Attributes
filter_config_schema: Dict[str, Any]
property
The filter_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
source_config_schema: Dict[str, Any]
property
The source_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
EventSourceFlavorResponseBody
EventSourceFlavorResponseMetadata
EventSourceFlavorResponseResources
EventSourceRequest
EventSourceResponse
Bases: WorkspaceScopedResponse[EventSourceResponseBody, EventSourceResponseMetadata, EventSourceResponseResources]
Response model for event sources.
Attributes
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
flavor: str
property
The flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
is_active: bool
property
The is_active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
plugin_subtype: PluginSubType
property
Functions
get_hydrated_version() -> EventSourceResponse
Get the hydrated version of this event source.
Returns:
Type | Description |
---|---|
EventSourceResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/event_source.py
161 162 163 164 165 166 167 168 169 |
|
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration
property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/event_source.py
217 218 219 220 221 222 223 |
|
EventSourceResponseBody
EventSourceResponseMetadata
EventSourceResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the code repository entity.
EventSourceUpdate
Bases: BaseZenModel
Update model for event sources.
Functions
from_response(response: EventSourceResponse) -> EventSourceUpdate
classmethod
Create an update model from a response model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
EventSourceResponse
|
The response model to create the update model from. |
required |
Returns:
Type | Description |
---|---|
EventSourceUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/event_source.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
ExternalUserModel
Bases: BaseModel
External user model.
FlavorFilter
FlavorRequest
FlavorResponse
Bases: UserScopedResponse[FlavorResponseBody, FlavorResponseMetadata, FlavorResponseResources]
Response model for flavors.
Attributes
config_schema: Dict[str, Any]
property
The config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector_requirements: Optional[ServiceConnectorRequirements]
property
Returns the connector requirements for the flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
The connector requirements for the flavor. |
connector_resource_id_attr: Optional[str]
property
The connector_resource_id_attr
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
connector_resource_type: Optional[str]
property
The connector_resource_type
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
connector_type: Optional[str]
property
The connector_type
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
docs_url: Optional[str]
property
The docs_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
integration: Optional[str]
property
The integration
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
is_custom: bool
property
The is_custom
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
sdk_docs_url: Optional[str]
property
The sdk_docs_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
source: str
property
The source
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
type: StackComponentType
property
workspace: Optional[WorkspaceResponse]
property
The workspace
property.
Returns:
Type | Description |
---|---|
Optional[WorkspaceResponse]
|
the value of the property. |
Functions
get_hydrated_version() -> FlavorResponse
Get the hydrated version of the flavor.
Returns:
Type | Description |
---|---|
FlavorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/flavor.py
270 271 272 273 274 275 276 277 278 |
|
FlavorResponseBody
FlavorResponseMetadata
FlavorUpdate
LazyArtifactVersionResponse
Bases: ArtifactVersionResponse
Lazy artifact version response.
Used if the artifact version is accessed from the model in a pipeline context available only during pipeline compilation.
Attributes
run_metadata: Dict[str, MetadataType]
property
The metadata
property in lazy loading mode.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
getter of lazy responses for internal use. |
Functions
get_body() -> None
Protects from misuse of the lazy loader.
Raises:
Type | Description |
---|---|
RuntimeError
|
always |
Source code in src/zenml/models/v2/core/artifact_version.py
722 723 724 725 726 727 728 |
|
get_metadata() -> None
Protects from misuse of the lazy loader.
Raises:
Type | Description |
---|---|
RuntimeError
|
always |
Source code in src/zenml/models/v2/core/artifact_version.py
730 731 732 733 734 735 736 737 738 |
|
LoadedVisualization
Bases: BaseModel
Model for loaded visualizations.
LogsRequest
Bases: BaseRequest
Request model for logs.
Functions
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
text_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
LogsResponse
Bases: BaseIdentifiedResponse[LogsResponseBody, LogsResponseMetadata, LogsResponseResources]
Response model for logs.
Attributes
artifact_store_id: Union[str, UUID]
property
The artifact_store_id
property.
Returns:
Type | Description |
---|---|
Union[str, UUID]
|
the value of the property. |
pipeline_run_id: Optional[Union[str, UUID]]
property
The pipeline_run_id
property.
Returns:
Type | Description |
---|---|
Optional[Union[str, UUID]]
|
the value of the property. |
step_run_id: Optional[Union[str, UUID]]
property
The step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[Union[str, UUID]]
|
the value of the property. |
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
Functions
get_hydrated_version() -> LogsResponse
Get the hydrated version of these logs.
Returns:
Type | Description |
---|---|
LogsResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/logs.py
152 153 154 155 156 157 158 159 160 |
|
LogsResponseBody
LogsResponseMetadata
Bases: BaseResponseMetadata
Response metadata for logs.
Functions
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
ModelFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of all Workspaces.
Functions
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/model.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|
ModelRequest
ModelResponse
Bases: WorkspaceScopedResponse[ModelResponseBody, ModelResponseMetadata, ModelResponseResources]
Response model for models.
Attributes
audience: Optional[str]
property
The audience
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
ethics: Optional[str]
property
The ethics
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
license: Optional[str]
property
The license
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
limitations: Optional[str]
property
The limitations
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
save_models_to_registry: bool
property
The save_models_to_registry
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
tags: List[TagResponse]
property
trade_offs: Optional[str]
property
The trade_offs
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
use_cases: Optional[str]
property
The use_cases
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
versions: List[Model]
property
List all versions of the model.
Returns:
Type | Description |
---|---|
List[Model]
|
The list of all model version. |
Functions
get_hydrated_version() -> ModelResponse
Get the hydrated version of this model.
Returns:
Type | Description |
---|---|
ModelResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model.py
193 194 195 196 197 198 199 200 201 |
|
ModelResponseBody
ModelResponseMetadata
ModelUpdate
Bases: BaseModel
Update model for models.
ModelVersionArtifactFilter
Bases: BaseFilter
Model version pipeline run links filter model.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_artifact.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
ModelVersionArtifactRequest
ModelVersionArtifactResponse
Bases: BaseIdentifiedResponse[ModelVersionArtifactResponseBody, BaseResponseMetadata, ModelVersionArtifactResponseResources]
Response model for links between model versions and artifacts.
Attributes
artifact_version: ArtifactVersionResponse
property
The artifact_version
property.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
the value of the property. |
model_version: UUID
property
The model_version
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
ModelVersionArtifactResponseBody
ModelVersionFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Filter model for model versions.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/model_version.py
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version.py
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 |
|
set_scope_model(model_name_or_id: Union[str, UUID]) -> None
Set the model to scope this response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name_or_id
|
Union[str, UUID]
|
The model to scope this response to. |
required |
Source code in src/zenml/models/v2/core/model_version.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
|
ModelVersionPipelineRunFilter
Bases: BaseFilter
Model version pipeline run links filter model.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_pipeline_run.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|
ModelVersionPipelineRunRequest
ModelVersionPipelineRunResponse
Bases: BaseIdentifiedResponse[ModelVersionPipelineRunResponseBody, BaseResponseMetadata, ModelVersionPipelineRunResponseResources]
Response model for links between model versions and pipeline runs.
Attributes
model_version: UUID
property
The model_version
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
pipeline_run: PipelineRunResponse
property
ModelVersionPipelineRunResponseBody
ModelVersionRequest
ModelVersionResponse
Bases: WorkspaceScopedResponse[ModelVersionResponseBody, ModelVersionResponseMetadata, ModelVersionResponseResources]
Response model for model versions.
Attributes
data_artifact_ids: Dict[str, Dict[str, UUID]]
property
The data_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
data_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all data artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of data artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
deployment_artifact_ids: Dict[str, Dict[str, UUID]]
property
The deployment_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
deployment_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all deployment artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of deployment artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
model: ModelResponse
property
model_artifact_ids: Dict[str, Dict[str, UUID]]
property
The model_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
model_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all model artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of model artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
number: int
property
The number
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
pipeline_run_ids: Dict[str, UUID]
property
The pipeline_run_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, UUID]
|
the value of the property. |
pipeline_runs: Dict[str, PipelineRunResponse]
property
Get all pipeline runs linked to this version.
Returns:
Type | Description |
---|---|
Dict[str, PipelineRunResponse]
|
Dictionary of Pipeline Runs as PipelineRunResponseModel |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
stage: Optional[str]
property
The stage
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
Functions
get_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of an artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
|
get_data_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the data artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the data artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the data artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the data artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
get_deployment_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the deployment artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the deployment artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the deployment artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the deployment artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
|
get_hydrated_version() -> ModelVersionResponse
Get the hydrated version of this model version.
Returns:
Type | Description |
---|---|
ModelVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model_version.py
310 311 312 313 314 315 316 317 318 |
|
get_model_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the model artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the model artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the model artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the model artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
|
get_pipeline_run(name: str) -> PipelineRunResponse
Get pipeline run linked to this version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the pipeline run to retrieve. |
required |
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
PipelineRun as PipelineRunResponseModel |
Source code in src/zenml/models/v2/core/model_version.py
528 529 530 531 532 533 534 535 536 537 538 539 |
|
set_stage(stage: Union[str, ModelStages], force: bool = False) -> None
Sets this Model Version to a desired stage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stage
|
Union[str, ModelStages]
|
the target stage for model version. |
required |
force
|
bool
|
whether to force archiving of current model version in target stage or raise. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
if model_stage is not valid. |
Source code in src/zenml/models/v2/core/model_version.py
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
to_model_class(suppress_class_validation_warnings: bool = True) -> Model
Convert response model to Model object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suppress_class_validation_warnings
|
bool
|
internally used to suppress repeated warnings. |
True
|
Returns:
Type | Description |
---|---|
Model
|
Model object |
Source code in src/zenml/models/v2/core/model_version.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
|
ModelVersionResponseBody
ModelVersionResponseMetadata
ModelVersionResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the model version entity.
ModelVersionUpdate
Bases: BaseModel
Update model for model versions.
NumericFilter
Bases: Filter
Filter for all numeric fields.
Functions
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a numeric column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The numeric column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
OAuthDeviceAuthorizationRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceAuthorizationResponse
Bases: BaseModel
OAuth2 device authorization grant response.
OAuthDeviceFilter
OAuthDeviceInternalRequest
OAuthDeviceInternalResponse
Bases: OAuthDeviceResponse
OAuth2 device response model used internally for authentication.
Functions
verify_device_code(device_code: str) -> bool
Verifies a given device code against the stored (hashed) device code.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device_code
|
str
|
The device code to verify. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the device code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
verify_user_code(user_code: str) -> bool
Verifies a given user code against the stored (hashed) user code.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_code
|
str
|
The user code to verify. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the user code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
407 408 409 410 411 412 413 414 415 416 417 418 419 |
|
OAuthDeviceInternalUpdate
OAuthDeviceResponse
Bases: UserScopedResponse[OAuthDeviceResponseBody, OAuthDeviceResponseMetadata, OAuthDeviceResponseResources]
Response model for OAuth2 devices.
Attributes
city: Optional[str]
property
The city
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
client_id: UUID
property
The client_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
country: Optional[str]
property
The country
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
expires: Optional[datetime]
property
The expires
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
failed_auth_attempts: int
property
The failed_auth_attempts
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
hostname: Optional[str]
property
The hostname
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
ip_address: Optional[str]
property
The ip_address
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
os: Optional[str]
property
The os
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
python_version: Optional[str]
property
The python_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
region: Optional[str]
property
The region
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
status: OAuthDeviceStatus
property
trusted_device: bool
property
The trusted_device
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
Functions
get_hydrated_version() -> OAuthDeviceResponse
Get the hydrated version of this OAuth2 device.
Returns:
Type | Description |
---|---|
OAuthDeviceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/device.py
240 241 242 243 244 245 246 247 248 |
|
OAuthDeviceResponseBody
OAuthDeviceResponseMetadata
OAuthDeviceTokenRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceUpdate
Bases: BaseModel
OAuth2 device update model.
OAuthDeviceUserAgentHeader
Bases: BaseModel
OAuth2 device user agent header.
Functions
decode(header_str: str) -> OAuthDeviceUserAgentHeader
classmethod
Decode the user agent header.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
header_str
|
str
|
The user agent header string value. |
required |
Returns:
Type | Description |
---|---|
OAuthDeviceUserAgentHeader
|
The decoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
encode() -> str
Encode the user agent header.
Returns:
Type | Description |
---|---|
str
|
The encoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
85 86 87 88 89 90 91 92 93 94 95 96 |
|
OAuthDeviceVerificationRequest
Bases: BaseModel
OAuth2 device authorization verification request.
OAuthRedirectResponse
Bases: BaseModel
Redirect response.
OAuthTokenResponse
Bases: BaseModel
OAuth2 device authorization token response.
Page
Bases: BaseModel
, Generic[B]
Return Model for List Models to accommodate pagination.
Attributes
size: int
property
Return the item count of the page.
Returns:
Type | Description |
---|---|
int
|
The amount of items in the page. |
PipelineBuildBase
Bases: BaseZenModel
Base model for pipeline builds.
Attributes
requires_code_download: bool
property
Whether the build requires code download.
Returns:
Type | Description |
---|---|
bool
|
Whether the build requires code download. |
Functions
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
PipelineBuildFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all pipeline builds.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_build.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
|
PipelineBuildRequest
PipelineBuildResponse
Bases: WorkspaceScopedResponse[PipelineBuildResponseBody, PipelineBuildResponseMetadata, PipelineBuildResponseResources]
Response model for pipeline builds.
Attributes
checksum: Optional[str]
property
The checksum
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
contains_code: bool
property
The contains_code
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
images: Dict[str, BuildItem]
property
is_local: bool
property
The is_local
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
python_version: Optional[str]
property
The python_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
requires_code_download: bool
property
Whether the build requires code download.
Returns:
Type | Description |
---|---|
bool
|
Whether the build requires code download. |
stack: Optional[StackResponse]
property
stack_checksum: Optional[str]
property
The stack_checksum
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
Functions
get_hydrated_version() -> PipelineBuildResponse
Return the hydrated version of this pipeline build.
Returns:
Type | Description |
---|---|
PipelineBuildResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_build.py
241 242 243 244 245 246 247 248 249 |
|
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
309 310 311 312 313 314 315 316 317 318 319 320 321 |
|
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
|
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
to_yaml() -> Dict[str, Any]
Create a yaml representation of the pipeline build.
Create a yaml representation of the pipeline build that can be used to create a PipelineBuildBase instance.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The yaml representation of the pipeline build. |
Source code in src/zenml/models/v2/core/pipeline_build.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
PipelineBuildResponseBody
PipelineBuildResponseMetadata
PipelineDeploymentBase
Bases: BaseZenModel
Base model for pipeline deployments.
Attributes
should_prevent_build_reuse: bool
property
Whether the deployment prevents a build reuse.
Returns:
Type | Description |
---|---|
bool
|
Whether the deployment prevents a build reuse. |
PipelineDeploymentFilter
PipelineDeploymentRequest
PipelineDeploymentResponse
Bases: WorkspaceScopedResponse[PipelineDeploymentResponseBody, PipelineDeploymentResponseMetadata, PipelineDeploymentResponseResources]
Response model for pipeline deployments.
Attributes
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, str]
property
The client_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
client_version: Optional[str]
property
The client_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_path: Optional[str]
property
The code_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
pipeline_configuration: PipelineConfiguration
property
The pipeline_configuration
property.
Returns:
Type | Description |
---|---|
PipelineConfiguration
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec
property.
Returns:
Type | Description |
---|---|
Optional[PipelineSpec]
|
the value of the property. |
pipeline_version_hash: Optional[str]
property
The pipeline_version_hash
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
run_name_template: str
property
The run_name_template
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[ScheduleResponse]
|
the value of the property. |
server_version: Optional[str]
property
The server_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
stack: Optional[StackResponse]
property
step_configurations: Dict[str, Step]
property
The step_configurations
property.
Returns:
Type | Description |
---|---|
Dict[str, Step]
|
the value of the property. |
template_id: Optional[UUID]
property
The template_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
Functions
get_hydrated_version() -> PipelineDeploymentResponse
Return the hydrated version of this pipeline deployment.
Returns:
Type | Description |
---|---|
PipelineDeploymentResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_deployment.py
208 209 210 211 212 213 214 215 216 |
|
PipelineDeploymentResponseBody
PipelineDeploymentResponseMetadata
PipelineDeploymentResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline deployment entity.
PipelineFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Pipeline filter model.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/pipeline.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
|
PipelineRequest
PipelineResponse
Bases: WorkspaceScopedResponse[PipelineResponseBody, PipelineResponseMetadata, PipelineResponseResources]
Response model for pipelines.
Attributes
last_run: PipelineRunResponse
property
Returns the last run of this pipeline.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The last run of this pipeline. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no runs were found for this pipeline. |
last_successful_run: PipelineRunResponse
property
Returns the last successful run of this pipeline.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The last successful run of this pipeline. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no successful runs were found for this pipeline. |
latest_run_id: Optional[UUID]
property
The latest_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status
property.
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
the value of the property. |
num_runs: int
property
Returns the number of runs of this pipeline.
Returns:
Type | Description |
---|---|
int
|
The number of runs of this pipeline. |
runs: List[PipelineRunResponse]
property
Returns the 20 most recent runs of this pipeline in descending order.
Returns:
Type | Description |
---|---|
List[PipelineRunResponse]
|
The 20 most recent runs of this pipeline in descending order. |
tags: List[TagResponse]
property
Functions
get_hydrated_version() -> PipelineResponse
Get the hydrated version of this pipeline.
Returns:
Type | Description |
---|---|
PipelineResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline.py
146 147 148 149 150 151 152 153 154 |
|
get_runs(**kwargs: Any) -> List[PipelineRunResponse]
Get runs of this pipeline.
Can be used to fetch runs other than self.runs
and supports
fine-grained filtering and pagination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Further arguments for filtering or pagination that are
passed to |
{}
|
Returns:
Type | Description |
---|---|
List[PipelineRunResponse]
|
List of runs of this pipeline. |
Source code in src/zenml/models/v2/core/pipeline.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
PipelineResponseBody
PipelineResponseMetadata
PipelineResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline entity.
PipelineRunFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of all Workspaces.
Functions
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline_run.py
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_run.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 |
|
PipelineRunRequest
PipelineRunResponse
Bases: WorkspaceScopedResponse[PipelineRunResponseBody, PipelineRunResponseMetadata, PipelineRunResponseResources]
Response model for pipeline runs.
Attributes
artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions that are outputs of steps of this run.
Returns:
Type | Description |
---|---|
List[ArtifactVersionResponse]
|
All output artifact versions of this run (including cached ones). |
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, str]
property
The client_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
code_path: Optional[str]
property
The code_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config: PipelineConfiguration
property
deployment_id: Optional[UUID]
property
The deployment_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
is_templatable: bool
property
The is_templatable
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
model_version: Optional[ModelVersionResponse]
property
The model_version
property.
Returns:
Type | Description |
---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
model_version_id: Optional[UUID]
property
The model_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
orchestrator_environment: Dict[str, str]
property
The orchestrator_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
orchestrator_run_id: Optional[str]
property
The orchestrator_run_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
produced_artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions produced during this pipeline run.
Returns:
Type | Description |
---|---|
List[ArtifactVersionResponse]
|
A list of all artifact versions produced during this pipeline run. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[ScheduleResponse]
|
the value of the property. |
stack: Optional[StackResponse]
property
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
step_substitutions: Dict[str, Dict[str, str]]
property
The step_substitutions
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, str]]
|
the value of the property. |
steps: Dict[str, StepRunResponse]
property
tags: List[TagResponse]
property
template_id: Optional[UUID]
property
The template_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
trigger_execution: Optional[TriggerExecutionResponse]
property
The trigger_execution
property.
Returns:
Type | Description |
---|---|
Optional[TriggerExecutionResponse]
|
the value of the property. |
Functions
get_hydrated_version() -> PipelineRunResponse
Get the hydrated version of this pipeline run.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_run.py
286 287 288 289 290 291 292 293 294 |
|
refresh_run_status() -> PipelineRunResponse
Method to refresh the status of a run if it is initializing/running.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The updated pipeline. |
Raises:
Type | Description |
---|---|
ValueError
|
If the stack of the run response is None. |
Source code in src/zenml/models/v2/core/pipeline_run.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|
PipelineRunResponseBody
PipelineRunResponseMetadata
PipelineRunResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline run entity.
PipelineRunUpdate
Bases: BaseModel
Pipeline run update model.
PipelineUpdate
ResourceTypeModel
Bases: BaseModel
Resource type specification.
Describes the authentication methods and resource instantiation model for one or more resource types.
Attributes
emojified_resource_type: str
property
Get the emojified resource type.
Returns:
Type | Description |
---|---|
str
|
The emojified resource type. |
ResourcesInfo
Bases: BaseModel
Information about the resources needed for CLI and UI.
RunMetadataEntry
Bases: BaseModel
Utility class to sort/list run metadata entries.
RunMetadataRequest
Bases: WorkspaceScopedRequest
Request model for run metadata.
Functions
validate_values_keys() -> RunMetadataRequest
Validates if the keys in the metadata are properly defined.
Returns:
Type | Description |
---|---|
RunMetadataRequest
|
self |
Raises:
Type | Description |
---|---|
ValueError
|
if one of the key in the metadata contains |
Source code in src/zenml/models/v2/core/run_metadata.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
RunMetadataResource
Bases: BaseModel
Utility class to help identify resources to tag metadata to.
RunTemplateFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model for filtering of run templates.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/run_template.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
|
RunTemplateRequest
RunTemplateResponse
Bases: WorkspaceScopedResponse[RunTemplateResponseBody, RunTemplateResponseMetadata, RunTemplateResponseResources]
Response model for run templates.
Attributes
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config_schema: Optional[Dict[str, Any]]
property
The config_schema
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
config_template: Optional[Dict[str, Any]]
property
The config_template
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
latest_run_id: Optional[UUID]
property
The latest_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status
property.
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec
property.
Returns:
Type | Description |
---|---|
Optional[PipelineSpec]
|
the value of the property. |
runnable: bool
property
The runnable
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
source_deployment: Optional[PipelineDeploymentResponse]
property
The source_deployment
property.
Returns:
Type | Description |
---|---|
Optional[PipelineDeploymentResponse]
|
the value of the property. |
tags: List[TagResponse]
property
Functions
get_hydrated_version() -> RunTemplateResponse
Return the hydrated version of this run template.
Returns:
Type | Description |
---|---|
RunTemplateResponse
|
The hydrated run template. |
Source code in src/zenml/models/v2/core/run_template.py
186 187 188 189 190 191 192 193 194 195 196 |
|
RunTemplateResponseBody
RunTemplateResponseMetadata
RunTemplateResponseResources
RunTemplateUpdate
ScheduleFilter
ScheduleRequest
ScheduleResponse
Bases: WorkspaceScopedResponse[ScheduleResponseBody, ScheduleResponseMetadata, ScheduleResponseResources]
Response model for schedules.
Attributes
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
catchup: bool
property
The catchup
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
cron_expression: Optional[str]
property
The cron_expression
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
interval_second: Optional[timedelta]
property
The interval_second
property.
Returns:
Type | Description |
---|---|
Optional[timedelta]
|
the value of the property. |
orchestrator_id: Optional[UUID]
property
The orchestrator_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
pipeline_id: Optional[UUID]
property
The pipeline_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
run_once_start_time: Optional[datetime]
property
The run_once_start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
utc_end_time: Optional[str]
property
Optional ISO-formatted string of the UTC end time.
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC end time. |
utc_start_time: Optional[str]
property
Optional ISO-formatted string of the UTC start time.
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC start time. |
Functions
get_hydrated_version() -> ScheduleResponse
Get the hydrated version of this schedule.
Returns:
Type | Description |
---|---|
ScheduleResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/schedule.py
186 187 188 189 190 191 192 193 194 |
|
ScheduleResponseBody
ScheduleResponseMetadata
ScheduleUpdate
SecretFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all Secrets.
Functions
secret_matches(secret: SecretResponse) -> bool
Checks if a secret matches the filter criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secret
|
SecretResponse
|
The secret to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the secret matches the filter criteria, False otherwise. |
Source code in src/zenml/models/v2/core/secret.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
sort_secrets(secrets: List[SecretResponse]) -> List[SecretResponse]
Sorts a list of secrets according to the filter criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secrets
|
List[SecretResponse]
|
The list of secrets to sort. |
required |
Returns:
Type | Description |
---|---|
List[SecretResponse]
|
The sorted list of secrets. |
Source code in src/zenml/models/v2/core/secret.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
SecretRequest
Bases: WorkspaceScopedRequest
Request models for secrets.
Attributes
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
SecretResponse
Bases: WorkspaceScopedResponse[SecretResponseBody, SecretResponseMetadata, SecretResponseResources]
Response model for secrets.
Attributes
has_missing_values: bool
property
Returns True if the secret has missing values (i.e. None).
Values can be missing from a secret for example if the user retrieves a secret but does not have the permission to view the secret values.
Returns:
Type | Description |
---|---|
bool
|
True if the secret has any values set to None. |
scope: SecretScope
property
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
values: Dict[str, Optional[SecretStr]]
property
The values
property.
Returns:
Type | Description |
---|---|
Dict[str, Optional[SecretStr]]
|
the value of the property. |
Functions
add_secret(key: str, value: str) -> None
Adds a secret value to the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
value
|
str
|
The secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
210 211 212 213 214 215 216 217 |
|
get_hydrated_version() -> SecretResponse
Get the hydrated version of this workspace.
Returns:
Type | Description |
---|---|
SecretResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/secret.py
149 150 151 152 153 154 155 156 157 |
|
remove_secret(key: str) -> None
Removes a secret value from the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
219 220 221 222 223 224 225 |
|
remove_secrets() -> None
Removes all secret values from the secret but keep the keys.
Source code in src/zenml/models/v2/core/secret.py
227 228 229 |
|
set_secrets(values: Dict[str, str]) -> None
Sets the secret values of the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
Dict[str, str]
|
The secret values to set. |
required |
Source code in src/zenml/models/v2/core/secret.py
231 232 233 234 235 236 237 |
|
SecretResponseBody
SecretResponseMetadata
SecretUpdate
Bases: BaseUpdate
Secret update model.
Functions
get_secret_values_update() -> Dict[str, Optional[str]]
Returns a dictionary with the secret values to update.
Returns:
Type | Description |
---|---|
Dict[str, Optional[str]]
|
A dictionary with the secret values to update. |
Source code in src/zenml/models/v2/core/secret.py
98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
ServerActivationRequest
ServerDatabaseType
ServerDeploymentType
ServerLoadInfo
Bases: BaseModel
Domain model for ZenML server load information.
ServerModel
Bases: BaseModel
Domain model for ZenML servers.
Functions
is_local() -> bool
Return whether the server is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if the server is running locally, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
146 147 148 149 150 151 152 153 154 155 156 |
|
is_pro_server() -> bool
Return whether the server is a ZenML Pro server.
Returns:
Type | Description |
---|---|
bool
|
True if the server is a ZenML Pro server, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
158 159 160 161 162 163 164 |
|
ServerSettingsResponse
Bases: BaseResponse[ServerSettingsResponseBody, ServerSettingsResponseMetadata, ServerSettingsResponseResources]
Response model for server settings.
Attributes
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
display_announcements: Optional[bool]
property
The display_announcements
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
display_updates: Optional[bool]
property
The display_updates
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
enable_analytics: bool
property
The enable_analytics
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
last_user_activity: datetime
property
The last_user_activity
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
server_id: UUID
property
The server_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
server_name: str
property
The server_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
Functions
get_hydrated_version() -> ServerSettingsResponse
Get the hydrated version of the server settings.
Returns:
Type | Description |
---|---|
ServerSettingsResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/server_settings.py
110 111 112 113 114 115 116 117 118 |
|
ServerSettingsResponseBody
ServerSettingsResponseMetadata
ServerSettingsResponseResources
ServerSettingsUpdate
ServiceAccountFilter
Bases: BaseFilter
Model to enable advanced filtering of service accounts.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out user accounts from the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/service_account.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
ServiceAccountRequest
ServiceAccountResponse
Bases: BaseIdentifiedResponse[ServiceAccountResponseBody, ServiceAccountResponseMetadata, ServiceAccountResponseResources]
Response model for service accounts.
Attributes
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
Functions
get_hydrated_version() -> ServiceAccountResponse
Get the hydrated version of this service account.
Returns:
Type | Description |
---|---|
ServiceAccountResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_account.py
126 127 128 129 130 131 132 133 134 |
|
to_user_model() -> UserResponse
Converts the service account to a user model.
For now, a lot of code still relies on the active user and resource owners being a UserResponse object, which is a superset of the ServiceAccountResponse object. We need this method to convert the service account to a user.
Returns:
Type | Description |
---|---|
UserResponse
|
The user model. |
Source code in src/zenml/models/v2/core/service_account.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
ServiceAccountResponseBody
ServiceAccountResponseMetadata
ServiceAccountUpdate
ServiceConnectorFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of service connectors.
Functions
validate_labels() -> ServiceConnectorFilter
Parse the labels string into a label dictionary and vice-versa.
Returns:
Type | Description |
---|---|
ServiceConnectorFilter
|
The validated values. |
Source code in src/zenml/models/v2/core/service_connector.py
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 |
|
ServiceConnectorInfo
Bases: BaseModel
Information about the service connector when creating a full stack.
ServiceConnectorRequest
Bases: WorkspaceScopedRequest
Request model for service connectors.
Attributes
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector type. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
Functions
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
ServiceConnectorRequirements
Bases: BaseModel
Service connector requirements.
Describes requirements that a service connector consumer has for a service connector instance that it needs in order to access a resource.
Attributes:
Name | Type | Description |
---|---|---|
connector_type |
Optional[str]
|
The type of service connector that is required. If omitted, any service connector type can be used. |
resource_type |
str
|
The type of resource that the service connector instance must be able to access. |
resource_id_attr |
Optional[str]
|
The name of an attribute in the stack component configuration that contains the resource ID of the resource that the service connector instance must be able to access. |
Functions
is_satisfied_by(connector: Union[ServiceConnectorResponse, ServiceConnectorRequest], component: Union[ComponentResponse, ComponentBase]) -> Tuple[bool, str]
Check if the requirements are satisfied by a connector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector
|
Union[ServiceConnectorResponse, ServiceConnectorRequest]
|
The connector to check. |
required |
component
|
Union[ComponentResponse, ComponentBase]
|
The stack component that the connector is associated with. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the requirements are satisfied, False otherwise, and a |
str
|
message describing the reason for the failure. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
|
ServiceConnectorResourcesInfo
Bases: BaseModel
Information about the service connector resources needed for CLI and UI.
ServiceConnectorResourcesModel
Bases: BaseModel
Service connector resources list.
Lists the resource types and resource instances that a service connector can provide access to.
Attributes
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
resource_types: List[str]
property
Get the resource types.
Returns:
Type | Description |
---|---|
List[str]
|
The resource types. |
resources_dict: Dict[str, ServiceConnectorTypedResourcesModel]
property
Get the resources as a dictionary indexed by resource type.
Returns:
Type | Description |
---|---|
Dict[str, ServiceConnectorTypedResourcesModel]
|
The resources as a dictionary indexed by resource type. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
Functions
from_connector_model(connector_model: ServiceConnectorResponse, resource_type: Optional[str] = None) -> ServiceConnectorResourcesModel
classmethod
Initialize a resource model from a connector model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_model
|
ServiceConnectorResponse
|
The connector model. |
required |
resource_type
|
Optional[str]
|
The resource type to set on the resource model. If omitted, the resource type is set according to the connector model. |
None
|
Returns:
Type | Description |
---|---|
ServiceConnectorResourcesModel
|
A resource list model instance. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 |
|
get_default_resource_id() -> Optional[str]
Get the default resource ID, if included in the resource list.
The default resource ID is a resource ID supplied by the connector implementation only for resource types that do not support multiple instances.
Returns:
Type | Description |
---|---|
Optional[str]
|
The default resource ID, or None if no resource ID is set. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
|
get_emojified_resource_types(resource_type: Optional[str] = None) -> List[str]
Get the emojified resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_type
|
Optional[str]
|
The resource type to get the emojified resource type for. If omitted, the emojified resource type for all resource types is returned. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
The list of emojified resource types. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 |
|
set_error(error: str, resource_type: Optional[str] = None) -> None
Set a global error message or an error for a single resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error
|
str
|
The error message. |
required |
resource_type
|
Optional[str]
|
The resource type to set the error message for. If omitted, or if there is only one resource type involved, the error message is (also) set globally. |
None
|
Raises:
Type | Description |
---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
|
set_resource_ids(resource_type: str, resource_ids: List[str]) -> None
Set the resource IDs for a resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_type
|
str
|
The resource type to set the resource IDs for. |
required |
resource_ids
|
List[str]
|
The resource IDs to set. |
required |
Raises:
Type | Description |
---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
ServiceConnectorResponse
Bases: WorkspaceScopedResponse[ServiceConnectorResponseBody, ServiceConnectorResponseMetadata, ServiceConnectorResponseResources]
Response model for service connectors.
Attributes
auth_method: str
property
The auth_method
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector_type: Union[str, ServiceConnectorTypeModel]
property
The connector_type
property.
Returns:
Type | Description |
---|---|
Union[str, ServiceConnectorTypeModel]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector type. |
expiration_seconds: Optional[int]
property
The expiration_seconds
property.
Returns:
Type | Description |
---|---|
Optional[int]
|
the value of the property. |
expires_at: Optional[datetime]
property
The expires_at
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
expires_skew_tolerance: Optional[int]
property
The expires_skew_tolerance
property.
Returns:
Type | Description |
---|---|
Optional[int]
|
the value of the property. |
full_configuration: Dict[str, str]
property
Get the full connector configuration, including secrets.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
The full connector configuration, including secrets. |
is_multi_instance: bool
property
Checks if the connector is multi-instance.
A multi-instance connector is configured to access multiple instances of the configured resource type.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is multi-instance, False otherwise. |
is_multi_type: bool
property
Checks if the connector is multi-type.
A multi-type connector can be used to access multiple types of resources.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is multi-type, False otherwise. |
is_single_instance: bool
property
Checks if the connector is single-instance.
A single-instance connector is configured to access only a single instance of the configured resource type or does not support multiple resource instances.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is single-instance, False otherwise. |
labels: Dict[str, str]
property
The labels
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
resource_id: Optional[str]
property
The resource_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
resource_types: List[str]
property
The resource_types
property.
Returns:
Type | Description |
---|---|
List[str]
|
the value of the property. |
secret_id: Optional[UUID]
property
The secret_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
secrets: Dict[str, Optional[SecretStr]]
property
The secrets
property.
Returns:
Type | Description |
---|---|
Dict[str, Optional[SecretStr]]
|
the value of the property. |
supports_instances: bool
property
The supports_instances
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
Functions
get_analytics_metadata() -> Dict[str, Any]
Add the service connector labels to analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
|
get_hydrated_version() -> ServiceConnectorResponse
Get the hydrated version of this service connector.
Returns:
Type | Description |
---|---|
ServiceConnectorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_connector.py
517 518 519 520 521 522 523 524 525 |
|
set_connector_type(value: Union[str, ServiceConnectorTypeModel]) -> None
Auxiliary method to set the connector type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Union[str, ServiceConnectorTypeModel]
|
the new value for the connector type. |
required |
Source code in src/zenml/models/v2/core/service_connector.py
622 623 624 625 626 627 628 629 630 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
|
ServiceConnectorResponseBody
ServiceConnectorResponseMetadata
ServiceConnectorTypeModel
Bases: BaseModel
Service connector type specification.
Describes the types of resources to which the service connector can be used to gain access and the authentication methods that are supported by the service connector.
The connector type, resource types, resource IDs and authentication methods can all be used as search criteria to lookup and filter service connector instances that are compatible with the requirements of a consumer (e.g. a stack component).
Attributes
auth_method_dict: Dict[str, AuthenticationMethodModel]
property
Returns a map of authentication methods to authentication method specifications.
Returns:
Type | Description |
---|---|
Dict[str, AuthenticationMethodModel]
|
A map of authentication methods to authentication method |
Dict[str, AuthenticationMethodModel]
|
specifications. |
connector_class: Optional[Type[ServiceConnector]]
property
Get the service connector class.
Returns:
Type | Description |
---|---|
Optional[Type[ServiceConnector]]
|
The service connector class. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector types.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector types. |
resource_type_dict: Dict[str, ResourceTypeModel]
property
Returns a map of resource types to resource type specifications.
Returns:
Type | Description |
---|---|
Dict[str, ResourceTypeModel]
|
A map of resource types to resource type specifications. |
Functions
find_resource_specifications(auth_method: str, resource_type: Optional[str] = None) -> Tuple[AuthenticationMethodModel, Optional[ResourceTypeModel]]
Find the specifications for a configurable resource.
Validate the supplied connector configuration parameters against the connector specification and return the matching authentication method specification and resource specification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_method
|
str
|
The name of the authentication method. |
required |
resource_type
|
Optional[str]
|
The type of resource being configured. |
None
|
Returns:
Type | Description |
---|---|
AuthenticationMethodModel
|
The authentication method specification and resource specification |
Optional[ResourceTypeModel]
|
for the specified authentication method and resource type. |
Raises:
Type | Description |
---|---|
KeyError
|
If the authentication method is not supported by the connector for the specified resource type and ID. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
|
set_connector_class(connector_class: Type[ServiceConnector]) -> None
Set the service connector class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_class
|
Type[ServiceConnector]
|
The service connector class. |
required |
Source code in src/zenml/models/v2/misc/service_connector_type.py
321 322 323 324 325 326 327 328 329 |
|
validate_auth_methods(values: List[AuthenticationMethodModel]) -> List[AuthenticationMethodModel]
classmethod
Validate that the authentication methods are unique.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
required |
Returns:
Type | Description |
---|---|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
Raises:
Type | Description |
---|---|
ValueError
|
If two or more authentication method specifications share the same authentication method value. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
validate_resource_types(values: List[ResourceTypeModel]) -> List[ResourceTypeModel]
classmethod
Validate that the resource types are unique.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
List[ResourceTypeModel]
|
The list of resource types. |
required |
Returns:
Type | Description |
---|---|
List[ResourceTypeModel]
|
The list of resource types. |
Raises:
Type | Description |
---|---|
ValueError
|
If two or more resource type specifications list the same resource type. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
|
ServiceConnectorTypedResourcesModel
Bases: BaseModel
Service connector typed resources list.
Lists the resource instances that a service connector can provide access to.
ServiceConnectorUpdate
Bases: BaseUpdate
Model used for service connector updates.
Most fields in the update model are optional and will not be updated if omitted. However, the following fields are "special" and leaving them out will also cause the corresponding value to be removed from the service connector in the database:
- the
resource_id
field - the
expiration_seconds
field
In addition to the above exceptions, the following rules apply:
- the
configuration
andsecrets
fields together represent a full valid configuration update, not just a partial update. If either is set (i.e. not None) in the update, their values are merged together and will replace the existing configuration and secrets values. - the
secret_id
field value in the update is ignored, given that secrets are managed internally by the ZenML store. - the
labels
field is also a full labels update: if set (i.e. notNone
), all existing labels are removed and replaced by the new labels in the update.
NOTE: the attributes here override the ones in the base class, so they have a None default value.
Attributes
type: Optional[str]
property
Get the connector type.
Returns:
Type | Description |
---|---|
Optional[str]
|
The connector type. |
Functions
convert_to_request() -> ServiceConnectorRequest
Method to generate a service connector request object from self.
For certain operations, the service connector update model need to adhere to the limitations set by the request model. In order to use update models in such situations, we need to be able to convert an update model into a request model.
Returns:
Type | Description |
---|---|
ServiceConnectorRequest
|
The equivalent request model |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the model can not be converted to a request model. |
Source code in src/zenml/models/v2/core/service_connector.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
ServiceFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of services.
The Service needs additional scoping. As such the _scope_user
field
can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
Functions
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Services can be scoped by type to narrow the search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/service.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
|
set_flavor(flavor: str) -> None
Set the flavor of the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor
|
str
|
The flavor of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
436 437 438 439 440 441 442 |
|
set_type(type: str) -> None
Set the type of the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
str
|
The type of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
428 429 430 431 432 433 434 |
|
ServiceRequest
ServiceResponse
Bases: WorkspaceScopedResponse[ServiceResponseBody, ServiceResponseMetadata, ServiceResponseResources]
Response model for services.
Attributes
admin_state: Optional[ServiceState]
property
The admin_state
property.
Returns:
Type | Description |
---|---|
Optional[ServiceState]
|
the value of the property. |
config: Dict[str, Any]
property
The config
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
created: datetime
property
The created
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
endpoint: Optional[Dict[str, Any]]
property
The endpoint
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
health_check_url: Optional[str]
property
The health_check_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, str]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, str]]
|
the value of the property. |
prediction_url: Optional[str]
property
The prediction_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
service_source: Optional[str]
property
The service_source
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
service_type: ServiceType
property
state: Optional[ServiceState]
property
status: Optional[Dict[str, Any]]
property
The status
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
Functions
get_hydrated_version() -> ServiceResponse
Get the hydrated version of this artifact.
Returns:
Type | Description |
---|---|
ServiceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service.py
246 247 248 249 250 251 252 253 254 |
|
ServiceResponseBody
ServiceResponseMetadata
ServiceResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the service entity.
ServiceUpdate
Bases: BaseModel
Update model for stack components.
StackDeploymentConfig
Bases: BaseModel
Configuration about a stack deployment.
StackDeploymentInfo
Bases: BaseModel
Information about a stack deployment.
StackFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all StackModels.
The Stack Model needs additional scoping. As such the _scope_user
field
can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/stack.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|
StackRequest
Bases: BaseRequest
Request model for a stack.
Attributes
is_valid: bool
property
Check if the stack is valid.
Returns:
Type | Description |
---|---|
bool
|
True if the stack is valid, False otherwise. |
StackResponse
Bases: WorkspaceScopedResponse[StackResponseBody, StackResponseMetadata, StackResponseResources]
Response model for stacks.
Attributes
components: Dict[StackComponentType, List[ComponentResponse]]
property
The components
property.
Returns:
Type | Description |
---|---|
Dict[StackComponentType, List[ComponentResponse]]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
is_valid: bool
property
Check if the stack is valid.
Returns:
Type | Description |
---|---|
bool
|
True if the stack is valid, False otherwise. |
labels: Optional[Dict[str, Any]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
stack_spec_path: Optional[str]
property
The stack_spec_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
Functions
get_analytics_metadata() -> Dict[str, Any]
Add the stack components to the stack analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/stack.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|
get_hydrated_version() -> StackResponse
Get the hydrated version of this stack.
Returns:
Type | Description |
---|---|
StackResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/stack.py
209 210 211 212 213 214 215 216 217 |
|
to_yaml() -> Dict[str, Any]
Create yaml representation of the Stack Model.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The yaml representation of the Stack Model. |
Source code in src/zenml/models/v2/core/stack.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
StackResponseBody
StackResponseMetadata
StackUpdate
StepRunFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of step runs.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/step_run.py
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
StepRunRequest
StepRunResponse
Bases: WorkspaceScopedResponse[StepRunResponseBody, StepRunResponseMetadata, StepRunResponseResources]
Response model for step runs.
Attributes
cache_key: Optional[str]
property
The cache_key
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_hash: Optional[str]
property
The code_hash
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
config: StepConfiguration
property
deployment_id: UUID
property
The deployment_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
docstring: Optional[str]
property
The docstring
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
input: ArtifactVersionResponse
property
Returns the input artifact that was used to run this step.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
The input artifact. |
Raises:
Type | Description |
---|---|
ValueError
|
If there were zero or multiple inputs to this step. |
inputs: Dict[str, StepRunInputResponse]
property
The inputs
property.
Returns:
Type | Description |
---|---|
Dict[str, StepRunInputResponse]
|
the value of the property. |
logs: Optional[LogsResponse]
property
model_version: Optional[ModelVersionResponse]
property
The model_version
property.
Returns:
Type | Description |
---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
model_version_id: Optional[UUID]
property
The model_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
original_step_run_id: Optional[UUID]
property
The original_step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
output: ArtifactVersionResponse
property
Returns the output artifact that was written by this step.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
The output artifact. |
Raises:
Type | Description |
---|---|
ValueError
|
If there were zero or multiple step outputs. |
outputs: Dict[str, List[ArtifactVersionResponse]]
property
The outputs
property.
Returns:
Type | Description |
---|---|
Dict[str, List[ArtifactVersionResponse]]
|
the value of the property. |
parent_step_ids: List[UUID]
property
The parent_step_ids
property.
Returns:
Type | Description |
---|---|
List[UUID]
|
the value of the property. |
pipeline_run_id: UUID
property
The pipeline_run_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
source_code: Optional[str]
property
The source_code
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
spec: StepSpec
property
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
Functions
get_hydrated_version() -> StepRunResponse
Get the hydrated version of this step run.
Returns:
Type | Description |
---|---|
StepRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/step_run.py
291 292 293 294 295 296 297 298 299 |
|
StepRunResponseBody
StepRunResponseMetadata
StepRunResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the step run entity.
StepRunUpdate
Bases: BaseModel
Update model for step runs.
StrFilter
Bases: Filter
Filter for all string fields.
Functions
check_value_if_operation_oneof() -> StrFilter
Validator to check if value is a list if oneof operation is used.
Raises:
Type | Description |
---|---|
ValueError
|
If the value is not a list |
Returns:
Type | Description |
---|---|
StrFilter
|
self |
Source code in src/zenml/models/v2/base/filter.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a string column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The string column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Raises:
Type | Description |
---|---|
ValueError
|
the comparison of the column to a numeric value fails. |
Source code in src/zenml/models/v2/base/filter.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
TagFilter
TagRequest
TagResourceRequest
TagResourceResponse
Bases: BaseIdentifiedResponse[TagResourceResponseBody, BaseResponseMetadata, TagResourceResponseResources]
Response model for the links between tags and resources.
Attributes
resource_id: UUID
property
The resource_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
resource_type: TaggableResourceTypes
property
The resource_type
property.
Returns:
Type | Description |
---|---|
TaggableResourceTypes
|
the value of the property. |
tag_id: UUID
property
The tag_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
TagResourceResponseBody
TagResponse
Bases: BaseIdentifiedResponse[TagResponseBody, BaseResponseMetadata, TagResponseResources]
Response model for tags.
Attributes
color: ColorVariants
property
tagged_count: int
property
The tagged_count
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
Functions
get_hydrated_version() -> TagResponse
Get the hydrated version of this tag.
Returns:
Type | Description |
---|---|
TagResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/tag.py
89 90 91 92 93 94 95 96 97 |
|
TagResponseBody
TagUpdate
Bases: BaseModel
Update model for tags.
TaggableFilter
Bases: BaseFilter
Model to enable filtering and sorting by tags.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom tag filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
|
TriggerExecutionFilter
TriggerExecutionRequest
TriggerExecutionResponse
Bases: BaseIdentifiedResponse[TriggerExecutionResponseBody, TriggerExecutionResponseMetadata, TriggerExecutionResponseResources]
Response model for trigger executions.
Attributes
event_metadata: Dict[str, Any]
property
The event_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
trigger: TriggerResponse
property
Functions
get_hydrated_version() -> TriggerExecutionResponse
Get the hydrated version of this trigger execution.
Returns:
Type | Description |
---|---|
TriggerExecutionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger_execution.py
78 79 80 81 82 83 84 85 86 |
|
TriggerExecutionResponseBody
TriggerExecutionResponseMetadata
TriggerExecutionResponseResources
TriggerFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all triggers.
Functions
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/trigger.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
TriggerRequest
TriggerResponse
Bases: WorkspaceScopedResponse[TriggerResponseBody, TriggerResponseMetadata, TriggerResponseResources]
Response model for models.
Attributes
action: ActionResponse
property
action_flavor: str
property
The action_flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
action_subtype: str
property
The action_subtype
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
event_filter: Optional[Dict[str, Any]]
property
The event_filter
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
event_source: Optional[EventSourceResponse]
property
The event_source
property.
Returns:
Type | Description |
---|---|
Optional[EventSourceResponse]
|
the value of the property. |
event_source_flavor: Optional[str]
property
The event_source_flavor
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
event_source_subtype: Optional[str]
property
The event_source_subtype
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
executions: Page[TriggerExecutionResponse]
property
The event_source
property.
Returns:
Type | Description |
---|---|
Page[TriggerExecutionResponse]
|
the value of the property. |
is_active: bool
property
The is_active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
Functions
get_hydrated_version() -> TriggerResponse
Get the hydrated version of this trigger.
Returns:
Type | Description |
---|---|
TriggerResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger.py
223 224 225 226 227 228 229 230 231 |
|
TriggerResponseBody
TriggerResponseMetadata
TriggerResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the trigger entity.
TriggerUpdate
UUIDFilter
Bases: StrFilter
Filter for all uuid fields which are mostly treated like strings.
Functions
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a UUID column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The UUID column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
UserAuthModel
Bases: BaseZenModel
Authentication Model for the User.
This model is only used server-side. The server endpoints can use this model to authenticate the user credentials (Token, Password).
Functions
get_hashed_activation_token() -> Optional[str]
Returns the hashed activation token, if configured.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed activation token. |
Source code in src/zenml/models/v2/misc/user_auth.py
139 140 141 142 143 144 145 |
|
get_hashed_password() -> Optional[str]
Returns the hashed password, if configured.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed password. |
Source code in src/zenml/models/v2/misc/user_auth.py
131 132 133 134 135 136 137 |
|
get_password() -> Optional[str]
Get the password.
Returns:
Type | Description |
---|---|
Optional[str]
|
The password as a plain string, if it exists. |
Source code in src/zenml/models/v2/misc/user_auth.py
121 122 123 124 125 126 127 128 129 |
|
verify_activation_token(activation_token: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given activation token against the stored token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
activation_token
|
str
|
Input activation token to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the activation token is to be verified. |
None
|
Returns:
Type | Description |
---|---|
bool
|
True if the token is valid. |
Source code in src/zenml/models/v2/misc/user_auth.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
verify_password(plain_password: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given plain password against the stored password.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plain_password
|
str
|
Input password to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the password is to be verified. |
None
|
Returns:
Type | Description |
---|---|
bool
|
True if the passwords match. |
Source code in src/zenml/models/v2/misc/user_auth.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
UserFilter
Bases: BaseFilter
Model to enable advanced filtering of all Users.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out service accounts from the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/user.py
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
|
UserRequest
UserResponse
Bases: BaseIdentifiedResponse[UserResponseBody, UserResponseMetadata, UserResponseResources]
Response model for user and service accounts.
This returns the activation_token that is required for the user-invitation-flow of the frontend. The email is returned optionally as well for use by the analytics on the client-side.
Attributes
activation_token: Optional[str]
property
The activation_token
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
email: Optional[str]
property
The email
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
email_opted_in: Optional[bool]
property
The email_opted_in
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
external_user_id: Optional[UUID]
property
The external_user_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
full_name: str
property
The full_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
is_admin: bool
property
The is_admin
property.
Returns:
Type | Description |
---|---|
bool
|
Whether the user is an admin. |
is_service_account: bool
property
The is_service_account
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
user_metadata: Dict[str, Any]
property
The user_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
Functions
get_hydrated_version() -> UserResponse
Get the hydrated version of this user.
Returns:
Type | Description |
---|---|
UserResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/user.py
333 334 335 336 337 338 339 340 341 |
|
UserResponseBody
UserResponseMetadata
UserScopedFilter
Bases: BaseFilter
Model to enable advanced user-based scoping.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
|
set_scope_user(user_id: UUID) -> None
Set the user that is performing the filtering to scope the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id
|
UUID
|
The user ID to scope the response to. |
required |
Source code in src/zenml/models/v2/base/scoped.py
182 183 184 185 186 187 188 |
|
UserScopedRequest
Bases: BaseRequest
Base user-owned request model.
Used as a base class for all domain models that are "owned" by a user.
Functions
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
61 62 63 64 65 66 67 68 69 |
|
UserScopedResponse
Bases: BaseIdentifiedResponse[UserBody, UserMetadata, UserResources]
, Generic[UserBody, UserMetadata, UserResources]
Base user-owned model.
Used as a base class for all domain models that are "owned" by a user.
Attributes
user: Optional[UserResponse]
property
Functions
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
128 129 130 131 132 133 134 135 136 137 |
|
UserScopedResponseBody
UserScopedResponseMetadata
UserUpdate
Bases: UserBase
, BaseZenModel
Update model for users.
Functions
create_copy(exclude: AbstractSet[str]) -> UserUpdate
Create a copy of the current instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exclude
|
AbstractSet[str]
|
Fields to exclude from the copy. |
required |
Returns:
Type | Description |
---|---|
UserUpdate
|
A copy of the current instance. |
Source code in src/zenml/models/v2/core/user.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
user_email_updates() -> UserUpdate
Validate that the UserUpdateModel conforms to the email-opt-in-flow.
Returns:
Type | Description |
---|---|
UserUpdate
|
The validated values. |
Raises:
Type | Description |
---|---|
ValueError
|
If the email was not provided when the email_opted_in field was set to True. |
Source code in src/zenml/models/v2/core/user.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
WorkspaceFilter
WorkspaceRequest
WorkspaceResponse
Bases: BaseIdentifiedResponse[WorkspaceResponseBody, WorkspaceResponseMetadata, WorkspaceResponseResources]
Response model for workspaces.
Attributes
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
Functions
get_hydrated_version() -> WorkspaceResponse
Get the hydrated version of this workspace.
Returns:
Type | Description |
---|---|
WorkspaceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/workspace.py
101 102 103 104 105 106 107 108 109 |
|
WorkspaceResponseBody
WorkspaceResponseMetadata
WorkspaceScopedFilter
Bases: UserScopedFilter
Model to enable advanced scoping with workspace.
Functions
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
set_scope_workspace(workspace_id: UUID) -> None
Set the workspace to scope this response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace_id
|
UUID
|
The workspace to scope this response to. |
required |
Source code in src/zenml/models/v2/base/scoped.py
362 363 364 365 366 367 368 |
|
WorkspaceScopedRequest
Bases: UserScopedRequest
Base workspace-scoped request domain model.
Used as a base class for all domain models that are workspace-scoped.
Functions
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for workspace scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
82 83 84 85 86 87 88 89 90 |
|
WorkspaceScopedResponse
Bases: UserScopedResponse[WorkspaceBody, WorkspaceMetadata, WorkspaceResources]
, Generic[WorkspaceBody, WorkspaceMetadata, WorkspaceResources]
Base workspace-scoped domain model.
Used as a base class for all domain models that are workspace-scoped.
Attributes
workspace: WorkspaceResponse
property
WorkspaceScopedResponseBody
WorkspaceScopedResponseMetadata
WorkspaceScopedResponseResources
WorkspaceUpdate
Modules
v2
Modules
base
base
Base model definitions.
BaseDatedResponseBody
Bases: BaseResponseBody
Base body model for entities that track a creation and update timestamp.
Used as a base class for all body models associated with responses. Features a creation and update timestamp.
BaseIdentifiedResponse
Bases: BaseResponse[AnyDatedBody, AnyMetadata, AnyResources]
, Generic[AnyDatedBody, AnyMetadata, AnyResources]
Base domain model for resources with DB representation.
created: datetime
property
The created
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for base response models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/base.py
457 458 459 460 461 462 463 464 465 |
|
get_body() -> AnyDatedBody
Fetch the body of the entity.
Returns:
Type | Description |
---|---|
AnyDatedBody
|
The body field of the response. |
Raises:
Type | Description |
---|---|
IllegalOperationError
|
If the user lacks permission to access the entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
|
get_hydrated_version() -> BaseIdentifiedResponse[AnyDatedBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
Type | Description |
---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
407 408 409 410 411 412 413 414 415 416 417 418 |
|
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
Type | Description |
---|---|
AnyMetadata
|
The metadata field of the response. |
Raises:
Type | Description |
---|---|
IllegalOperationError
|
If the user lacks permission to access this entity represented by this response. |
Source code in src/zenml/models/v2/base/base.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
BaseRequest
BaseResponse
Bases: BaseZenModel
, Generic[AnyBody, AnyMetadata, AnyResources]
Base domain model for all responses.
get_body() -> AnyBody
Fetch the body of the entity.
Returns:
Type | Description |
---|---|
AnyBody
|
The body field of the response. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the body was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
get_hydrated_version() -> BaseResponse[AnyBody, AnyMetadata, AnyResources]
Abstract method to fetch the hydrated version of the model.
Raises:
Type | Description |
---|---|
NotImplementedError
|
in case the method is not implemented. |
Source code in src/zenml/models/v2/base/base.py
226 227 228 229 230 231 232 233 234 235 236 237 |
|
get_metadata() -> AnyMetadata
Fetch the metadata of the entity.
Returns:
Type | Description |
---|---|
AnyMetadata
|
The metadata field of the response. |
Source code in src/zenml/models/v2/base/base.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
get_resources() -> AnyResources
Fetch the resources related to this entity.
Returns:
Type | Description |
---|---|
AnyResources
|
The resources field of the response. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the resources field was not included in the response. |
Source code in src/zenml/models/v2/base/base.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
hydrate() -> None
Hydrate the response.
Source code in src/zenml/models/v2/base/base.py
218 219 220 221 222 223 224 |
|
BaseResponseBody
BaseResponseMetadata
Bases: BaseZenModel
Base metadata model.
Used as a base class for all metadata models associated with responses.
BaseResponseResources
Bases: BaseZenModel
Base resources model.
Used as a base class for all resource models associated with responses.
BaseUpdate
BaseZenModel
Bases: YAMLSerializationMixin
, AnalyticsTrackedModelMixin
Base model class for all ZenML models.
This class is used as a base class for all ZenML models. It provides functionality for tracking analytics events.
base_plugin_flavor
Plugin flavor model definitions.
BasePluginFlavorResponse
Bases: BaseResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
, Generic[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Base response for all Plugin Flavors.
get_hydrated_version() -> BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
Abstract method to fetch the hydrated version of the model.
Returns:
Type | Description |
---|---|
BasePluginFlavorResponse[AnyPluginBody, AnyPluginMetadata, AnyPluginResources]
|
Hydrated version of the PluginFlavorResponse |
Source code in src/zenml/models/v2/base/base_plugin_flavor.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
BasePluginResponseBody
BasePluginResponseMetadata
BasePluginResponseResources
filter
Base filter model definitions.
BaseFilter
Bases: BaseModel
Class to unify all filter, paginate and sort request parameters.
This Model allows fine-grained filtering, sorting and pagination of resources.
Usage example for subclasses of this class:
ResourceListModel(
name="contains:default",
workspace="default"
count_steps="gte:5"
sort_by="created",
page=2,
size=20
)
list_of_filters: List[Filter]
property
Converts the class variables into a list of usable Filter Models.
Returns:
Type | Description |
---|---|
List[Filter]
|
A list of Filter models. |
offset: int
property
Returns the offset needed for the query on the data persistence layer.
Returns:
Type | Description |
---|---|
int
|
The offset for the query. |
sorting_params: Tuple[str, SorterOps]
property
Converts the class variables into a list of usable Filter Models.
Returns:
Type | Description |
---|---|
Tuple[str, SorterOps]
|
A tuple of the column to sort by and the sorting operand. |
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/filter.py
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/filter.py
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
|
configure_rbac(authenticated_user_id: UUID, **column_allowed_ids: Optional[Set[UUID]]) -> None
Configure RBAC allowed column values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
authenticated_user_id
|
UUID
|
ID of the authenticated user. All entities owned by this user will be included. |
required |
column_allowed_ids
|
Optional[Set[UUID]]
|
Set of IDs per column to limit the query to.
If given, the remaining filters will be applied to entities
within this set only. If |
{}
|
Source code in src/zenml/models/v2/base/filter.py
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
filter_ops(data: Dict[str, Any]) -> Dict[str, Any]
classmethod
Parse incoming filters to ensure all filters are legal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The values of the class. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The values of the class. |
Source code in src/zenml/models/v2/base/filter.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
|
generate_custom_query_conditions_for_column(value: Any, table: Type[SQLModel], column: str, json_encode_value: bool = False) -> ColumnElement[bool]
staticmethod
Generate custom filter conditions for a column of a table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The filter value. |
required |
table
|
Type[SQLModel]
|
The table which contains the column. |
required |
column
|
str
|
The column name. |
required |
json_encode_value
|
bool
|
Whether to json encode the value. |
False
|
Returns:
Type | Description |
---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
|
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If a valid logical operator is not supplied. |
Source code in src/zenml/models/v2/base/filter.py
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
|
generate_name_or_id_query_conditions(value: Union[UUID, str], table: Type[NamedSchema], additional_columns: Optional[List[str]] = None) -> ColumnElement[bool]
Generate filter conditions for name or id of a table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Union[UUID, str]
|
The filter value. |
required |
table
|
Type[NamedSchema]
|
The table to filter. |
required |
additional_columns
|
Optional[List[str]]
|
Additional table columns that should also filtered for the given value as part of the or condition. |
None
|
Returns:
Type | Description |
---|---|
ColumnElement[bool]
|
The query conditions. |
Source code in src/zenml/models/v2/base/filter.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 |
|
generate_rbac_filter(table: Type[AnySchema]) -> Optional[ColumnElement[bool]]
Generates an optional RBAC filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
Optional[ColumnElement[bool]]
|
The RBAC filter. |
Source code in src/zenml/models/v2/base/filter.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
This can be overridden by subclasses to define custom filters that are not based on the columns of the underlying table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/filter.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
|
validate_sort_by(value: Any) -> Any
classmethod
Validate that the sort_column is a valid column with a valid operand.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The sort_by field value. |
required |
Returns:
Type | Description |
---|---|
Any
|
The validated sort_by field value. |
Raises:
Type | Description |
---|---|
ValidationError
|
If the sort_by field is not a string. |
ValueError
|
If the resource can't be sorted by this field. |
Source code in src/zenml/models/v2/base/filter.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
|
BoolFilter
Bases: Filter
Filter for all Boolean fields.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a boolean column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The boolean column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
DatetimeFilter
Bases: Filter
Filter for all datetime fields.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a datetime column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The datetime column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|
Filter
Bases: BaseModel
, ABC
Filter for all fields.
A Filter is a combination of a column, a value that the user uses to
filter on this column and an operation to use. The easiest example
would be user equals aria
with column=user
, value=aria
and the
operation=equals
.
All subclasses of this class will support different sets of operations. This operation set is defined in the ALLOWED_OPS class variable.
generate_query_conditions(table: Type[SQLModel]) -> ColumnElement[bool]
Generate the query conditions for the database.
This method converts the Filter class into an appropriate SQLModel query condition, to be used when filtering on the Database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[SQLModel]
|
The SQLModel table to use for the query creation |
required |
Returns:
Type | Description |
---|---|
ColumnElement[bool]
|
A list of conditions that will be combined using the |
Source code in src/zenml/models/v2/base/filter.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
generate_query_conditions_from_column(column: Any) -> Any
abstractmethod
Generate query conditions given the corresponding database column.
This method should be overridden by subclasses to define how each
supported operation in self.ALLOWED_OPS
can be used to filter the
given column by self.value
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
validate_operation(value: Any) -> Any
classmethod
Validate that the operation is a valid op for the field type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
The operation of this filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
The operation if it is valid. |
Raises:
Type | Description |
---|---|
ValueError
|
If the operation is not valid for this field type. |
Source code in src/zenml/models/v2/base/filter.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
FilterGenerator(model_class: Type[BaseModel])
Helper class to define filters for a class.
Initialize the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_class
|
Type[BaseModel]
|
The model class for which to define filters. |
required |
Source code in src/zenml/models/v2/base/filter.py
889 890 891 892 893 894 895 |
|
check_field_annotation(k: str, type_: Any) -> bool
Checks whether a model field has a certain annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The name of the field. |
required |
type_
|
Any
|
The type to check. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
if the model field within does not have an annotation. |
Returns:
Type | Description |
---|---|
bool
|
True if the annotation of the field matches the given type, False |
bool
|
otherwise. |
Source code in src/zenml/models/v2/base/filter.py
962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 |
|
define_filter(column: str, value: Any, operator: GenericFilterOps) -> Filter
Define a filter for a given column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
str
|
The column to filter on. |
required |
value
|
Any
|
The value by which to filter. |
required |
operator
|
GenericFilterOps
|
The operator to use for filtering. |
required |
Returns:
Type | Description |
---|---|
Filter
|
A Filter object. |
Source code in src/zenml/models/v2/base/filter.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 |
|
is_bool_field(k: str) -> bool
Checks if it's a bool field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is a bool field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 |
|
is_datetime_field(k: str) -> bool
Checks if it's a datetime field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is a datetime field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
992 993 994 995 996 997 998 999 1000 1001 |
|
is_int_field(k: str) -> bool
Checks if it's an int field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is an int field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 |
|
is_sort_by_field(k: str) -> bool
Checks if it's a sort by field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is a sort by field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 |
|
is_str_field(k: str) -> bool
Checks if it's a string field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is a string field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 |
|
is_uuid_field(k: str) -> bool
Checks if it's a UUID field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
str
|
The key to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the field is a UUID field, False otherwise. |
Source code in src/zenml/models/v2/base/filter.py
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 |
|
NumericFilter
Bases: Filter
Filter for all numeric fields.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a numeric column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The numeric column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
StrFilter
Bases: Filter
Filter for all string fields.
check_value_if_operation_oneof() -> StrFilter
Validator to check if value is a list if oneof operation is used.
Raises:
Type | Description |
---|---|
ValueError
|
If the value is not a list |
Returns:
Type | Description |
---|---|
StrFilter
|
self |
Source code in src/zenml/models/v2/base/filter.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a string column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The string column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Raises:
Type | Description |
---|---|
ValueError
|
the comparison of the column to a numeric value fails. |
Source code in src/zenml/models/v2/base/filter.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
UUIDFilter
Bases: StrFilter
Filter for all uuid fields which are mostly treated like strings.
generate_query_conditions_from_column(column: Any) -> Any
Generate query conditions for a UUID column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column
|
Any
|
The UUID column of an SQLModel table on which to filter. |
required |
Returns:
Type | Description |
---|---|
Any
|
A list of query conditions. |
Source code in src/zenml/models/v2/base/filter.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
page
Page model definitions.
Page
Bases: BaseModel
, Generic[B]
Return Model for List Models to accommodate pagination.
size: int
property
Return the item count of the page.
Returns:
Type | Description |
---|---|
int
|
The amount of items in the page. |
scoped
Scoped model definitions.
TaggableFilter
Bases: BaseFilter
Model to enable filtering and sorting by tags.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom tag filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
|
UserScopedFilter
Bases: BaseFilter
Model to enable advanced user-based scoping.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
|
set_scope_user(user_id: UUID) -> None
Set the user that is performing the filtering to scope the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id
|
UUID
|
The user ID to scope the response to. |
required |
Source code in src/zenml/models/v2/base/scoped.py
182 183 184 185 186 187 188 |
|
UserScopedRequest
Bases: BaseRequest
Base user-owned request model.
Used as a base class for all domain models that are "owned" by a user.
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
61 62 63 64 65 66 67 68 69 |
|
UserScopedResponse
Bases: BaseIdentifiedResponse[UserBody, UserMetadata, UserResources]
, Generic[UserBody, UserMetadata, UserResources]
Base user-owned model.
Used as a base class for all domain models that are "owned" by a user.
user: Optional[UserResponse]
property
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for user scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
128 129 130 131 132 133 134 135 136 137 |
|
UserScopedResponseBody
UserScopedResponseMetadata
UserScopedResponseResources
WorkspaceScopedFilter
Bases: UserScopedFilter
Model to enable advanced scoping with workspace.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/base/scoped.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/base/scoped.py
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/base/scoped.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
set_scope_workspace(workspace_id: UUID) -> None
Set the workspace to scope this response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace_id
|
UUID
|
The workspace to scope this response to. |
required |
Source code in src/zenml/models/v2/base/scoped.py
362 363 364 365 366 367 368 |
|
WorkspaceScopedRequest
Bases: UserScopedRequest
Base workspace-scoped request domain model.
Used as a base class for all domain models that are workspace-scoped.
get_analytics_metadata() -> Dict[str, Any]
Fetches the analytics metadata for workspace scoped models.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The analytics metadata. |
Source code in src/zenml/models/v2/base/scoped.py
82 83 84 85 86 87 88 89 90 |
|
WorkspaceScopedResponse
Bases: UserScopedResponse[WorkspaceBody, WorkspaceMetadata, WorkspaceResources]
, Generic[WorkspaceBody, WorkspaceMetadata, WorkspaceResources]
Base workspace-scoped domain model.
Used as a base class for all domain models that are workspace-scoped.
workspace: WorkspaceResponse
property
WorkspaceScopedResponseBody
WorkspaceScopedResponseMetadata
WorkspaceScopedResponseResources
core
action
Collection of all models concerning actions.
ActionFilter
ActionRequest
ActionResponse
Bases: WorkspaceScopedResponse[ActionResponseBody, ActionResponseMetadata, ActionResponseResources]
Response model for actions.
auth_window: int
property
The auth_window
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
flavor: str
property
The flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
plugin_subtype: PluginSubType
property
service_account: UserResponse
property
get_hydrated_version() -> ActionResponse
Get the hydrated version of this action.
Returns:
Type | Description |
---|---|
ActionResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/action.py
184 185 186 187 188 189 190 191 192 |
|
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration
property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/action.py
240 241 242 243 244 245 246 |
|
ActionResponseBody
ActionResponseMetadata
ActionResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the action entity.
ActionUpdate
Bases: BaseUpdate
Update model for actions.
from_response(response: ActionResponse) -> ActionUpdate
classmethod
Create an update model from a response model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
ActionResponse
|
The response model to create the update model from. |
required |
Returns:
Type | Description |
---|---|
ActionUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/action.py
116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
action_flavor
Action flavor model definitions.
ActionFlavorResponse
Bases: BasePluginFlavorResponse[ActionFlavorResponseBody, ActionFlavorResponseMetadata, ActionFlavorResponseResources]
Response model for Action Flavors.
config_schema: Dict[str, Any]
property
The source_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
ActionFlavorResponseBody
ActionFlavorResponseMetadata
ActionFlavorResponseResources
api_key
Models representing API keys.
APIKey
Bases: BaseModel
Encoded model for API keys.
decode_api_key(encoded_key: str) -> APIKey
classmethod
Decodes an API key from a base64 string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoded_key
|
str
|
The encoded API key. |
required |
Returns:
Type | Description |
---|---|
APIKey
|
The decoded API key. |
Raises:
Type | Description |
---|---|
ValueError
|
If the key is not valid. |
Source code in src/zenml/models/v2/core/api_key.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
encode() -> str
Encodes the API key in a base64 string that includes the key ID and prefix.
Returns:
Type | Description |
---|---|
str
|
The encoded API key. |
Source code in src/zenml/models/v2/core/api_key.py
72 73 74 75 76 77 78 79 |
|
APIKeyFilter
Bases: BaseFilter
Filter model for API keys.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to apply the service account scope as an additional filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/api_key.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
set_service_account(service_account_id: UUID) -> None
Set the service account by which to scope this query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service_account_id
|
UUID
|
The service account ID. |
required |
Source code in src/zenml/models/v2/core/api_key.py
377 378 379 380 381 382 383 |
|
APIKeyInternalResponse
Bases: APIKeyResponse
Response model for API keys used internally.
verify_key(key: str) -> bool
Verifies a given key against the stored (hashed) key(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
Input key to be verified. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the keys match. |
Source code in src/zenml/models/v2/core/api_key.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
|
APIKeyInternalUpdate
APIKeyRequest
APIKeyResponse
Bases: BaseIdentifiedResponse[APIKeyResponseBody, APIKeyResponseMetadata, APIKeyResponseResources]
Response model for API keys.
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
key: Optional[str]
property
The key
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
last_rotated: Optional[datetime]
property
The last_rotated
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
retain_period_minutes: int
property
The retain_period_minutes
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
service_account: ServiceAccountResponse
property
The service_account
property.
Returns:
Type | Description |
---|---|
ServiceAccountResponse
|
the value of the property. |
get_hydrated_version() -> APIKeyResponse
Get the hydrated version of this API key.
Returns:
Type | Description |
---|---|
APIKeyResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/api_key.py
198 199 200 201 202 203 204 205 206 207 208 209 |
|
set_key(key: str) -> None
Sets the API key and encodes it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The API key value to be set. |
required |
Source code in src/zenml/models/v2/core/api_key.py
212 213 214 215 216 217 218 |
|
APIKeyResponseBody
APIKeyResponseMetadata
APIKeyResponseResources
APIKeyRotateRequest
Bases: BaseModel
Request model for API key rotation.
APIKeyUpdate
artifact
Models representing artifacts.
ArtifactFilter
Bases: TaggableFilter
Model to enable advanced filtering of artifacts.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Artifacts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/artifact.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
ArtifactRequest
ArtifactResponse
Bases: BaseIdentifiedResponse[ArtifactResponseBody, ArtifactResponseMetadata, ArtifactResponseResources]
Artifact response model.
has_custom_name: bool
property
The has_custom_name
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
versions: Dict[str, ArtifactVersionResponse]
property
Get a list of all versions of this artifact.
Returns:
Type | Description |
---|---|
Dict[str, ArtifactVersionResponse]
|
A list of all versions of this artifact. |
get_hydrated_version() -> ArtifactResponse
Get the hydrated version of this artifact.
Returns:
Type | Description |
---|---|
ArtifactResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact.py
117 118 119 120 121 122 123 124 125 |
|
ArtifactResponseBody
ArtifactResponseMetadata
ArtifactResponseResources
ArtifactUpdate
Bases: BaseModel
Artifact update model.
artifact_version
Models representing artifact versions.
ArtifactVersionFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of artifact versions.
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/artifact_version.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
|
ArtifactVersionRequest
Bases: WorkspaceScopedRequest
Request model for artifact versions.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
ArtifactVersionResponse
Bases: WorkspaceScopedResponse[ArtifactVersionResponseBody, ArtifactVersionResponseMetadata, ArtifactVersionResponseResources]
Response model for artifact versions.
artifact: ArtifactResponse
property
artifact_store_id: Optional[UUID]
property
The artifact_store_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
data_type: Source
property
materializer: Source
property
name: str
property
The name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
producer_pipeline_run_id: Optional[UUID]
property
The producer_pipeline_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
producer_step_run_id: Optional[UUID]
property
The producer_step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
run: PipelineRunResponse
property
Get the pipeline run that produced this artifact.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The pipeline run that produced this artifact. |
run_metadata: Dict[str, MetadataType]
property
save_type: ArtifactSaveType
property
step: StepRunResponse
property
Get the step that produced this artifact.
Returns:
Type | Description |
---|---|
StepRunResponse
|
The step that produced this artifact. |
tags: List[TagResponse]
property
type: ArtifactType
property
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
version: Union[str, int]
property
The version
property.
Returns:
Type | Description |
---|---|
Union[str, int]
|
the value of the property. |
visualizations: Optional[List[ArtifactVisualizationResponse]]
property
The visualizations
property.
Returns:
Type | Description |
---|---|
Optional[List[ArtifactVisualizationResponse]]
|
the value of the property. |
download_files(path: str, overwrite: bool = False) -> None
Downloads data for an artifact with no materializing.
Any artifacts will be saved as a zip file to the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to save the binary data to. |
required |
overwrite
|
bool
|
Whether to overwrite the file if it already exists. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
If the path does not end with '.zip'. |
Source code in src/zenml/models/v2/core/artifact_version.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
get_hydrated_version() -> ArtifactVersionResponse
Get the hydrated version of this artifact version.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_version.py
261 262 263 264 265 266 267 268 269 |
|
load() -> Any
Materializes (loads) the data stored in this artifact.
Returns:
Type | Description |
---|---|
Any
|
The materialized data. |
Source code in src/zenml/models/v2/core/artifact_version.py
423 424 425 426 427 428 429 430 431 |
|
visualize(title: Optional[str] = None) -> None
Visualize the artifact in notebook environments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
Optional[str]
|
Optional title to show before the visualizations. |
None
|
Source code in src/zenml/models/v2/core/artifact_version.py
459 460 461 462 463 464 465 466 467 |
|
ArtifactVersionResponseBody
Bases: WorkspaceScopedResponseBody
Response body for artifact versions.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum str length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/artifact_version.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
ArtifactVersionResponseMetadata
ArtifactVersionResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the artifact version entity.
ArtifactVersionUpdate
Bases: BaseModel
Artifact version update model.
LazyArtifactVersionResponse
Bases: ArtifactVersionResponse
Lazy artifact version response.
Used if the artifact version is accessed from the model in a pipeline context available only during pipeline compilation.
run_metadata: Dict[str, MetadataType]
property
The metadata
property in lazy loading mode.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
getter of lazy responses for internal use. |
get_body() -> None
Protects from misuse of the lazy loader.
Raises:
Type | Description |
---|---|
RuntimeError
|
always |
Source code in src/zenml/models/v2/core/artifact_version.py
722 723 724 725 726 727 728 |
|
get_metadata() -> None
Protects from misuse of the lazy loader.
Raises:
Type | Description |
---|---|
RuntimeError
|
always |
Source code in src/zenml/models/v2/core/artifact_version.py
730 731 732 733 734 735 736 737 738 |
|
artifact_visualization
Models representing artifact visualizations.
ArtifactVisualizationRequest
ArtifactVisualizationResponse
Bases: BaseIdentifiedResponse[ArtifactVisualizationResponseBody, ArtifactVisualizationResponseMetadata, ArtifactVisualizationResponseResources]
Response model for artifact visualizations.
artifact_version_id: UUID
property
The artifact_version_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
type: VisualizationType
property
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
get_hydrated_version() -> ArtifactVisualizationResponse
Get the hydrated version of this artifact visualization.
Returns:
Type | Description |
---|---|
ArtifactVisualizationResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/artifact_visualization.py
70 71 72 73 74 75 76 77 78 |
|
ArtifactVisualizationResponseBody
ArtifactVisualizationResponseMetadata
ArtifactVisualizationResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the artifact visualization.
code_reference
Models representing code references.
CodeReferenceRequest
CodeReferenceResponse
Bases: BaseIdentifiedResponse[CodeReferenceResponseBody, CodeReferenceResponseMetadata, CodeReferenceResponseResources]
Response model for code references.
code_repository: CodeRepositoryResponse
property
The code_repository
property.
Returns:
Type | Description |
---|---|
CodeRepositoryResponse
|
the value of the property. |
commit: str
property
The commit
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
subdirectory: str
property
The subdirectory
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
get_hydrated_version() -> CodeReferenceResponse
Get the hydrated version of this code reference.
Returns:
Type | Description |
---|---|
CodeReferenceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_reference.py
85 86 87 88 89 90 91 92 93 |
|
CodeReferenceResponseBody
CodeReferenceResponseMetadata
CodeReferenceResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the code reference entity.
code_repository
Models representing code repositories.
CodeRepositoryFilter
CodeRepositoryRequest
CodeRepositoryResponse
Bases: WorkspaceScopedResponse[CodeRepositoryResponseBody, CodeRepositoryResponseMetadata, CodeRepositoryResponseResources]
Response model for code repositories.
config: Dict[str, Any]
property
The config
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
source: Source
property
get_hydrated_version() -> CodeRepositoryResponse
Get the hydrated version of this code repository.
Returns:
Type | Description |
---|---|
CodeRepositoryResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/code_repository.py
133 134 135 136 137 138 139 140 141 |
|
CodeRepositoryResponseBody
CodeRepositoryResponseMetadata
CodeRepositoryResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the code repository entity.
CodeRepositoryUpdate
component
Models representing components.
ComponentBase
Bases: BaseModel
Base model for components.
ComponentFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all ComponentModels.
The Component Model needs additional scoping. As such the _scope_user
field can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Stack components can be scoped by type to narrow the search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/component.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
|
set_scope_type(component_type: str) -> None
Set the type of component on which to perform the filtering to scope the response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_type
|
str
|
The type of component to scope the query to. |
required |
Source code in src/zenml/models/v2/core/component.py
394 395 396 397 398 399 400 |
|
ComponentRequest
Bases: ComponentBase
, WorkspaceScopedRequest
Request model for components.
name_cant_be_a_secret_reference(name: str) -> str
classmethod
Validator to ensure that the given name is not a secret reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
The name if it is not a secret reference. |
Raises:
Type | Description |
---|---|
ValueError
|
If the name is a secret reference. |
Source code in src/zenml/models/v2/core/component.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
ComponentResponse
Bases: WorkspaceScopedResponse[ComponentResponseBody, ComponentResponseMetadata, ComponentResponseResources]
Response model for components.
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector: Optional[ServiceConnectorResponse]
property
The connector
property.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorResponse]
|
the value of the property. |
connector_resource_id: Optional[str]
property
The connector_resource_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
flavor: FlavorResponse
property
flavor_name: str
property
The flavor_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
integration: Optional[str]
property
The integration
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, Any]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
type: StackComponentType
property
get_analytics_metadata() -> Dict[str, Any]
Add the component labels to analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/component.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
get_hydrated_version() -> ComponentResponse
Get the hydrated version of this component.
Returns:
Type | Description |
---|---|
ComponentResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/component.py
253 254 255 256 257 258 259 260 261 |
|
ComponentResponseBody
ComponentResponseMetadata
ComponentResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the component entity.
ComponentUpdate
InternalComponentRequest
device
Models representing devices.
OAuthDeviceFilter
OAuthDeviceInternalRequest
OAuthDeviceInternalResponse
Bases: OAuthDeviceResponse
OAuth2 device response model used internally for authentication.
verify_device_code(device_code: str) -> bool
Verifies a given device code against the stored (hashed) device code.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device_code
|
str
|
The device code to verify. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the device code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
verify_user_code(user_code: str) -> bool
Verifies a given user code against the stored (hashed) user code.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_code
|
str
|
The user code to verify. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the user code is valid, False otherwise. |
Source code in src/zenml/models/v2/core/device.py
407 408 409 410 411 412 413 414 415 416 417 418 419 |
|
OAuthDeviceInternalUpdate
OAuthDeviceResponse
Bases: UserScopedResponse[OAuthDeviceResponseBody, OAuthDeviceResponseMetadata, OAuthDeviceResponseResources]
Response model for OAuth2 devices.
city: Optional[str]
property
The city
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
client_id: UUID
property
The client_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
country: Optional[str]
property
The country
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
expires: Optional[datetime]
property
The expires
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
failed_auth_attempts: int
property
The failed_auth_attempts
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
hostname: Optional[str]
property
The hostname
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
ip_address: Optional[str]
property
The ip_address
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
last_login: Optional[datetime]
property
The last_login
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
os: Optional[str]
property
The os
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
python_version: Optional[str]
property
The python_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
region: Optional[str]
property
The region
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
status: OAuthDeviceStatus
property
trusted_device: bool
property
The trusted_device
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
get_hydrated_version() -> OAuthDeviceResponse
Get the hydrated version of this OAuth2 device.
Returns:
Type | Description |
---|---|
OAuthDeviceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/device.py
240 241 242 243 244 245 246 247 248 |
|
OAuthDeviceResponseBody
OAuthDeviceResponseMetadata
OAuthDeviceResponseResources
Bases: UserScopedResponseResources
Class for all resource models associated with the OAuthDevice entity.
OAuthDeviceUpdate
Bases: BaseModel
OAuth2 device update model.
event_source
Collection of all models concerning event configurations.
EventSourceFilter
EventSourceRequest
EventSourceResponse
Bases: WorkspaceScopedResponse[EventSourceResponseBody, EventSourceResponseMetadata, EventSourceResponseResources]
Response model for event sources.
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
flavor: str
property
The flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
is_active: bool
property
The is_active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
plugin_subtype: PluginSubType
property
get_hydrated_version() -> EventSourceResponse
Get the hydrated version of this event source.
Returns:
Type | Description |
---|---|
EventSourceResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/event_source.py
161 162 163 164 165 166 167 168 169 |
|
set_configuration(configuration: Dict[str, Any]) -> None
Set the configuration
property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configuration
|
Dict[str, Any]
|
The value to set. |
required |
Source code in src/zenml/models/v2/core/event_source.py
217 218 219 220 221 222 223 |
|
EventSourceResponseBody
EventSourceResponseMetadata
EventSourceResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the code repository entity.
EventSourceUpdate
Bases: BaseZenModel
Update model for event sources.
from_response(response: EventSourceResponse) -> EventSourceUpdate
classmethod
Create an update model from a response model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
EventSourceResponse
|
The response model to create the update model from. |
required |
Returns:
Type | Description |
---|---|
EventSourceUpdate
|
The update model. |
Source code in src/zenml/models/v2/core/event_source.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
event_source_flavor
Models representing event source flavors..
EventSourceFlavorResponse
Bases: BasePluginFlavorResponse[EventSourceFlavorResponseBody, EventSourceFlavorResponseMetadata, EventSourceFlavorResponseResources]
Response model for Event Source Flavors.
filter_config_schema: Dict[str, Any]
property
The filter_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
source_config_schema: Dict[str, Any]
property
The source_config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
EventSourceFlavorResponseBody
EventSourceFlavorResponseMetadata
EventSourceFlavorResponseResources
flavor
Models representing flavors.
FlavorFilter
FlavorRequest
FlavorResponse
Bases: UserScopedResponse[FlavorResponseBody, FlavorResponseMetadata, FlavorResponseResources]
Response model for flavors.
config_schema: Dict[str, Any]
property
The config_schema
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector_requirements: Optional[ServiceConnectorRequirements]
property
Returns the connector requirements for the flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
The connector requirements for the flavor. |
connector_resource_id_attr: Optional[str]
property
The connector_resource_id_attr
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
connector_resource_type: Optional[str]
property
The connector_resource_type
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
connector_type: Optional[str]
property
The connector_type
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
docs_url: Optional[str]
property
The docs_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
integration: Optional[str]
property
The integration
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
is_custom: bool
property
The is_custom
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
sdk_docs_url: Optional[str]
property
The sdk_docs_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
source: str
property
The source
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
type: StackComponentType
property
workspace: Optional[WorkspaceResponse]
property
The workspace
property.
Returns:
Type | Description |
---|---|
Optional[WorkspaceResponse]
|
the value of the property. |
get_hydrated_version() -> FlavorResponse
Get the hydrated version of the flavor.
Returns:
Type | Description |
---|---|
FlavorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/flavor.py
270 271 272 273 274 275 276 277 278 |
|
FlavorResponseBody
FlavorResponseMetadata
FlavorResponseResources
FlavorUpdate
InternalFlavorRequest
logs
Models representing logs.
LogsRequest
Bases: BaseRequest
Request model for logs.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
text_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
LogsResponse
Bases: BaseIdentifiedResponse[LogsResponseBody, LogsResponseMetadata, LogsResponseResources]
Response model for logs.
artifact_store_id: Union[str, UUID]
property
The artifact_store_id
property.
Returns:
Type | Description |
---|---|
Union[str, UUID]
|
the value of the property. |
pipeline_run_id: Optional[Union[str, UUID]]
property
The pipeline_run_id
property.
Returns:
Type | Description |
---|---|
Optional[Union[str, UUID]]
|
the value of the property. |
step_run_id: Optional[Union[str, UUID]]
property
The step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[Union[str, UUID]]
|
the value of the property. |
uri: str
property
The uri
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
get_hydrated_version() -> LogsResponse
Get the hydrated version of these logs.
Returns:
Type | Description |
---|---|
LogsResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/logs.py
152 153 154 155 156 157 158 159 160 |
|
LogsResponseBody
LogsResponseMetadata
Bases: BaseResponseMetadata
Response metadata for logs.
str_field_max_length_check(value: Any) -> Any
classmethod
Checks if the length of the value exceeds the maximum text length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value set in the field |
required |
Returns:
Type | Description |
---|---|
Any
|
the value itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if the length of the field is longer than the maximum threshold. |
Source code in src/zenml/models/v2/core/logs.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
LogsResponseResources
model
Models representing models.
ModelFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of all Workspaces.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query for Models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/model.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|
ModelRequest
ModelResponse
Bases: WorkspaceScopedResponse[ModelResponseBody, ModelResponseMetadata, ModelResponseResources]
Response model for models.
audience: Optional[str]
property
The audience
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
ethics: Optional[str]
property
The ethics
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
latest_version_id: Optional[UUID]
property
The latest_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_version_name: Optional[str]
property
The latest_version_name
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
license: Optional[str]
property
The license
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
limitations: Optional[str]
property
The limitations
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
save_models_to_registry: bool
property
The save_models_to_registry
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
tags: List[TagResponse]
property
trade_offs: Optional[str]
property
The trade_offs
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
use_cases: Optional[str]
property
The use_cases
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
versions: List[Model]
property
List all versions of the model.
Returns:
Type | Description |
---|---|
List[Model]
|
The list of all model version. |
get_hydrated_version() -> ModelResponse
Get the hydrated version of this model.
Returns:
Type | Description |
---|---|
ModelResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model.py
193 194 195 196 197 198 199 200 201 |
|
ModelResponseBody
ModelResponseMetadata
ModelResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the model entity.
ModelUpdate
Bases: BaseModel
Update model for models.
model_version
Models representing model versions.
ModelVersionFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Filter model for model versions.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/model_version.py
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version.py
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 |
|
set_scope_model(model_name_or_id: Union[str, UUID]) -> None
Set the model to scope this response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name_or_id
|
Union[str, UUID]
|
The model to scope this response to. |
required |
Source code in src/zenml/models/v2/core/model_version.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
|
ModelVersionRequest
ModelVersionResponse
Bases: WorkspaceScopedResponse[ModelVersionResponseBody, ModelVersionResponseMetadata, ModelVersionResponseResources]
Response model for model versions.
data_artifact_ids: Dict[str, Dict[str, UUID]]
property
The data_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
data_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all data artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of data artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
deployment_artifact_ids: Dict[str, Dict[str, UUID]]
property
The deployment_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
deployment_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all deployment artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of deployment artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
model: ModelResponse
property
model_artifact_ids: Dict[str, Dict[str, UUID]]
property
The model_artifact_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, UUID]]
|
the value of the property. |
model_artifacts: Dict[str, Dict[str, ArtifactVersionResponse]]
property
Get all model artifacts linked to this model version.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dictionary of model artifacts with versions as |
Dict[str, Dict[str, ArtifactVersionResponse]]
|
Dict[str, Dict[str, ArtifactResponse]] |
number: int
property
The number
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
pipeline_run_ids: Dict[str, UUID]
property
The pipeline_run_ids
property.
Returns:
Type | Description |
---|---|
Dict[str, UUID]
|
the value of the property. |
pipeline_runs: Dict[str, PipelineRunResponse]
property
Get all pipeline runs linked to this version.
Returns:
Type | Description |
---|---|
Dict[str, PipelineRunResponse]
|
Dictionary of Pipeline Runs as PipelineRunResponseModel |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
stage: Optional[str]
property
The stage
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
tags: List[TagResponse]
property
get_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of an artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
|
get_data_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the data artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the data artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the data artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the data artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|
get_deployment_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the deployment artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the deployment artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the deployment artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the deployment artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
|
get_hydrated_version() -> ModelVersionResponse
Get the hydrated version of this model version.
Returns:
Type | Description |
---|---|
ModelVersionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/model_version.py
310 311 312 313 314 315 316 317 318 |
|
get_model_artifact(name: str, version: Optional[str] = None) -> Optional[ArtifactVersionResponse]
Get the model artifact linked to this model version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the model artifact to retrieve. |
required |
version
|
Optional[str]
|
The version of the model artifact to retrieve (None for latest/non-versioned) |
None
|
Returns:
Type | Description |
---|---|
Optional[ArtifactVersionResponse]
|
Specific version of the model artifact or None |
Source code in src/zenml/models/v2/core/model_version.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 |
|
get_pipeline_run(name: str) -> PipelineRunResponse
Get pipeline run linked to this version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the pipeline run to retrieve. |
required |
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
PipelineRun as PipelineRunResponseModel |
Source code in src/zenml/models/v2/core/model_version.py
528 529 530 531 532 533 534 535 536 537 538 539 |
|
set_stage(stage: Union[str, ModelStages], force: bool = False) -> None
Sets this Model Version to a desired stage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stage
|
Union[str, ModelStages]
|
the target stage for model version. |
required |
force
|
bool
|
whether to force archiving of current model version in target stage or raise. |
False
|
Raises:
Type | Description |
---|---|
ValueError
|
if model_stage is not valid. |
Source code in src/zenml/models/v2/core/model_version.py
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
to_model_class(suppress_class_validation_warnings: bool = True) -> Model
Convert response model to Model object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suppress_class_validation_warnings
|
bool
|
internally used to suppress repeated warnings. |
True
|
Returns:
Type | Description |
---|---|
Model
|
Model object |
Source code in src/zenml/models/v2/core/model_version.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
|
ModelVersionResponseBody
ModelVersionResponseMetadata
ModelVersionResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the model version entity.
ModelVersionUpdate
Bases: BaseModel
Update model for model versions.
model_version_artifact
Models representing the link between model versions and artifacts.
ModelVersionArtifactFilter
Bases: BaseFilter
Model version pipeline run links filter model.
get_custom_filters(table: Type[AnySchema]) -> List[Union[ColumnElement[bool]]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[Union[ColumnElement[bool]]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_artifact.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
ModelVersionArtifactRequest
ModelVersionArtifactResponse
Bases: BaseIdentifiedResponse[ModelVersionArtifactResponseBody, BaseResponseMetadata, ModelVersionArtifactResponseResources]
Response model for links between model versions and artifacts.
artifact_version: ArtifactVersionResponse
property
The artifact_version
property.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
the value of the property. |
model_version: UUID
property
The model_version
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
ModelVersionArtifactResponseBody
ModelVersionArtifactResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the model version artifact entity.
model_version_pipeline_run
Models representing the link between model versions and pipeline runs.
ModelVersionPipelineRunFilter
Bases: BaseFilter
Model version pipeline run links filter model.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/model_version_pipeline_run.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|
ModelVersionPipelineRunRequest
ModelVersionPipelineRunResponse
Bases: BaseIdentifiedResponse[ModelVersionPipelineRunResponseBody, BaseResponseMetadata, ModelVersionPipelineRunResponseResources]
Response model for links between model versions and pipeline runs.
model_version: UUID
property
The model_version
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
pipeline_run: PipelineRunResponse
property
ModelVersionPipelineRunResponseBody
ModelVersionPipelineRunResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the model version pipeline run entity.
pipeline
Models representing pipelines.
PipelineFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Pipeline filter model.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Applies the filter to a query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/pipeline.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
|
PipelineRequest
PipelineResponse
Bases: WorkspaceScopedResponse[PipelineResponseBody, PipelineResponseMetadata, PipelineResponseResources]
Response model for pipelines.
last_run: PipelineRunResponse
property
Returns the last run of this pipeline.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The last run of this pipeline. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no runs were found for this pipeline. |
last_successful_run: PipelineRunResponse
property
Returns the last successful run of this pipeline.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The last successful run of this pipeline. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no successful runs were found for this pipeline. |
latest_run_id: Optional[UUID]
property
The latest_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status
property.
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
the value of the property. |
num_runs: int
property
Returns the number of runs of this pipeline.
Returns:
Type | Description |
---|---|
int
|
The number of runs of this pipeline. |
runs: List[PipelineRunResponse]
property
Returns the 20 most recent runs of this pipeline in descending order.
Returns:
Type | Description |
---|---|
List[PipelineRunResponse]
|
The 20 most recent runs of this pipeline in descending order. |
tags: List[TagResponse]
property
get_hydrated_version() -> PipelineResponse
Get the hydrated version of this pipeline.
Returns:
Type | Description |
---|---|
PipelineResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline.py
146 147 148 149 150 151 152 153 154 |
|
get_runs(**kwargs: Any) -> List[PipelineRunResponse]
Get runs of this pipeline.
Can be used to fetch runs other than self.runs
and supports
fine-grained filtering and pagination.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Further arguments for filtering or pagination that are
passed to |
{}
|
Returns:
Type | Description |
---|---|
List[PipelineRunResponse]
|
List of runs of this pipeline. |
Source code in src/zenml/models/v2/core/pipeline.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
PipelineResponseBody
PipelineResponseMetadata
PipelineResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline entity.
PipelineUpdate
pipeline_build
Models representing pipeline builds.
PipelineBuildBase
Bases: BaseZenModel
Base model for pipeline builds.
requires_code_download: bool
property
Whether the build requires code download.
Returns:
Type | Description |
---|---|
bool
|
Whether the build requires code download. |
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
PipelineBuildFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all pipeline builds.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_build.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
|
PipelineBuildRequest
PipelineBuildResponse
Bases: WorkspaceScopedResponse[PipelineBuildResponseBody, PipelineBuildResponseMetadata, PipelineBuildResponseResources]
Response model for pipeline builds.
checksum: Optional[str]
property
The checksum
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
contains_code: bool
property
The contains_code
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
images: Dict[str, BuildItem]
property
is_local: bool
property
The is_local
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
python_version: Optional[str]
property
The python_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
requires_code_download: bool
property
Whether the build requires code download.
Returns:
Type | Description |
---|---|
bool
|
Whether the build requires code download. |
stack: Optional[StackResponse]
property
stack_checksum: Optional[str]
property
The stack_checksum
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
zenml_version: Optional[str]
property
The zenml_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
get_hydrated_version() -> PipelineBuildResponse
Return the hydrated version of this pipeline build.
Returns:
Type | Description |
---|---|
PipelineBuildResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_build.py
241 242 243 244 245 246 247 248 249 |
|
get_image(component_key: str, step: Optional[str] = None) -> str
Get the image built for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the image. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the image. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image name or digest. |
Source code in src/zenml/models/v2/core/pipeline_build.py
309 310 311 312 313 314 315 316 317 318 319 320 321 |
|
get_image_key(component_key: str, step: Optional[str] = None) -> str
staticmethod
Get the image key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The component key. |
required |
step
|
Optional[str]
|
The pipeline step for which the image was built. |
None
|
Returns:
Type | Description |
---|---|
str
|
The image key. |
Source code in src/zenml/models/v2/core/pipeline_build.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
|
get_settings_checksum(component_key: str, step: Optional[str] = None) -> Optional[str]
Get the settings checksum for a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_key
|
str
|
The key for which to get the checksum. |
required |
step
|
Optional[str]
|
The pipeline step for which to get the checksum. If no image exists for this step, will fall back to the pipeline image for the same key. |
None
|
Returns:
Type | Description |
---|---|
Optional[str]
|
The settings checksum. |
Source code in src/zenml/models/v2/core/pipeline_build.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
to_yaml() -> Dict[str, Any]
Create a yaml representation of the pipeline build.
Create a yaml representation of the pipeline build that can be used to create a PipelineBuildBase instance.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The yaml representation of the pipeline build. |
Source code in src/zenml/models/v2/core/pipeline_build.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
PipelineBuildResponseBody
PipelineBuildResponseMetadata
PipelineBuildResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline build entity.
pipeline_deployment
Models representing pipeline deployments.
PipelineDeploymentBase
Bases: BaseZenModel
Base model for pipeline deployments.
should_prevent_build_reuse: bool
property
Whether the deployment prevents a build reuse.
Returns:
Type | Description |
---|---|
bool
|
Whether the deployment prevents a build reuse. |
PipelineDeploymentFilter
PipelineDeploymentRequest
PipelineDeploymentResponse
Bases: WorkspaceScopedResponse[PipelineDeploymentResponseBody, PipelineDeploymentResponseMetadata, PipelineDeploymentResponseResources]
Response model for pipeline deployments.
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, str]
property
The client_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
client_version: Optional[str]
property
The client_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_path: Optional[str]
property
The code_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
pipeline_configuration: PipelineConfiguration
property
The pipeline_configuration
property.
Returns:
Type | Description |
---|---|
PipelineConfiguration
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec
property.
Returns:
Type | Description |
---|---|
Optional[PipelineSpec]
|
the value of the property. |
pipeline_version_hash: Optional[str]
property
The pipeline_version_hash
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
run_name_template: str
property
The run_name_template
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[ScheduleResponse]
|
the value of the property. |
server_version: Optional[str]
property
The server_version
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
stack: Optional[StackResponse]
property
step_configurations: Dict[str, Step]
property
The step_configurations
property.
Returns:
Type | Description |
---|---|
Dict[str, Step]
|
the value of the property. |
template_id: Optional[UUID]
property
The template_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
get_hydrated_version() -> PipelineDeploymentResponse
Return the hydrated version of this pipeline deployment.
Returns:
Type | Description |
---|---|
PipelineDeploymentResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_deployment.py
208 209 210 211 212 213 214 215 216 |
|
PipelineDeploymentResponseBody
PipelineDeploymentResponseMetadata
PipelineDeploymentResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline deployment entity.
pipeline_run
Models representing pipeline runs.
PipelineRunFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model to enable advanced filtering of all Workspaces.
apply_sorting(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Apply sorting to the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the sorting. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with sorting applied. |
Source code in src/zenml/models/v2/core/pipeline_run.py
937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 |
|
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/pipeline_run.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 |
|
PipelineRunRequest
PipelineRunResponse
Bases: WorkspaceScopedResponse[PipelineRunResponseBody, PipelineRunResponseMetadata, PipelineRunResponseResources]
Response model for pipeline runs.
artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions that are outputs of steps of this run.
Returns:
Type | Description |
---|---|
List[ArtifactVersionResponse]
|
All output artifact versions of this run (including cached ones). |
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
client_environment: Dict[str, str]
property
The client_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
code_path: Optional[str]
property
The code_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config: PipelineConfiguration
property
deployment_id: Optional[UUID]
property
The deployment_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
is_templatable: bool
property
The is_templatable
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
model_version: Optional[ModelVersionResponse]
property
The model_version
property.
Returns:
Type | Description |
---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
model_version_id: Optional[UUID]
property
The model_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
orchestrator_environment: Dict[str, str]
property
The orchestrator_environment
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
orchestrator_run_id: Optional[str]
property
The orchestrator_run_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
produced_artifact_versions: List[ArtifactVersionResponse]
property
Get all artifact versions produced during this pipeline run.
Returns:
Type | Description |
---|---|
List[ArtifactVersionResponse]
|
A list of all artifact versions produced during this pipeline run. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
schedule: Optional[ScheduleResponse]
property
The schedule
property.
Returns:
Type | Description |
---|---|
Optional[ScheduleResponse]
|
the value of the property. |
stack: Optional[StackResponse]
property
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
step_substitutions: Dict[str, Dict[str, str]]
property
The step_substitutions
property.
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, str]]
|
the value of the property. |
steps: Dict[str, StepRunResponse]
property
tags: List[TagResponse]
property
template_id: Optional[UUID]
property
The template_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
trigger_execution: Optional[TriggerExecutionResponse]
property
The trigger_execution
property.
Returns:
Type | Description |
---|---|
Optional[TriggerExecutionResponse]
|
the value of the property. |
get_hydrated_version() -> PipelineRunResponse
Get the hydrated version of this pipeline run.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/pipeline_run.py
286 287 288 289 290 291 292 293 294 |
|
refresh_run_status() -> PipelineRunResponse
Method to refresh the status of a run if it is initializing/running.
Returns:
Type | Description |
---|---|
PipelineRunResponse
|
The updated pipeline. |
Raises:
Type | Description |
---|---|
ValueError
|
If the stack of the run response is None. |
Source code in src/zenml/models/v2/core/pipeline_run.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|
PipelineRunResponseBody
PipelineRunResponseMetadata
PipelineRunResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the pipeline run entity.
PipelineRunUpdate
Bases: BaseModel
Pipeline run update model.
run_metadata
Models representing run metadata.
RunMetadataRequest
Bases: WorkspaceScopedRequest
Request model for run metadata.
validate_values_keys() -> RunMetadataRequest
Validates if the keys in the metadata are properly defined.
Returns:
Type | Description |
---|---|
RunMetadataRequest
|
self |
Raises:
Type | Description |
---|---|
ValueError
|
if one of the key in the metadata contains |
Source code in src/zenml/models/v2/core/run_metadata.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
run_template
Models representing pipeline templates.
RunTemplateFilter
Bases: WorkspaceScopedFilter
, TaggableFilter
Model for filtering of run templates.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/run_template.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
|
RunTemplateRequest
RunTemplateResponse
Bases: WorkspaceScopedResponse[RunTemplateResponseBody, RunTemplateResponseMetadata, RunTemplateResponseResources]
Response model for run templates.
build: Optional[PipelineBuildResponse]
property
The build
property.
Returns:
Type | Description |
---|---|
Optional[PipelineBuildResponse]
|
the value of the property. |
code_reference: Optional[CodeReferenceResponse]
property
The code_reference
property.
Returns:
Type | Description |
---|---|
Optional[CodeReferenceResponse]
|
the value of the property. |
config_schema: Optional[Dict[str, Any]]
property
The config_schema
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
config_template: Optional[Dict[str, Any]]
property
The config_template
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
latest_run_id: Optional[UUID]
property
The latest_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
latest_run_status: Optional[ExecutionStatus]
property
The latest_run_status
property.
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
the value of the property. |
pipeline: Optional[PipelineResponse]
property
The pipeline
property.
Returns:
Type | Description |
---|---|
Optional[PipelineResponse]
|
the value of the property. |
pipeline_spec: Optional[PipelineSpec]
property
The pipeline_spec
property.
Returns:
Type | Description |
---|---|
Optional[PipelineSpec]
|
the value of the property. |
runnable: bool
property
The runnable
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
source_deployment: Optional[PipelineDeploymentResponse]
property
The source_deployment
property.
Returns:
Type | Description |
---|---|
Optional[PipelineDeploymentResponse]
|
the value of the property. |
tags: List[TagResponse]
property
get_hydrated_version() -> RunTemplateResponse
Return the hydrated version of this run template.
Returns:
Type | Description |
---|---|
RunTemplateResponse
|
The hydrated run template. |
Source code in src/zenml/models/v2/core/run_template.py
186 187 188 189 190 191 192 193 194 195 196 |
|
RunTemplateResponseBody
RunTemplateResponseMetadata
RunTemplateResponseResources
RunTemplateUpdate
schedule
Models representing schedules.
ScheduleFilter
ScheduleRequest
ScheduleResponse
Bases: WorkspaceScopedResponse[ScheduleResponseBody, ScheduleResponseMetadata, ScheduleResponseResources]
Response model for schedules.
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
catchup: bool
property
The catchup
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
cron_expression: Optional[str]
property
The cron_expression
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
interval_second: Optional[timedelta]
property
The interval_second
property.
Returns:
Type | Description |
---|---|
Optional[timedelta]
|
the value of the property. |
orchestrator_id: Optional[UUID]
property
The orchestrator_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
pipeline_id: Optional[UUID]
property
The pipeline_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
run_once_start_time: Optional[datetime]
property
The run_once_start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
utc_end_time: Optional[str]
property
Optional ISO-formatted string of the UTC end time.
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC end time. |
utc_start_time: Optional[str]
property
Optional ISO-formatted string of the UTC start time.
Returns:
Type | Description |
---|---|
Optional[str]
|
Optional ISO-formatted string of the UTC start time. |
get_hydrated_version() -> ScheduleResponse
Get the hydrated version of this schedule.
Returns:
Type | Description |
---|---|
ScheduleResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/schedule.py
186 187 188 189 190 191 192 193 194 |
|
ScheduleResponseBody
ScheduleResponseMetadata
ScheduleResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the schedule entity.
ScheduleUpdate
secret
Models representing secrets.
SecretFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all Secrets.
secret_matches(secret: SecretResponse) -> bool
Checks if a secret matches the filter criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secret
|
SecretResponse
|
The secret to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the secret matches the filter criteria, False otherwise. |
Source code in src/zenml/models/v2/core/secret.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
sort_secrets(secrets: List[SecretResponse]) -> List[SecretResponse]
Sorts a list of secrets according to the filter criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
secrets
|
List[SecretResponse]
|
The list of secrets to sort. |
required |
Returns:
Type | Description |
---|---|
List[SecretResponse]
|
The sorted list of secrets. |
Source code in src/zenml/models/v2/core/secret.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
SecretRequest
Bases: WorkspaceScopedRequest
Request models for secrets.
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
SecretResponse
Bases: WorkspaceScopedResponse[SecretResponseBody, SecretResponseMetadata, SecretResponseResources]
Response model for secrets.
has_missing_values: bool
property
Returns True if the secret has missing values (i.e. None).
Values can be missing from a secret for example if the user retrieves a secret but does not have the permission to view the secret values.
Returns:
Type | Description |
---|---|
bool
|
True if the secret has any values set to None. |
scope: SecretScope
property
secret_values: Dict[str, str]
property
A dictionary with all un-obfuscated values stored in this secret.
The values are returned as strings, not SecretStr. If a value is None, it is not included in the returned dictionary. This is to enable the use of None values in the update model to indicate that a secret value should be deleted.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
A dictionary containing the secret's values. |
values: Dict[str, Optional[SecretStr]]
property
The values
property.
Returns:
Type | Description |
---|---|
Dict[str, Optional[SecretStr]]
|
the value of the property. |
add_secret(key: str, value: str) -> None
Adds a secret value to the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
value
|
str
|
The secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
210 211 212 213 214 215 216 217 |
|
get_hydrated_version() -> SecretResponse
Get the hydrated version of this workspace.
Returns:
Type | Description |
---|---|
SecretResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/secret.py
149 150 151 152 153 154 155 156 157 |
|
remove_secret(key: str) -> None
Removes a secret value from the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The key of the secret value. |
required |
Source code in src/zenml/models/v2/core/secret.py
219 220 221 222 223 224 225 |
|
remove_secrets() -> None
Removes all secret values from the secret but keep the keys.
Source code in src/zenml/models/v2/core/secret.py
227 228 229 |
|
set_secrets(values: Dict[str, str]) -> None
Sets the secret values of the secret.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
Dict[str, str]
|
The secret values to set. |
required |
Source code in src/zenml/models/v2/core/secret.py
231 232 233 234 235 236 237 |
|
SecretResponseBody
SecretResponseMetadata
SecretResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the secret entity.
SecretUpdate
Bases: BaseUpdate
Secret update model.
get_secret_values_update() -> Dict[str, Optional[str]]
Returns a dictionary with the secret values to update.
Returns:
Type | Description |
---|---|
Dict[str, Optional[str]]
|
A dictionary with the secret values to update. |
Source code in src/zenml/models/v2/core/secret.py
98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
server_settings
Models representing server settings stored in the database.
ServerActivationRequest
ServerSettingsResponse
Bases: BaseResponse[ServerSettingsResponseBody, ServerSettingsResponseMetadata, ServerSettingsResponseResources]
Response model for server settings.
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
display_announcements: Optional[bool]
property
The display_announcements
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
display_updates: Optional[bool]
property
The display_updates
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
enable_analytics: bool
property
The enable_analytics
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
last_user_activity: datetime
property
The last_user_activity
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
logo_url: Optional[str]
property
The logo_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
server_id: UUID
property
The server_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
server_name: str
property
The server_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
get_hydrated_version() -> ServerSettingsResponse
Get the hydrated version of the server settings.
Returns:
Type | Description |
---|---|
ServerSettingsResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/server_settings.py
110 111 112 113 114 115 116 117 118 |
|
ServerSettingsResponseBody
ServerSettingsResponseMetadata
ServerSettingsResponseResources
ServerSettingsUpdate
service
Models representing Services.
ServiceFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of services.
The Service needs additional scoping. As such the _scope_user
field
can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
generate_filter(table: Type[AnySchema]) -> Union[ColumnElement[bool]]
Generate the filter for the query.
Services can be scoped by type to narrow the search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The Table that is being queried from. |
required |
Returns:
Type | Description |
---|---|
Union[ColumnElement[bool]]
|
The filter expression for the query. |
Source code in src/zenml/models/v2/core/service.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
|
set_flavor(flavor: str) -> None
Set the flavor of the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor
|
str
|
The flavor of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
436 437 438 439 440 441 442 |
|
set_type(type: str) -> None
Set the type of the service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
str
|
The type of the service. |
required |
Source code in src/zenml/models/v2/core/service.py
428 429 430 431 432 433 434 |
|
ServiceRequest
ServiceResponse
Bases: WorkspaceScopedResponse[ServiceResponseBody, ServiceResponseMetadata, ServiceResponseResources]
Response model for services.
admin_state: Optional[ServiceState]
property
The admin_state
property.
Returns:
Type | Description |
---|---|
Optional[ServiceState]
|
the value of the property. |
config: Dict[str, Any]
property
The config
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
created: datetime
property
The created
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
endpoint: Optional[Dict[str, Any]]
property
The endpoint
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
health_check_url: Optional[str]
property
The health_check_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
labels: Optional[Dict[str, str]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, str]]
|
the value of the property. |
prediction_url: Optional[str]
property
The prediction_url
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
service_source: Optional[str]
property
The service_source
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
service_type: ServiceType
property
state: Optional[ServiceState]
property
status: Optional[Dict[str, Any]]
property
The status
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
updated: datetime
property
The updated
property.
Returns:
Type | Description |
---|---|
datetime
|
the value of the property. |
get_hydrated_version() -> ServiceResponse
Get the hydrated version of this artifact.
Returns:
Type | Description |
---|---|
ServiceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service.py
246 247 248 249 250 251 252 253 254 |
|
ServiceResponseBody
ServiceResponseMetadata
ServiceResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the service entity.
ServiceUpdate
Bases: BaseModel
Update model for stack components.
service_account
Models representing service accounts.
ServiceAccountFilter
Bases: BaseFilter
Model to enable advanced filtering of service accounts.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out user accounts from the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/service_account.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
ServiceAccountRequest
ServiceAccountResponse
Bases: BaseIdentifiedResponse[ServiceAccountResponseBody, ServiceAccountResponseMetadata, ServiceAccountResponseResources]
Response model for service accounts.
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
get_hydrated_version() -> ServiceAccountResponse
Get the hydrated version of this service account.
Returns:
Type | Description |
---|---|
ServiceAccountResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_account.py
126 127 128 129 130 131 132 133 134 |
|
to_user_model() -> UserResponse
Converts the service account to a user model.
For now, a lot of code still relies on the active user and resource owners being a UserResponse object, which is a superset of the ServiceAccountResponse object. We need this method to convert the service account to a user.
Returns:
Type | Description |
---|---|
UserResponse
|
The user model. |
Source code in src/zenml/models/v2/core/service_account.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
ServiceAccountResponseBody
ServiceAccountResponseMetadata
ServiceAccountResponseResources
Bases: BaseResponseResources
Class for all resource models associated with the service account entity.
ServiceAccountUpdate
service_connector
Models representing service connectors.
ServiceConnectorFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of service connectors.
validate_labels() -> ServiceConnectorFilter
Parse the labels string into a label dictionary and vice-versa.
Returns:
Type | Description |
---|---|
ServiceConnectorFilter
|
The validated values. |
Source code in src/zenml/models/v2/core/service_connector.py
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 |
|
ServiceConnectorRequest
Bases: WorkspaceScopedRequest
Request model for service connectors.
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector type. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
ServiceConnectorResponse
Bases: WorkspaceScopedResponse[ServiceConnectorResponseBody, ServiceConnectorResponseMetadata, ServiceConnectorResponseResources]
Response model for service connectors.
auth_method: str
property
The auth_method
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
configuration: Dict[str, Any]
property
The configuration
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
connector_type: Union[str, ServiceConnectorTypeModel]
property
The connector_type
property.
Returns:
Type | Description |
---|---|
Union[str, ServiceConnectorTypeModel]
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector type. |
expiration_seconds: Optional[int]
property
The expiration_seconds
property.
Returns:
Type | Description |
---|---|
Optional[int]
|
the value of the property. |
expires_at: Optional[datetime]
property
The expires_at
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
expires_skew_tolerance: Optional[int]
property
The expires_skew_tolerance
property.
Returns:
Type | Description |
---|---|
Optional[int]
|
the value of the property. |
full_configuration: Dict[str, str]
property
Get the full connector configuration, including secrets.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
The full connector configuration, including secrets. |
is_multi_instance: bool
property
Checks if the connector is multi-instance.
A multi-instance connector is configured to access multiple instances of the configured resource type.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is multi-instance, False otherwise. |
is_multi_type: bool
property
Checks if the connector is multi-type.
A multi-type connector can be used to access multiple types of resources.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is multi-type, False otherwise. |
is_single_instance: bool
property
Checks if the connector is single-instance.
A single-instance connector is configured to access only a single instance of the configured resource type or does not support multiple resource instances.
Returns:
Type | Description |
---|---|
bool
|
True if the connector is single-instance, False otherwise. |
labels: Dict[str, str]
property
The labels
property.
Returns:
Type | Description |
---|---|
Dict[str, str]
|
the value of the property. |
resource_id: Optional[str]
property
The resource_id
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
resource_types: List[str]
property
The resource_types
property.
Returns:
Type | Description |
---|---|
List[str]
|
the value of the property. |
secret_id: Optional[UUID]
property
The secret_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
secrets: Dict[str, Optional[SecretStr]]
property
The secrets
property.
Returns:
Type | Description |
---|---|
Dict[str, Optional[SecretStr]]
|
the value of the property. |
supports_instances: bool
property
The supports_instances
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
get_analytics_metadata() -> Dict[str, Any]
Add the service connector labels to analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
|
get_hydrated_version() -> ServiceConnectorResponse
Get the hydrated version of this service connector.
Returns:
Type | Description |
---|---|
ServiceConnectorResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/service_connector.py
517 518 519 520 521 522 523 524 525 |
|
set_connector_type(value: Union[str, ServiceConnectorTypeModel]) -> None
Auxiliary method to set the connector type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Union[str, ServiceConnectorTypeModel]
|
the new value for the connector type. |
required |
Source code in src/zenml/models/v2/core/service_connector.py
622 623 624 625 626 627 628 629 630 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
|
ServiceConnectorResponseBody
ServiceConnectorResponseMetadata
ServiceConnectorResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the service connector entity.
ServiceConnectorUpdate
Bases: BaseUpdate
Model used for service connector updates.
Most fields in the update model are optional and will not be updated if omitted. However, the following fields are "special" and leaving them out will also cause the corresponding value to be removed from the service connector in the database:
- the
resource_id
field - the
expiration_seconds
field
In addition to the above exceptions, the following rules apply:
- the
configuration
andsecrets
fields together represent a full valid configuration update, not just a partial update. If either is set (i.e. not None) in the update, their values are merged together and will replace the existing configuration and secrets values. - the
secret_id
field value in the update is ignored, given that secrets are managed internally by the ZenML store. - the
labels
field is also a full labels update: if set (i.e. notNone
), all existing labels are removed and replaced by the new labels in the update.
NOTE: the attributes here override the ones in the base class, so they have a None default value.
type: Optional[str]
property
Get the connector type.
Returns:
Type | Description |
---|---|
Optional[str]
|
The connector type. |
convert_to_request() -> ServiceConnectorRequest
Method to generate a service connector request object from self.
For certain operations, the service connector update model need to adhere to the limitations set by the request model. In order to use update models in such situations, we need to be able to convert an update model into a request model.
Returns:
Type | Description |
---|---|
ServiceConnectorRequest
|
The equivalent request model |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the model can not be converted to a request model. |
Source code in src/zenml/models/v2/core/service_connector.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
|
get_analytics_metadata() -> Dict[str, Any]
Format the resource types in the analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/service_connector.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
|
validate_and_configure_resources(connector_type: ServiceConnectorTypeModel, resource_types: Optional[Union[str, List[str]]] = None, resource_id: Optional[str] = None, configuration: Optional[Dict[str, Any]] = None, secrets: Optional[Dict[str, Optional[SecretStr]]] = None) -> None
Validate and configure the resources that the connector can be used to access.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_type
|
ServiceConnectorTypeModel
|
The connector type specification used to validate the connector configuration. |
required |
resource_types
|
Optional[Union[str, List[str]]]
|
The type(s) of resource that the connector instance can be used to access. If omitted, a multi-type connector is configured. |
None
|
resource_id
|
Optional[str]
|
Uniquely identifies a specific resource instance that the connector instance can be used to access. |
None
|
configuration
|
Optional[Dict[str, Any]]
|
The connector configuration. |
None
|
secrets
|
Optional[Dict[str, Optional[SecretStr]]]
|
The connector secrets. |
None
|
Source code in src/zenml/models/v2/core/service_connector.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
stack
Models representing stacks.
StackFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all StackModels.
The Stack Model needs additional scoping. As such the _scope_user
field
can be set to the user that is doing the filtering. The
generate_filter()
method of the baseclass is overwritten to include the
scoping.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/stack.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|
StackRequest
Bases: BaseRequest
Request model for a stack.
is_valid: bool
property
Check if the stack is valid.
Returns:
Type | Description |
---|---|
bool
|
True if the stack is valid, False otherwise. |
StackResponse
Bases: WorkspaceScopedResponse[StackResponseBody, StackResponseMetadata, StackResponseResources]
Response model for stacks.
components: Dict[StackComponentType, List[ComponentResponse]]
property
The components
property.
Returns:
Type | Description |
---|---|
Dict[StackComponentType, List[ComponentResponse]]
|
the value of the property. |
description: Optional[str]
property
The description
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
is_valid: bool
property
Check if the stack is valid.
Returns:
Type | Description |
---|---|
bool
|
True if the stack is valid, False otherwise. |
labels: Optional[Dict[str, Any]]
property
The labels
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
stack_spec_path: Optional[str]
property
The stack_spec_path
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
get_analytics_metadata() -> Dict[str, Any]
Add the stack components to the stack analytics metadata.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict of analytics metadata. |
Source code in src/zenml/models/v2/core/stack.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|
get_hydrated_version() -> StackResponse
Get the hydrated version of this stack.
Returns:
Type | Description |
---|---|
StackResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/stack.py
209 210 211 212 213 214 215 216 217 |
|
to_yaml() -> Dict[str, Any]
Create yaml representation of the Stack Model.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The yaml representation of the Stack Model. |
Source code in src/zenml/models/v2/core/stack.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
StackResponseBody
StackResponseMetadata
StackResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the stack entity.
StackUpdate
step_run
Models representing steps runs.
StepRunFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of step runs.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/step_run.py
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
StepRunInputResponse
Bases: ArtifactVersionResponse
Response model for step run inputs.
get_hydrated_version() -> StepRunInputResponse
Get the hydrated version of this step run input.
Returns:
Type | Description |
---|---|
StepRunInputResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/step_run.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|
StepRunRequest
StepRunResponse
Bases: WorkspaceScopedResponse[StepRunResponseBody, StepRunResponseMetadata, StepRunResponseResources]
Response model for step runs.
cache_key: Optional[str]
property
The cache_key
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
code_hash: Optional[str]
property
The code_hash
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
config: StepConfiguration
property
deployment_id: UUID
property
The deployment_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
docstring: Optional[str]
property
The docstring
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
end_time: Optional[datetime]
property
The end_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
input: ArtifactVersionResponse
property
Returns the input artifact that was used to run this step.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
The input artifact. |
Raises:
Type | Description |
---|---|
ValueError
|
If there were zero or multiple inputs to this step. |
inputs: Dict[str, StepRunInputResponse]
property
The inputs
property.
Returns:
Type | Description |
---|---|
Dict[str, StepRunInputResponse]
|
the value of the property. |
logs: Optional[LogsResponse]
property
model_version: Optional[ModelVersionResponse]
property
The model_version
property.
Returns:
Type | Description |
---|---|
Optional[ModelVersionResponse]
|
the value of the property. |
model_version_id: Optional[UUID]
property
The model_version_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
original_step_run_id: Optional[UUID]
property
The original_step_run_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
output: ArtifactVersionResponse
property
Returns the output artifact that was written by this step.
Returns:
Type | Description |
---|---|
ArtifactVersionResponse
|
The output artifact. |
Raises:
Type | Description |
---|---|
ValueError
|
If there were zero or multiple step outputs. |
outputs: Dict[str, List[ArtifactVersionResponse]]
property
The outputs
property.
Returns:
Type | Description |
---|---|
Dict[str, List[ArtifactVersionResponse]]
|
the value of the property. |
parent_step_ids: List[UUID]
property
The parent_step_ids
property.
Returns:
Type | Description |
---|---|
List[UUID]
|
the value of the property. |
pipeline_run_id: UUID
property
The pipeline_run_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
run_metadata: Dict[str, MetadataType]
property
The run_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
the value of the property. |
source_code: Optional[str]
property
The source_code
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
spec: StepSpec
property
start_time: Optional[datetime]
property
The start_time
property.
Returns:
Type | Description |
---|---|
Optional[datetime]
|
the value of the property. |
status: ExecutionStatus
property
get_hydrated_version() -> StepRunResponse
Get the hydrated version of this step run.
Returns:
Type | Description |
---|---|
StepRunResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/step_run.py
291 292 293 294 295 296 297 298 299 |
|
StepRunResponseBody
StepRunResponseMetadata
StepRunResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the step run entity.
StepRunUpdate
Bases: BaseModel
Update model for step runs.
tag
Models representing tags.
TagFilter
TagRequest
TagResponse
Bases: BaseIdentifiedResponse[TagResponseBody, BaseResponseMetadata, TagResponseResources]
Response model for tags.
color: ColorVariants
property
tagged_count: int
property
The tagged_count
property.
Returns:
Type | Description |
---|---|
int
|
the value of the property. |
get_hydrated_version() -> TagResponse
Get the hydrated version of this tag.
Returns:
Type | Description |
---|---|
TagResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/tag.py
89 90 91 92 93 94 95 96 97 |
|
TagResponseBody
TagResponseResources
TagUpdate
Bases: BaseModel
Update model for tags.
tag_resource
Models representing the link between tags and resources.
TagResourceRequest
TagResourceResponse
Bases: BaseIdentifiedResponse[TagResourceResponseBody, BaseResponseMetadata, TagResourceResponseResources]
Response model for the links between tags and resources.
resource_id: UUID
property
The resource_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
resource_type: TaggableResourceTypes
property
The resource_type
property.
Returns:
Type | Description |
---|---|
TaggableResourceTypes
|
the value of the property. |
tag_id: UUID
property
The tag_id
property.
Returns:
Type | Description |
---|---|
UUID
|
the value of the property. |
TagResourceResponseBody
TagResourceResponseResources
trigger
Collection of all models concerning triggers.
TriggerFilter
Bases: WorkspaceScopedFilter
Model to enable advanced filtering of all triggers.
get_custom_filters(table: Type[AnySchema]) -> List[ColumnElement[bool]]
Get custom filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
List[ColumnElement[bool]]
|
A list of custom filters. |
Source code in src/zenml/models/v2/core/trigger.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|
TriggerRequest
TriggerResponse
Bases: WorkspaceScopedResponse[TriggerResponseBody, TriggerResponseMetadata, TriggerResponseResources]
Response model for models.
action: ActionResponse
property
action_flavor: str
property
The action_flavor
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
action_subtype: str
property
The action_subtype
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
event_filter: Optional[Dict[str, Any]]
property
The event_filter
property.
Returns:
Type | Description |
---|---|
Optional[Dict[str, Any]]
|
the value of the property. |
event_source: Optional[EventSourceResponse]
property
The event_source
property.
Returns:
Type | Description |
---|---|
Optional[EventSourceResponse]
|
the value of the property. |
event_source_flavor: Optional[str]
property
The event_source_flavor
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
event_source_subtype: Optional[str]
property
The event_source_subtype
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
executions: Page[TriggerExecutionResponse]
property
The event_source
property.
Returns:
Type | Description |
---|---|
Page[TriggerExecutionResponse]
|
the value of the property. |
is_active: bool
property
The is_active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
get_hydrated_version() -> TriggerResponse
Get the hydrated version of this trigger.
Returns:
Type | Description |
---|---|
TriggerResponse
|
An instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger.py
223 224 225 226 227 228 229 230 231 |
|
TriggerResponseBody
TriggerResponseMetadata
TriggerResponseResources
Bases: WorkspaceScopedResponseResources
Class for all resource models associated with the trigger entity.
TriggerUpdate
trigger_execution
Collection of all models concerning trigger executions.
TriggerExecutionFilter
TriggerExecutionRequest
TriggerExecutionResponse
Bases: BaseIdentifiedResponse[TriggerExecutionResponseBody, TriggerExecutionResponseMetadata, TriggerExecutionResponseResources]
Response model for trigger executions.
event_metadata: Dict[str, Any]
property
The event_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
trigger: TriggerResponse
property
get_hydrated_version() -> TriggerExecutionResponse
Get the hydrated version of this trigger execution.
Returns:
Type | Description |
---|---|
TriggerExecutionResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/trigger_execution.py
78 79 80 81 82 83 84 85 86 |
|
TriggerExecutionResponseBody
TriggerExecutionResponseMetadata
TriggerExecutionResponseResources
user
Models representing users.
UserBase
Bases: BaseModel
Base model for users.
create_hashed_activation_token() -> Optional[str]
Hashes the activation token.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed activation token. |
Source code in src/zenml/models/v2/core/user.py
121 122 123 124 125 126 127 |
|
create_hashed_password() -> Optional[str]
Hashes the password.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed password. |
Source code in src/zenml/models/v2/core/user.py
113 114 115 116 117 118 119 |
|
generate_activation_token() -> str
Generates and stores a new activation token.
Returns:
Type | Description |
---|---|
str
|
The generated activation token. |
Source code in src/zenml/models/v2/core/user.py
129 130 131 132 133 134 135 136 |
|
UserFilter
Bases: BaseFilter
Model to enable advanced filtering of all Users.
apply_filter(query: AnyQuery, table: Type[AnySchema]) -> AnyQuery
Override to filter out service accounts from the query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
AnyQuery
|
The query to which to apply the filter. |
required |
table
|
Type[AnySchema]
|
The query table. |
required |
Returns:
Type | Description |
---|---|
AnyQuery
|
The query with filter applied. |
Source code in src/zenml/models/v2/core/user.py
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
|
UserRequest
UserResponse
Bases: BaseIdentifiedResponse[UserResponseBody, UserResponseMetadata, UserResponseResources]
Response model for user and service accounts.
This returns the activation_token that is required for the user-invitation-flow of the frontend. The email is returned optionally as well for use by the analytics on the client-side.
activation_token: Optional[str]
property
The activation_token
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
active: bool
property
The active
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
email: Optional[str]
property
The email
property.
Returns:
Type | Description |
---|---|
Optional[str]
|
the value of the property. |
email_opted_in: Optional[bool]
property
The email_opted_in
property.
Returns:
Type | Description |
---|---|
Optional[bool]
|
the value of the property. |
external_user_id: Optional[UUID]
property
The external_user_id
property.
Returns:
Type | Description |
---|---|
Optional[UUID]
|
the value of the property. |
full_name: str
property
The full_name
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
is_admin: bool
property
The is_admin
property.
Returns:
Type | Description |
---|---|
bool
|
Whether the user is an admin. |
is_service_account: bool
property
The is_service_account
property.
Returns:
Type | Description |
---|---|
bool
|
the value of the property. |
user_metadata: Dict[str, Any]
property
The user_metadata
property.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
the value of the property. |
get_hydrated_version() -> UserResponse
Get the hydrated version of this user.
Returns:
Type | Description |
---|---|
UserResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/user.py
333 334 335 336 337 338 339 340 341 |
|
UserResponseBody
UserResponseMetadata
UserResponseResources
UserUpdate
Bases: UserBase
, BaseZenModel
Update model for users.
create_copy(exclude: AbstractSet[str]) -> UserUpdate
Create a copy of the current instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exclude
|
AbstractSet[str]
|
Fields to exclude from the copy. |
required |
Returns:
Type | Description |
---|---|
UserUpdate
|
A copy of the current instance. |
Source code in src/zenml/models/v2/core/user.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
user_email_updates() -> UserUpdate
Validate that the UserUpdateModel conforms to the email-opt-in-flow.
Returns:
Type | Description |
---|---|
UserUpdate
|
The validated values. |
Raises:
Type | Description |
---|---|
ValueError
|
If the email was not provided when the email_opted_in field was set to True. |
Source code in src/zenml/models/v2/core/user.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
workspace
Models representing workspaces.
WorkspaceFilter
WorkspaceRequest
WorkspaceResponse
Bases: BaseIdentifiedResponse[WorkspaceResponseBody, WorkspaceResponseMetadata, WorkspaceResponseResources]
Response model for workspaces.
description: str
property
The description
property.
Returns:
Type | Description |
---|---|
str
|
the value of the property. |
get_hydrated_version() -> WorkspaceResponse
Get the hydrated version of this workspace.
Returns:
Type | Description |
---|---|
WorkspaceResponse
|
an instance of the same entity with the metadata field attached. |
Source code in src/zenml/models/v2/core/workspace.py
101 102 103 104 105 106 107 108 109 |
|
WorkspaceResponseBody
WorkspaceResponseMetadata
WorkspaceResponseResources
WorkspaceUpdate
misc
auth_models
Models representing OAuth2 requests and responses.
OAuthDeviceAuthorizationRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceAuthorizationResponse
Bases: BaseModel
OAuth2 device authorization grant response.
OAuthDeviceTokenRequest
Bases: BaseModel
OAuth2 device authorization grant request.
OAuthDeviceUserAgentHeader
Bases: BaseModel
OAuth2 device user agent header.
decode(header_str: str) -> OAuthDeviceUserAgentHeader
classmethod
Decode the user agent header.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
header_str
|
str
|
The user agent header string value. |
required |
Returns:
Type | Description |
---|---|
OAuthDeviceUserAgentHeader
|
The decoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
encode() -> str
Encode the user agent header.
Returns:
Type | Description |
---|---|
str
|
The encoded user agent header. |
Source code in src/zenml/models/v2/misc/auth_models.py
85 86 87 88 89 90 91 92 93 94 95 96 |
|
OAuthDeviceVerificationRequest
Bases: BaseModel
OAuth2 device authorization verification request.
OAuthRedirectResponse
Bases: BaseModel
Redirect response.
OAuthTokenResponse
Bases: BaseModel
OAuth2 device authorization token response.
build_item
Model definition for pipeline build item.
BuildItem
Bases: BaseModel
Pipeline build item.
Attributes:
Name | Type | Description |
---|---|---|
image |
str
|
The image name or digest. |
dockerfile |
Optional[str]
|
The contents of the Dockerfile used to build the image. |
requirements |
Optional[str]
|
The pip requirements installed in the image. This is a string consisting of multiple concatenated requirements.txt files. |
settings_checksum |
Optional[str]
|
Checksum of the settings used for the build. |
contains_code |
bool
|
Whether the image contains user files. |
requires_code_download |
bool
|
Whether the image needs to download files. |
external_user
Models representing users.
ExternalUserModel
Bases: BaseModel
External user model.
info_models
Models representing full stack requests.
ComponentInfo
Bases: BaseModel
Information about each stack components when creating a full stack.
ResourcesInfo
Bases: BaseModel
Information about the resources needed for CLI and UI.
ServiceConnectorInfo
Bases: BaseModel
Information about the service connector when creating a full stack.
ServiceConnectorResourcesInfo
Bases: BaseModel
Information about the service connector resources needed for CLI and UI.
loaded_visualization
Model representing loaded visualizations.
LoadedVisualization
Bases: BaseModel
Model for loaded visualizations.
run_metadata
Utility classes for modeling run metadata.
RunMetadataEntry
Bases: BaseModel
Utility class to sort/list run metadata entries.
RunMetadataResource
Bases: BaseModel
Utility class to help identify resources to tag metadata to.
server_models
Model definitions for ZenML servers.
ServerDatabaseType
ServerDeploymentType
ServerLoadInfo
Bases: BaseModel
Domain model for ZenML server load information.
ServerModel
Bases: BaseModel
Domain model for ZenML servers.
is_local() -> bool
Return whether the server is running locally.
Returns:
Type | Description |
---|---|
bool
|
True if the server is running locally, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
146 147 148 149 150 151 152 153 154 155 156 |
|
is_pro_server() -> bool
Return whether the server is a ZenML Pro server.
Returns:
Type | Description |
---|---|
bool
|
True if the server is a ZenML Pro server, False otherwise. |
Source code in src/zenml/models/v2/misc/server_models.py
158 159 160 161 162 163 164 |
|
service_connector_type
Model definitions for ZenML service connectors.
AuthenticationMethodModel(config_class: Optional[Type[BaseModel]] = None, **values: Any)
Bases: BaseModel
Authentication method specification.
Describes the schema for the configuration and secrets that need to be provided to configure an authentication method.
Initialize the authentication method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_class
|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
None
|
**values
|
Any
|
The data to initialize the authentication method with. |
{}
|
Source code in src/zenml/models/v2/misc/service_connector_type.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
config_class: Optional[Type[BaseModel]]
property
Get the configuration class for the authentication method.
Returns:
Type | Description |
---|---|
Optional[Type[BaseModel]]
|
The configuration class for the authentication method. |
supports_temporary_credentials() -> bool
Check if the authentication method supports temporary credentials.
Returns:
Type | Description |
---|---|
bool
|
True if the authentication method supports temporary credentials, |
bool
|
False otherwise. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
157 158 159 160 161 162 163 164 165 166 167 168 |
|
validate_expiration(expiration_seconds: Optional[int]) -> Optional[int]
Validate the expiration time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expiration_seconds
|
Optional[int]
|
The expiration time in seconds. If None, the default expiration time is used, if applicable. |
required |
Returns:
Type | Description |
---|---|
Optional[int]
|
The expiration time in seconds or None if not applicable. |
Raises:
Type | Description |
---|---|
ValueError
|
If the expiration time is not valid. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
ResourceTypeModel
Bases: BaseModel
Resource type specification.
Describes the authentication methods and resource instantiation model for one or more resource types.
emojified_resource_type: str
property
Get the emojified resource type.
Returns:
Type | Description |
---|---|
str
|
The emojified resource type. |
ServiceConnectorRequirements
Bases: BaseModel
Service connector requirements.
Describes requirements that a service connector consumer has for a service connector instance that it needs in order to access a resource.
Attributes:
Name | Type | Description |
---|---|---|
connector_type |
Optional[str]
|
The type of service connector that is required. If omitted, any service connector type can be used. |
resource_type |
str
|
The type of resource that the service connector instance must be able to access. |
resource_id_attr |
Optional[str]
|
The name of an attribute in the stack component configuration that contains the resource ID of the resource that the service connector instance must be able to access. |
is_satisfied_by(connector: Union[ServiceConnectorResponse, ServiceConnectorRequest], component: Union[ComponentResponse, ComponentBase]) -> Tuple[bool, str]
Check if the requirements are satisfied by a connector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector
|
Union[ServiceConnectorResponse, ServiceConnectorRequest]
|
The connector to check. |
required |
component
|
Union[ComponentResponse, ComponentBase]
|
The stack component that the connector is associated with. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the requirements are satisfied, False otherwise, and a |
str
|
message describing the reason for the failure. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
|
ServiceConnectorResourcesModel
Bases: BaseModel
Service connector resources list.
Lists the resource types and resource instances that a service connector can provide access to.
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
resource_types: List[str]
property
Get the resource types.
Returns:
Type | Description |
---|---|
List[str]
|
The resource types. |
resources_dict: Dict[str, ServiceConnectorTypedResourcesModel]
property
Get the resources as a dictionary indexed by resource type.
Returns:
Type | Description |
---|---|
Dict[str, ServiceConnectorTypedResourcesModel]
|
The resources as a dictionary indexed by resource type. |
type: str
property
Get the connector type.
Returns:
Type | Description |
---|---|
str
|
The connector type. |
from_connector_model(connector_model: ServiceConnectorResponse, resource_type: Optional[str] = None) -> ServiceConnectorResourcesModel
classmethod
Initialize a resource model from a connector model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_model
|
ServiceConnectorResponse
|
The connector model. |
required |
resource_type
|
Optional[str]
|
The resource type to set on the resource model. If omitted, the resource type is set according to the connector model. |
None
|
Returns:
Type | Description |
---|---|
ServiceConnectorResourcesModel
|
A resource list model instance. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 |
|
get_default_resource_id() -> Optional[str]
Get the default resource ID, if included in the resource list.
The default resource ID is a resource ID supplied by the connector implementation only for resource types that do not support multiple instances.
Returns:
Type | Description |
---|---|
Optional[str]
|
The default resource ID, or None if no resource ID is set. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
|
get_emojified_resource_types(resource_type: Optional[str] = None) -> List[str]
Get the emojified resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_type
|
Optional[str]
|
The resource type to get the emojified resource type for. If omitted, the emojified resource type for all resource types is returned. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
The list of emojified resource types. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 |
|
set_error(error: str, resource_type: Optional[str] = None) -> None
Set a global error message or an error for a single resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
error
|
str
|
The error message. |
required |
resource_type
|
Optional[str]
|
The resource type to set the error message for. If omitted, or if there is only one resource type involved, the error message is (also) set globally. |
None
|
Raises:
Type | Description |
---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
|
set_resource_ids(resource_type: str, resource_ids: List[str]) -> None
Set the resource IDs for a resource type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_type
|
str
|
The resource type to set the resource IDs for. |
required |
resource_ids
|
List[str]
|
The resource IDs to set. |
required |
Raises:
Type | Description |
---|---|
KeyError
|
If the resource type is not found in the resources list. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
ServiceConnectorTypeModel
Bases: BaseModel
Service connector type specification.
Describes the types of resources to which the service connector can be used to gain access and the authentication methods that are supported by the service connector.
The connector type, resource types, resource IDs and authentication methods can all be used as search criteria to lookup and filter service connector instances that are compatible with the requirements of a consumer (e.g. a stack component).
auth_method_dict: Dict[str, AuthenticationMethodModel]
property
Returns a map of authentication methods to authentication method specifications.
Returns:
Type | Description |
---|---|
Dict[str, AuthenticationMethodModel]
|
A map of authentication methods to authentication method |
Dict[str, AuthenticationMethodModel]
|
specifications. |
connector_class: Optional[Type[ServiceConnector]]
property
Get the service connector class.
Returns:
Type | Description |
---|---|
Optional[Type[ServiceConnector]]
|
The service connector class. |
emojified_connector_type: str
property
Get the emojified connector type.
Returns:
Type | Description |
---|---|
str
|
The emojified connector type. |
emojified_resource_types: List[str]
property
Get the emojified connector types.
Returns:
Type | Description |
---|---|
List[str]
|
The emojified connector types. |
resource_type_dict: Dict[str, ResourceTypeModel]
property
Returns a map of resource types to resource type specifications.
Returns:
Type | Description |
---|---|
Dict[str, ResourceTypeModel]
|
A map of resource types to resource type specifications. |
find_resource_specifications(auth_method: str, resource_type: Optional[str] = None) -> Tuple[AuthenticationMethodModel, Optional[ResourceTypeModel]]
Find the specifications for a configurable resource.
Validate the supplied connector configuration parameters against the connector specification and return the matching authentication method specification and resource specification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_method
|
str
|
The name of the authentication method. |
required |
resource_type
|
Optional[str]
|
The type of resource being configured. |
None
|
Returns:
Type | Description |
---|---|
AuthenticationMethodModel
|
The authentication method specification and resource specification |
Optional[ResourceTypeModel]
|
for the specified authentication method and resource type. |
Raises:
Type | Description |
---|---|
KeyError
|
If the authentication method is not supported by the connector for the specified resource type and ID. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
|
set_connector_class(connector_class: Type[ServiceConnector]) -> None
Set the service connector class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connector_class
|
Type[ServiceConnector]
|
The service connector class. |
required |
Source code in src/zenml/models/v2/misc/service_connector_type.py
321 322 323 324 325 326 327 328 329 |
|
validate_auth_methods(values: List[AuthenticationMethodModel]) -> List[AuthenticationMethodModel]
classmethod
Validate that the authentication methods are unique.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
required |
Returns:
Type | Description |
---|---|
List[AuthenticationMethodModel]
|
The list of authentication methods. |
Raises:
Type | Description |
---|---|
ValueError
|
If two or more authentication method specifications share the same authentication method value. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
validate_resource_types(values: List[ResourceTypeModel]) -> List[ResourceTypeModel]
classmethod
Validate that the resource types are unique.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values
|
List[ResourceTypeModel]
|
The list of resource types. |
required |
Returns:
Type | Description |
---|---|
List[ResourceTypeModel]
|
The list of resource types. |
Raises:
Type | Description |
---|---|
ValueError
|
If two or more resource type specifications list the same resource type. |
Source code in src/zenml/models/v2/misc/service_connector_type.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
|
ServiceConnectorTypedResourcesModel
Bases: BaseModel
Service connector typed resources list.
Lists the resource instances that a service connector can provide access to.
stack_deployment
Models related to cloud stack deployments.
DeployedStack
Bases: BaseModel
Information about a deployed stack.
StackDeploymentConfig
Bases: BaseModel
Configuration about a stack deployment.
StackDeploymentInfo
Bases: BaseModel
Information about a stack deployment.
user_auth
Model definition for auth users.
UserAuthModel
Bases: BaseZenModel
Authentication Model for the User.
This model is only used server-side. The server endpoints can use this model to authenticate the user credentials (Token, Password).
get_hashed_activation_token() -> Optional[str]
Returns the hashed activation token, if configured.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed activation token. |
Source code in src/zenml/models/v2/misc/user_auth.py
139 140 141 142 143 144 145 |
|
get_hashed_password() -> Optional[str]
Returns the hashed password, if configured.
Returns:
Type | Description |
---|---|
Optional[str]
|
The hashed password. |
Source code in src/zenml/models/v2/misc/user_auth.py
131 132 133 134 135 136 137 |
|
get_password() -> Optional[str]
Get the password.
Returns:
Type | Description |
---|---|
Optional[str]
|
The password as a plain string, if it exists. |
Source code in src/zenml/models/v2/misc/user_auth.py
121 122 123 124 125 126 127 128 129 |
|
verify_activation_token(activation_token: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given activation token against the stored token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
activation_token
|
str
|
Input activation token to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the activation token is to be verified. |
None
|
Returns:
Type | Description |
---|---|
bool
|
True if the token is valid. |
Source code in src/zenml/models/v2/misc/user_auth.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
verify_password(plain_password: str, user: Optional[UserAuthModel] = None) -> bool
classmethod
Verifies a given plain password against the stored password.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plain_password
|
str
|
Input password to be verified. |
required |
user
|
Optional[UserAuthModel]
|
User for which the password is to be verified. |
None
|
Returns:
Type | Description |
---|---|
bool
|
True if the passwords match. |
Source code in src/zenml/models/v2/misc/user_auth.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|