Skip to content

Commit 6d7c3a3

Browse files
committed
undo wrong files
1 parent b69b45b commit 6d7c3a3

File tree

2 files changed

+28
-30
lines changed

2 files changed

+28
-30
lines changed

services/api-server/src/simcore_service_api_server/models/schemas/files.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ class ClientFile(BaseModel):
3737
filename: FileName = Field(..., description="File name")
3838
filesize: NonNegativeInt = Field(..., description="File size in bytes")
3939
sha256_checksum: SHA256Str = Field(..., description="SHA256 checksum")
40-
destination: Annotated[
41-
ProgramJobFilePath | None,
42-
Field(..., description="Destination within a program job"),
43-
]
4440

4541

4642
class File(BaseModel):
4743
"""Represents a file stored on the server side i.e. a unique reference to a file in the cloud."""
4844

49-
id: Annotated[UUID, Field(description="Resource identifier")]
50-
filename: Annotated[str, Field(description="Name of the file with extension")]
51-
content_type: Annotated[
52-
str | None,
53-
Field(
54-
description="Guess of type content [EXPERIMENTAL]", validate_default=True
55-
),
56-
] = None
57-
sha256_checksum: Annotated[
58-
SHA256Str | None,
59-
Field(description="SHA256 hash of the file's content", alias="checksum"),
60-
] = None
61-
e_tag: Annotated[ETag | None, Field(description="S3 entity tag")] = None
45+
# WARNING: from pydantic import File as FileParam
46+
# NOTE: see https://ant.apache.org/manual/Tasks/checksum.html
47+
48+
id: UUID = Field(..., description="Resource identifier")
49+
50+
filename: str = Field(..., description="Name of the file with extension")
51+
content_type: str | None = Field(
52+
default=None,
53+
description="Guess of type content [EXPERIMENTAL]",
54+
validate_default=True,
55+
)
56+
sha256_checksum: SHA256Str | None = Field(
57+
default=None,
58+
description="SHA256 hash of the file's content",
59+
alias="checksum", # alias for backwards compatibility
60+
)
61+
e_tag: ETag | None = Field(default=None, description="S3 entity tag")
6262

6363
model_config = ConfigDict(
6464
populate_by_name=True,
@@ -163,18 +163,16 @@ def quoted_storage_file_id(self) -> str:
163163

164164

165165
class UploadLinks(BaseModel):
166-
abort_upload: Annotated[str, Field()]
167-
complete_upload: Annotated[str, Field()]
166+
abort_upload: str
167+
complete_upload: str
168168

169169

170170
class FileUploadData(BaseModel):
171-
chunk_size: Annotated[int, Field(description="Chunk size in bytes")]
172-
urls: Annotated[list[Annotated[AnyHttpUrl, UriSchema()]], Field()]
173-
links: Annotated[UploadLinks, Field()]
171+
chunk_size: NonNegativeInt
172+
urls: list[Annotated[AnyHttpUrl, UriSchema()]]
173+
links: UploadLinks
174174

175175

176176
class ClientFileUploadData(BaseModel):
177-
file_id: Annotated[UUID, Field(description="The file resource id")]
178-
upload_schema: Annotated[
179-
FileUploadData, Field(description="Schema for uploading file")
180-
]
177+
file_id: UUID = Field(..., description="The file resource id")
178+
upload_schema: FileUploadData = Field(..., description="Schema for uploading file")

services/api-server/src/simcore_service_api_server/services_http/webserver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ async def _page_projects(
186186
limit: int,
187187
offset: int,
188188
show_hidden: bool,
189-
job_parent_resource_name: str | None = None,
189+
search_by_project_name: str | None = None,
190190
) -> Page[ProjectGet]:
191191
assert 1 <= limit <= MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE # nosec
192192
assert offset >= 0 # nosec
193193

194194
optional: dict[str, Any] = {}
195-
if job_parent_resource_name is not None:
195+
if search_by_project_name is not None:
196196
optional["filters"] = json_dumps(
197-
{"job_parent_resource_name": job_parent_resource_name}
197+
{"search_by_project_name": search_by_project_name}
198198
)
199199

200200
with service_exception_handler(
@@ -361,7 +361,7 @@ async def get_projects_w_solver_page(
361361
limit=limit,
362362
offset=offset,
363363
show_hidden=True,
364-
job_parent_resource_name=solver_name,
364+
search_by_project_name=solver_name,
365365
)
366366

367367
async def get_projects_page(self, *, limit: int, offset: int):

0 commit comments

Comments
 (0)