pydo.harness.create_session_workspace_transfer()

Generated on 13 Nov 2026 from pydo version v0.46.0

Usage

client.harness.create_session_workspace_transfer(
    session_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    body={
        "direction": "upload",
        "path": "example",
        "is_archive": True,
        ...,
    },
)
Returns JSON Raises HttpResponseError

Description

Creates an asynchronous, object-storage-backed transfer for payloads larger than the streaming path supports (> ~50 MiB). Bulk bytes never traverse harness-api: the client PUTs/GETs presigned DO Spaces URLs directly.

Set direction to upload or download.

  • upload: responds 201 with transfer_id + part_size; the client then requests per-part presigned PUT URLs, uploads them to Spaces, and calls commit.
  • download: responds 202 with transfer_id; the client polls GET until completed and then fetches download_url from Spaces.

Upload, download, and cancel are live.

Parameters

session_id string required

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

The session UUID.

direction string required

Transfer direction.

One of: upload, download

path string required

Example: example

Workspace-relative path. Destination for upload, source for download. Paths that escape the workspace root are rejected.

is_archive boolean optional

Example: True

Upload only. When true, the payload is a tar the guest extracts at path.

as_archive boolean optional

Example: True

Download only. When true, path is exported as a tar stream.

size_bytes integer optional

Example: 4

Optional total payload size, as a JSON number. Validated against the maximum staged object size (50 GiB); a larger value returns 413.

sha256 string optional

Example: example

Optional lowercase hex SHA-256 of the full payload. If set on an upload, it must match on commit.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "direction": "upload",
  "path": "example",
  "is_archive": True,
  "as_archive": True,
  "size_bytes": 4,
  "sha256": "example"
}

resp = client.harness.create_session_workspace_transfer(session_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", body=req)

Response Example

Show Response Example
{
  "transfer_id": "example",
  "direction": "upload",
  "status": "pending",
  "upload_id": "example",
  "part_size": 1,
  "expires_at": "2026-07-27T12:00:00Z"
}

More Information

See /v2/agents/sessions/{session_id}/workspace/transfers in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.