repository_service_tuf_worker.models.targets package
Submodules
repository_service_tuf_worker.models.targets.crud module
- repository_service_tuf_worker.models.targets.crud.create_file(db: Session, target_file: RSTUFTargetFileCreate, target_role: RSTUFTargetRoles) RSTUFTargetFiles [source]
Create a new Target file in the DB.
- repository_service_tuf_worker.models.targets.crud.create_roles(db: Session, target_roles: List[RSTUFTargetRoleCreate]) List[RSTUFTargetRoles] [source]
Create a new set of Target roles in the DB.
- repository_service_tuf_worker.models.targets.crud.read_all_roles(db: Session) List[RSTUFTargetRoles] [source]
Read a all Target bin roles.
- repository_service_tuf_worker.models.targets.crud.read_file_by_path(db: Session, path: str) Optional[RSTUFTargetFiles] [source]
Read a Target File by a given path (unique value).
- repository_service_tuf_worker.models.targets.crud.read_role_by_rolename(db: Session, rolename: str) Optional[RSTUFTargetRoles] [source]
Read a Target role by a given role name.
- repository_service_tuf_worker.models.targets.crud.read_roles_joint_files(db: Session, rolenames: List[str]) List[RSTUFTargetRoles] [source]
Read all roles with a name in ‘rolenames’ joining with RSTUFTargetFiles database in the process.
- repository_service_tuf_worker.models.targets.crud.read_roles_with_unpublished_files(db: Session) List[Tuple[str]] [source]
Read Target Roles containing unpublished Target Files.
- repository_service_tuf_worker.models.targets.crud.update_file_action_to_remove(db: Session, target: RSTUFTargetFiles) RSTUFTargetFiles [source]
Update Target File action attribute to REMOVE.
- repository_service_tuf_worker.models.targets.crud.update_file_path_and_info(db: Session, target: RSTUFTargetFiles, new_path: str, new_info: Dict[str, Any]) RSTUFTargetFiles [source]
Update a Target (path and info)
repository_service_tuf_worker.models.targets.models module
repository_service_tuf_worker.models.targets.schemas module
- class repository_service_tuf_worker.models.targets.schemas.RSTUFTargetFileCreate(*, path: str, info: Dict[str, Any], published: bool, action: TargetAction, last_update: Optional[datetime] = datetime.datetime(2024, 1, 30, 12, 4, 55, 806511))[source]
Bases:
BaseModel
- action: TargetAction
- info: Dict[str, Any]
- last_update: Optional[datetime]
- model_config: ClassVar[ConfigDict] = {'orm_mode': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'action': FieldInfo(annotation=TargetAction, required=True), 'info': FieldInfo(annotation=Dict[str, Any], required=True), 'last_update': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=datetime.datetime(2024, 1, 30, 12, 4, 55, 806511)), 'path': FieldInfo(annotation=str, required=True), 'published': FieldInfo(annotation=bool, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- path: str
- published: bool
- class repository_service_tuf_worker.models.targets.schemas.RSTUFTargetRoleCreate(*, rolename: str, version: int)[source]
Bases:
BaseModel
- model_config: ClassVar[ConfigDict] = {'orm_mode': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'rolename': FieldInfo(annotation=str, required=True), 'version': FieldInfo(annotation=int, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- rolename: str
- version: int