Skip to content

artifact_model

mlte/backend/api/models/artifact_model.py

Model implementations for artifact store intermediaries for the API.

NOTE(Kyle): I am unsure as to how I want to refactor the API to account for additional meta-models like these. This worked well for write request; should the other endpoints be refactored to look more like this one?

USER_ME_ID = 'me' module-attribute

Special ID used to identify the currently logged in user.

WriteArtifactRequest

Bases: BaseModel

Defines the data in a POST request to write an artifact.

Source code in mlte/backend/api/models/artifact_model.py
18
19
20
21
22
23
24
25
26
27
28
class WriteArtifactRequest(BaseModel):
    """Defines the data in a POST request to write an artifact."""

    artifact: ArtifactModel
    """The model for the artifact to write."""

    force: bool = False
    """Indicates that existing artifacts may be overwritten."""

    parents: bool = False
    """Indicates whether organizational elements should be created."""

artifact instance-attribute

The model for the artifact to write.

force = False class-attribute instance-attribute

Indicates that existing artifacts may be overwritten.

parents = False class-attribute instance-attribute

Indicates whether organizational elements should be created.

WriteArtifactResponse

Bases: BaseModel

Defines the data in a response to writing an artifact.

Source code in mlte/backend/api/models/artifact_model.py
31
32
33
34
35
class WriteArtifactResponse(BaseModel):
    """Defines the data in a response to writing an artifact."""

    artifact: ArtifactModel
    """The model for the artifact that was written."""

artifact instance-attribute

The model for the artifact that was written.