run_datasource_dataflow¶
- DatasourcesApi.run_datasource_dataflow(datasource_id, id, role_id, content_type=None, action=None, run_datasource_dataflow_request=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Start, stop, or control a dataflow run
Runs a control action on an existing dataflow. The caller (identified by role_id) must have at least edit permission on the datasource (else AUTH-1012). Streams datasources are not supported. Supported DataflowAction values by type: JDBC Bulkload start|stop|resume| restart|terminate; JDBC Advanced Load start|terminate (optional action=reload-tables with start on full-load only); SaaS start|stop (stop not allowed for ondemand); ArcGIS start|stop.
- Parameters:
datasource_id (str) – UUID of the parent datasource. Rejected with IPV-1045 if missing. Advanced Load / ArcGIS disabled by admin return DTSC-1025. (required)
id (str) – UUID of the dataflow (DataflowId). Rejected with IPV-1045 if missing. (required)
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to with at least edit access on the datasource. (required)
content_type (str)
action (str) – JDBC Advanced Load only. Use reload-tables with DataflowAction=start on full-load dataflows to reload tables. ReloadTables is required. Other DataflowTypes ignore this query param.
run_datasource_dataflow_request (RunDatasourceDataflowRequest)
_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 /datasources/{datasource_id}/dataflows/{id}
Request¶
Request / response example
{
"DataflowAction": "start"
}
Success (HTTP 200)¶
Action accepted. Message text varies by type and action (often “…running in background”). ArcGIS start may also return DataflowId and ExecutionId. JDBC Advanced selective reload also returns ReloadTables.
Typical async start (JDBC Bulkload / Advanced / ArcGIS)
{
"Message": "Successfully triggered start dataflow and is running in background"
}
SaaS ondemand start
{
"Message": "Successfully started dataflow run"
}
JDBC Advanced Load start with action=reload-tables
{
"Message": "Successfully started selective dataflow reload and is running in background",
"ReloadTables": [
{
"SourceTable": "sales.orders",
"DatasetId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}
]
}
ArcGIS start with execution id
{
"Message": "Successfully triggered parcels_layers dataflow and is running in background",
"DataflowId": "f6a1b7c5-2d9e-8f0a-3b4c-6d7e8f9a0b1c",
"ExecutionId": "a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a"
}
Errors¶
Documented error codes: IPV-1045, AUTH-1012, IPV-1001, IPV-1002, GE-1043, DTSC-1007, GE-1034.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: IPV-1045 (missing/invalid DataflowAction, ReloadTables, or datasource/dataflow), AUTH-1012 (no edit access), IPV-1001 (invalid ArcGIS action), IPV-1002 (SaaS dataflow not found), GE-1043 (metadata update in progress on ArcGIS).
DataflowAction missing
{
"Message": "IPV-1045 - Invalid parameter - DataflowAction, value either missing or is invalid."
}
Caller lacks edit access on the datasource
{
"Message": "AUTH-1012 - User: user1 requires at least edit access on the resource to perform this action."
}
ArcGIS metadata update still in progress
{
"Message": "GE-1043 - A metadata update is in progress for this dataflow. Please wait for it to complete before performing this operation."
}
HTTP 500
Backend/operation failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: DTSC-1007 (action not allowed in current dataflow state), GE-1034 (invalid SaaS action, deleted flow, ondemand stop, or ArcGIS CDC schedule missing).
Action not allowed for current dataflow status
{
"Message": "DTSC-1007 - Datasource operation failed with error - DataflowStatus is not in running, failed, or completed state. Terminate operation is not allowed"
}
Stop not allowed for SaaS ondemand flow
{
"Message": "GE-1034 - Stop flow is not supported for ondemand type of data flows"
}