Files
Parameters
my_files
Drive.MY_FILES).
drive()
drive in region.
Parameters
Returns
Raises
WherobotsConfigError: If no region is passed or configured.
FilesDrive
Files.drive or Files.my_files; do not build it directly.
Parameters
drive
region
storage_id
delete_directory()
Parameters
delete_file()
Parameters
download_file()
Parameters
Where to write it. An existing folder receives the file
under its drive name.
Returns
Raises
WherobotsValidationError: If the folderlocal_pathnames does not exist.WherobotsFileNotFoundError: If the drive has no file atpath.WherobotsS3Error: If the transfer from storage or the local write fails.
list_directory()
Parameters
Returns
make_directory()
Parameters
rename_file()
Parameters
upload_file()
path in the drive.
Parameters
Returns
Raises
WherobotsValidationError: If the local file is missing or over 500 MiB, orpathis not a valid file path.WherobotsS3Error: If the transfer to storage fails, storage answers other than 2xx (redirects are not followed), or the file cannot be read.
FilesAPI
Import fromwherobots.api.files.
s3:// destination path via
POST /storage/credentials. The credentials are wrapped in
botocore.credentials.RefreshableCredentials so multi-hour
multipart uploads survive the standard 1-hour STS lifetime.
Parameters
close()
dest_uri_for()
s3:// destination URI under source’s root.
Honors source’s default_directory if set, then the
optional subdir, then filename. Use the resulting URI with
upload_file when you want explicit, predictable
destinations (e.g. for a job script you intend to reference
as WherobotsJob(script=<uri>)).
Parameters
A
StorageIntegration returned from
list_integrations, resolve_integration,
or get_managed_storage.Optional path segment(s) between the source root
and the filename. Validated against the same
traversal rules as filenames.
Returns
Raises
WherobotsValidationError: On filename / subdir traversal.
from_config()
FilesAPI from a WherobotsConfig.
Parameters
Returns
get_managed_storage()
GET /storage with type == "MANAGED" that is
not read-only, which skips the WherobotsDB releases source. Cached on the
instance after the first call.
Parameters
Returns
Raises
WherobotsValidationError: If no managed source is configured.WherobotsAPIError: On HTTP failures.
get_storage_credentials()
POST /storage/credentials. The server resolves the
path against managed storage, the WherobotsDB releases bucket,
and any matching Storage Integration in that order.
Parameters
"read" (default — least privilege) or
"read_write" to also allow s3:PutObject. The
SDK’s upload paths pass "read_write" explicitly;
callers using this method directly should leave the
default unless they specifically need write access.Returns
Raises
WherobotsAPIError: On HTTP or JSON-parsing failures. The error message and attached payload are scrubbed — neither will reference any credential field even if the server replied with a partially-populated body.
list_integrations()
GET /storage).
Includes the org’s managed source (type == "MANAGED") and
any user-configured integration sources (type == "INTEGRATION").
Parameters
Returns
Raises
WherobotsAPIError: On HTTP or JSON-parsing failures.
resolve_integration()
Parameters
Returns
Raises
WherobotsValidationError: If no matching integration is found.WherobotsAPIError: On HTTP failures.
upload_dependency()
- Managed (
storage_integration=None): file lands under{managed.path}/dependencies/{filename}unlessdest_subdiris set, in which casedest_subdirreplaces the defaultdependencies/segment. - Storage Integration: file lands at
{integration.path}/{default_directory}/{dest_subdir}/{filename}(skipping any empty segment). There is no implicitdependencies/for integrations — if the integration has nodefault_directoryand nodest_subdiris supplied, the file lands at the integration root. Usedest_subdirto organize artifacts inside the integration.
Parameters
Optional integration name or ID. When
None, the file is uploaded to managed storage.Optional subdirectory under the destination
source’s root. See destination rules above. Each
segment is validated against
_validate_filename
so traversal is rejected.Returns
Raises
WherobotsValidationError: If the file path, filename, or subdir are invalid, or the storage integration is unknown.WherobotsAPIError: On credential or upload failures.
upload_file()
s3:// destination.
Fetches read_write credentials scoped to dest_uri, then runs a
boto3 multipart upload. Streams from disk — large files are not
loaded fully into memory. Credentials are wrapped in a
RefreshableCredentials so uploads exceeding the 1h STS
lifetime keep working.
Parameters
Returns
Raises
WherobotsValidationError: If the local file doesn’t exist or the URI is malformed.WherobotsAPIError: On credential fetch failure.
upload_managed_file()
{managed.path}/{subdir}/{name}.
Parameters
Returns
Raises
WherobotsValidationError: If the file path or filename are invalid, or no managed storage is configured.WherobotsAPIError: On credential or upload failures.
upload_script()
upload_managed_file under the scripts/ subdir. For
an already-on-disk file, prefer upload_managed_file
directly to avoid the temp-file roundtrip.
Parameters
Optional destination filename. Defaults to a
UUID-based name (
sdk-upload-{uuid}.py).Returns
Raises
WherobotsValidationError: If the filename is invalid.WherobotsAPIError: On credential or upload failures.

