Skip to content

Deployment

fastagency.studio.models.deployments.deployment.Deployment #

Bases: Model

fly_app_name instance-attribute #

fly_app_name: str

fly_token instance-attribute #

fly_token: FlyTokenRef

gh_token instance-attribute #

gh_token: GitHubTokenRef

name instance-attribute #

name: str

repo_name instance-attribute #

repo_name: str

team instance-attribute #

team: team_type_refs

create_autogen async classmethod #

create_autogen(
    model_id: UUID, user_id: UUID, **kwargs: Any
) -> Any
Source code in fastagency/studio/models/deployments/deployment.py
@classmethod
async def create_autogen(cls, model_id: UUID, user_id: UUID, **kwargs: Any) -> Any:
    raise NotImplementedError

from_db async classmethod #

from_db(model_id: UUID) -> T
Source code in fastagency/studio/models/base.py
@classmethod
async def from_db(cls: type[T], model_id: UUID) -> T:
    my_model_dict = await DefaultDB.backend().find_model(model_id)
    my_model = cls(**my_model_dict["json_str"])

    return my_model

get_reference_model classmethod #

get_reference_model() -> Type[ObjectReference]
Source code in fastagency/studio/models/base.py
@classmethod
def get_reference_model(cls) -> "Type[ObjectReference]":
    if cls._reference_model is None:
        raise ValueError("reference model not set")
    return cls._reference_model

validate_fly_app_name classmethod #

validate_fly_app_name(value: Any) -> Any
Source code in fastagency/studio/models/deployments/deployment.py
@field_validator("fly_app_name")
@classmethod
def validate_fly_app_name(cls: type["Deployment"], value: Any) -> Any:
    if not re.match(r"^[a-zA-Z][a-zA-Z0-9\- ]*$", value):
        raise ValueError(
            "Fly.io app name must contain only letters, numbers, spaces, dashes and should not start with a numeric literal. Example of a valid name: my-fly-app"
        )
    return value

validate_repo_name classmethod #

validate_repo_name(value: Any) -> Any
Source code in fastagency/studio/models/deployments/deployment.py
@field_validator("repo_name")
@classmethod
def validate_repo_name(cls: type["Deployment"], value: Any) -> Any:
    if not re.match(r"^[A-Za-z0-9._-]+$", value):
        raise ValueError(
            "The repository name can only contain ASCII letters, digits, and the characters ., -, and _. Example of a valid name: my-fa-repo"
        )
    return value