Asset Sources

Access asset sources through client.asset_sources in the Datature Vi SDK.

An asset source describes where the assets in a dataset originated: a direct upload, a connected S3 bucket, a cloud drive, and so on. The local upload source is created implicitly when you call client.assets.upload(), but the endpoints here let you inspect any configured source, sample a few of its assets, track its ingestion sessions, and remove sources no longer in use.

Before You Start

Get started with the Vi SDK →

The Source Triple

Sources are addressed by a (class, provider, id) triple. Assets uploaded through the built-in flow use LocalProvider / DirectUpload / <source_id>.


Methods

list()

List asset sources configured on a dataset.

for src in client.asset_sources.list("dataset_abc123").all_items():
    print(src["assetSourceId"], src.get("kind"))

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required

Returns: PaginatedResponse[dict]. A page of asset-source documents.


get()

Fetch a single asset source by its (class, provider, id) triple.

source = client.asset_sources.get(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
)

print(source)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class, for example 'LocalProvider'.
Required
asset_source_provider
string
Source provider, for example 'DirectUpload'.
Required
asset_source_id
string
Source identifier within the class and provider.
Required

Returns: dict. The asset-source document.


sample()

Fetch a sample of assets from an asset source. Useful for confirming a connected bucket resolves to the files you expect before ingesting everything.

sample = client.asset_sources.sample(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
)

print(sample)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class.
Required
asset_source_provider
string
Source provider.
Required
asset_source_id
string
Source identifier.
Required

Returns: dict. Sample payload. The exact shape depends on the source connector, but typically includes a list of preview assets.


list_ingestion_sessions()

List ingestion sessions belonging to an asset source.

These mirror the sessions created internally when uploading via client.assets.upload(), exposed so you can inspect the history or build your own dashboards.

sessions = client.asset_sources.list_ingestion_sessions(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
)

for session in sessions.all_items():
    print(session)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class.
Required
asset_source_provider
string
Source provider.
Required
asset_source_id
string
Source identifier.
Required

Returns: PaginatedResponse[dict]. A page of ingestion-session documents.


get_ingestion_session()

Fetch a specific ingestion session by ID.

session = client.asset_sources.get_ingestion_session(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
    asset_ingestion_session_id="ais_123",
)

print(session)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class.
Required
asset_source_provider
string
Source provider.
Required
asset_source_id
string
Source identifier.
Required
asset_ingestion_session_id
string
Ingestion session identifier.
Required

Returns: dict. The ingestion-session document.


cancel_ingestion_session()

Cancel an in-flight ingestion session.

client.asset_sources.cancel_ingestion_session(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
    asset_ingestion_session_id="ais_123",
)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class.
Required
asset_source_provider
string
Source provider.
Required
asset_source_id
string
Source identifier.
Required
asset_ingestion_session_id
string
Ingestion session identifier.
Required

Returns: dict. The cancellation response document.


delete()

Delete an asset source.

Assets Are Kept

This removes the source configuration only. Assets already ingested from the source remain in the dataset.

client.asset_sources.delete(
    dataset_id="dataset_abc123",
    asset_source_class="LocalProvider",
    asset_source_provider="DirectUpload",
    asset_source_id="src_xyz",
)

Parameters

Name
Type
Description
Required
Default
dataset_id
string
Owning dataset.
Required
asset_source_class
string
Source class.
Required
asset_source_provider
string
Source provider.
Required
asset_source_id
string
Source identifier.
Required

Returns: DeletedResource. Confirmation of deletion.


Response format

Asset sources are returned as plain dictionaries mirroring the platform's documents.

Common fields

Name
Type
Description
Required
Default
assetSourceId
string
Unique source identifier
Optional
kind
string
Source kind, reflecting the class and provider
Optional
spec
object
Connector configuration for the source
Optional
metadata
object
Creation and update timestamps
Optional

Related resources

Assets API

Upload, download, list, and delete asset files within a dataset.

Sync From External Buckets

Connect S3, GCS, Azure, or MinIO as a dataset asset source.

Folders API

Organize dataset assets into a browsable virtual tree.

Datasets API

List, get, export, download, and delete datasets.


Did this page help you?