from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# Upload file from sandbox to disk
artifact = client.disks.artifacts.upload_from_sandbox(
disk_id='disk-uuid',
sandbox_id='sandbox-uuid',
sandbox_path='/home/user/',
sandbox_filename='output.txt',
file_path='/results/'
)
print(f"Created: {artifact.path}{artifact.filename}"){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"created_at": "<string>",
"disk_id": "<string>",
"filename": "<string>",
"meta": {},
"path": "<string>",
"updated_at": "<string>"
}
}Upload a file from a sandbox environment to disk storage as an artifact
from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# Upload file from sandbox to disk
artifact = client.disks.artifacts.upload_from_sandbox(
disk_id='disk-uuid',
sandbox_id='sandbox-uuid',
sandbox_path='/home/user/',
sandbox_filename='output.txt',
file_path='/results/'
)
print(f"Created: {artifact.path}{artifact.filename}"){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"created_at": "<string>",
"disk_id": "<string>",
"filename": "<string>",
"meta": {},
"path": "<string>",
"updated_at": "<string>"
}
}Project Bearer token (e.g., "Bearer sk-ac-xxxx")
Disk ID
Upload from sandbox request