curl --request PUT \
--url https://api.example.com/artifacts/{artifact_type}/{id} \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"metadata.name": "<string>",
"metadata.id": "<string>",
"metadata.type": "<string>"
},
"data": {
"data.url": "<string>",
"data.download_url": "<string>"
}
}
'{
"metadata": {
"metadata.name": "<string>",
"metadata.id": "<string>",
"metadata.type": "<string>"
},
"data": {
"data.url": "<string>",
"data.download_url": "<string>"
}
}Update artifact source URL and metadata
curl --request PUT \
--url https://api.example.com/artifacts/{artifact_type}/{id} \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"metadata.name": "<string>",
"metadata.id": "<string>",
"metadata.type": "<string>"
},
"data": {
"data.url": "<string>",
"data.download_url": "<string>"
}
}
'{
"metadata": {
"metadata.name": "<string>",
"metadata.id": "<string>",
"metadata.type": "<string>"
},
"data": {
"data.url": "<string>",
"data.download_url": "<string>"
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GingerlyData247/SOTeam4-P2/llms.txt
Use this file to discover all available pages before exploring further.
PUT /artifacts/{artifact_type}/{id}
model - Machine learning modeldataset - Training or evaluation datasetcode - Code repository or scriptsource_uri - The source URL of the artifact (from data.url)metadata.source_uri - Same URL stored in metadatametadata.download_url - Pre-signed download URL (if provided)400 - ID mismatch between path and request body404 - Artifact not found500 - Internal server errorid in the URL path matches the metadata.id in the request body:
if body.metadata.id != id:
raise HTTPException(
status_code=400,
detail="Name/id mismatch in artifact update."
)
curl -X PUT https://api.example.com/artifacts/model/12345 \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"name": "BERT Base Uncased",
"id": "12345",
"type": "model"
},
"data": {
"url": "https://huggingface.co/google-bert/bert-base-uncased-v2"
}
}'
{
"metadata": {
"name": "BERT Base Uncased",
"id": "12345",
"type": "model"
},
"data": {
"url": "https://huggingface.co/google-bert/bert-base-uncased-v2",
"download_url": "https://s3.amazonaws.com/bucket/artifacts/model/12345.zip?signature=..."
}
}
{
"data": {
"url": "https://huggingface.co/google-bert/bert-large-uncased"
}
}
{
"data": {
"url": "https://huggingface.co/google-bert/bert-base-uncased",
"download_url": "https://s3.amazonaws.com/bucket/model.zip?signature=NEW_SIG"
}
}
{
"data": {
"url": "https://new-storage.example.com/datasets/squad",
"download_url": "https://new-storage.example.com/downloads/squad.zip"
}
}
/home/daytona/workspace/source/src/api/routers/models.py:1152:
@router.put("/artifacts/{artifact_type}/{id}", response_model=Artifact)
def artifact_update(artifact_type: str, id: str, body: Artifact):
# Validate ID match
if body.metadata.id != id:
raise HTTPException(status_code=400, ...)
# Fetch existing artifact
item = _registry.get(id)
if not item:
raise HTTPException(status_code=404, ...)
# Update URLs
item["source_uri"] = body.data.url
meta = item.setdefault("metadata", {})
meta["source_uri"] = body.data.url
if body.data.download_url is not None:
meta["download_url"] = body.data.download_url
return Artifact(...)