trigger_files_reload_on_dataset¶
- DatasetsApi.trigger_files_reload_on_dataset(id, role_id, files_input_obj, content_type=None, action=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Trigger dataset file reload or reprocess
Starts an asynchronous reload of selected files, or reprocess when action=reprocess. Caller must be owner or editor. Default (omit query params): for TableUpdate=reload datasets only; Files must be pending file-load keys. Append datasets → GE-1034 (“API ‘/datasets/{id}/datareloads’ not supported for append type datasets”). Concurrent load while DatasetStatus is reloading → “Dataset status is in reloading state, please wait for current load to finish”. Empty Files → IPV-1001. action=reprocess: for TableUpdate=append only (max 20 files); reload-type datasets → GE-1034 (“File reprocessing is only allowed for append type datasets”). More than 20 files → GE-1045 (“File reprocessing is only allowed for 20 files at a time”). Query params present without action=reprocess → IPV-1071. Success Messages: - Reload: “Dataset reload started successfully and is running in background” + DatasetId - Reprocess with valid files: “Files reprocessing initiated” + DatasetId - Reprocess with no valid files: “No valid files to reprocess” (Message only; DatasetId omitted)
- Parameters:
id (str) – Dataset ID to reload/reprocess files for. (required)
role_id (str) – Amorphic role ID. Caller must be owner or editor. (required)
files_input_obj (FilesInputObj) – (required)
content_type (str) – Must be application/json.
action (str) – Omit all query params for standard reload. Use reprocess for append datasets (max 20 files). Any other query without action=reprocess is rejected (IPV-1071).
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: POST /datasets/{id}/datareloads
Request¶
Request / response example
{
"Files": [
"sales/monthly_orders/upload_date=1700000000/alice_49e02003-289e-41e9-a9f2-28a733349481_1700000001_orders.csv"
]
}
Success (HTTP 200)¶
Async reload or reprocess started (or no valid reprocess files). Messages: “Dataset reload started successfully and is running in background” (+ DatasetId); “Files reprocessing initiated” (+ DatasetId); or “No valid files to reprocess” (Message only).
Standard reload started
{
"Message": "Dataset reload started successfully and is running in background",
"DatasetId": "49e02003-289e-41e9-a9f2-28a733349481"
}
Reprocess started for valid files
{
"Message": "Files reprocessing initiated",
"DatasetId": "49e02003-289e-41e9-a9f2-28a733349481"
}
Reprocess with no valid files (no DatasetId)
{
"Message": "No valid files to reprocess"
}
Errors¶
Documented error codes: GE-1034, GE-1045, IPV-1071, IPV-1001.
HTTP 400
Validation failure. GE-1034 (append vs reload mismatch, or invalid pending files), GE-1045 (>20 reprocess files), IPV-1071 (bad/missing action when query params present), IPV-1001 (empty Files), concurrent reloading Message.
Reprocess file limit
{
"Message": "GE-1045 - File reprocessing is only allowed for 20 files at a time"
}
action=reprocess on non-append dataset
{
"Message": "GE-1034 - File reprocessing is only allowed for append type datasets"
}
Standard reload on append dataset
{
"Message": "GE-1034 - API '/datasets/{id}/datareloads' not supported for append type datasets"
}
Query params without action=reprocess
{
"Message": "IPV-1071 - Invalid or missing value of action provided in request parameters, valid values are 'reprocess'"
}
Files present but empty
{
"Message": "IPV-1001 - Empty value - Files"
}
Dataset already reloading
{
"Message": "Dataset status is in reloading state, please wait for current load to finish"
}
HTTP 500
Backend/generic failure.