Skip to content

Commit

Permalink
Document protocol key.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Feb 23, 2024
1 parent 05be780 commit 820a303
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion robot-server/robot_server/protocols/protocol_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,10 @@ class Protocol(ResourceModel):
),
)

key: Optional[str] = None
key: Optional[str] = Field(
None,
description=(
"An arbitrary client-defined string, set when this protocol was uploaded."
" See `POST /protocols`."
),
)
11 changes: 10 additions & 1 deletion robot-server/robot_server/protocols/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,16 @@ async def create_protocol(
files: List[UploadFile] = File(...),
# use Form because request is multipart/form-data
# https://fastapi.tiangolo.com/tutorial/request-forms-and-files/
key: Optional[str] = Form(None),
key: Optional[str] = Form(
default=None,
description=(
"An arbitrary client-defined string to attach to the new protocol resource."
" This should be no longer than ~100 characters or so."
" It's intended to store something like a UUID, to help clients that store"
" protocols locally keep track of which local files correspond to which"
" protocol resources on the robot."
),
),
protocol_directory: Path = Depends(get_protocol_directory),
protocol_store: ProtocolStore = Depends(get_protocol_store),
analysis_store: AnalysisStore = Depends(get_analysis_store),
Expand Down

0 comments on commit 820a303

Please sign in to comment.