= dmda.DomoTokenAuth(
token_auth =os.environ['DOMO_INSTANCE'],
domo_instance=os.environ["DOMO_ACCESS_TOKEN"],
domo_access_token )
Dataflow Routes
CRUD_Dataflow_Error
CRUD_Dataflow_Error (res:domolibrary.client.ResponseGetData.ResponseGetD ata)
base exception
GET_Dataflow_Error
GET_Dataflow_Error (res:domolibrary.client.ResponseGetData.ResponseGetDa ta)
base exception
get_dataflows
get_dataflows (auth:domolibrary.client.DomoAuth.DomoAuth, debug_api:bool=False, session:httpx.AsyncClient=None, parent_class:str=None, debug_num_stacks_to_drop=1)
= (await get_dataflows( auth=token_auth)).response
dataflows
0] dataflows[
{'id': 127,
'name': '@Zel ETL',
'dapDataFlowId': '7daa2a4b-4b9f-47b1-be0a-c886889769f5',
'responsibleUserId': 966365811,
'runState': 'ENABLED',
'lastExecution': {'id': 662396,
'onboardFlowId': 127,
'previewRows': 0,
'dapDataFlowExecutionId': '1a6c2265-fde8-4a88-9173-0b71a09f6840',
'beginTime': 1739893664000,
'endTime': 1739893674000,
'lastUpdated': 1739893674000,
'failed': False,
'state': 'SUCCESS',
'dataFlowVersion': 0},
'created': 1676563974000,
'modified': 1676563975000,
'engineProperties': {'kettle.mode': 'STRICT'},
'inputs': [{'dataSourceId': '864c1409-461e-46fc-b4b3-0ed644903782',
'executeFlowWhenUpdated': True,
'advancedExecuteFlowWhenUpdated': False,
'dataSourceName': '@Zel Dojo'}],
'outputs': [{'onboardFlowId': None,
'dataSourceId': '81121c6d-61c8-4723-b558-a90d16c1e10a',
'dataSourceName': '@Zel output',
'versionChainType': 'REPLACE'}],
'executionCount': 370,
'executionSuccessCount': 370,
'hydrationState': 'DEHYDRATED',
'useLegacyTriggerBehavior': False,
'passwordProtected': False,
'deleted': False,
'abandoned': False,
'neverAbandon': False,
'paused': False,
'enabled': True,
'restricted': False,
'subsetProcessing': False,
'container': False,
'databaseType': 'MAGIC',
'triggeredByInput': True,
'draft': False,
'editable': True,
'numInputs': 1,
'numOutputs': 1,
'magic': True}
get_dataflow_by_id
get_dataflow_by_id (dataflow_id:int, auth:domolibrary.client.DomoAuth.DomoAuth, debug_api:bool=False, session:httpx.AsyncClient=None, parent_class:str=None, debug_num_stacks_to_drop=1)
Sample implementation of get_dataflow_by_id
= dataflows[0]['id']
dataflow_id
= await get_dataflow_by_id(dataflow_id=dataflow_id, auth=token_auth)
res
res.response.keys()
= []
all_keys for action in res.response.get("actions"):
pprint(action)
list(set(all_keys))
{'dataSourceId': '864c1409-461e-46fc-b4b3-0ed644903782',
'executeFlowWhenUpdated': True,
'gui': {'color': 3238043,
'colorSource': None,
'sampleJson': None,
'x': 36,
'y': 180},
'id': '6d9d3106-a084-481d-a69d-74840f17d018',
'name': '@Zel Dojo',
'onlyLoadNewVersions': False,
'pseudoDataSource': False,
'truncateRows': False,
'truncateTextColumns': False,
'type': 'LoadFromVault'}
{'dependsOn': ['6d9d3106-a084-481d-a69d-74840f17d018'],
'filterList': [{'andFilterList': [{'andFilterList': [],
'expression': None,
'leftField': 'alarmAction',
'operator': 'EQ',
'rightExpr': None,
'rightField': None,
'rightValue': {'type': 'STRING',
'value': 'Disregard'}}],
'expression': None,
'leftField': 'alarmDescription',
'operator': 'EQ',
'rightExpr': None,
'rightField': None,
'rightValue': {'type': 'STRING',
'value': 'Lost Connectivity'}}],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 144,
'y': 288},
'id': '49f0cb44-56bb-4e19-ae8b-b83be193e3c6',
'name': 'LostConnectivity and Disregard',
'type': 'Filter'}
{'addLineNumber': False,
'allRows': False,
'dependsOn': ['49f0cb44-56bb-4e19-ae8b-b83be193e3c6'],
'fields': [{'expression': None,
'name': 'Count',
'settings': None,
'source': 'alarmID',
'type': 'COUNT_ALL',
'valuefield': None}],
'giveBackRow': False,
'groups': [{'name': 'alarmID'}],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 264,
'y': 288},
'id': 'b8d8da16-2db0-4d88-9287-b349901d7d54',
'name': 'Group By',
'type': 'GroupBy'}
{'dependsOn': ['b8d8da16-2db0-4d88-9287-b349901d7d54'],
'fields': [{'expr': None,
'name': 'FilterCriteria',
'type': 'STRING',
'value': 'exclude'}],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 372,
'y': 288},
'id': '2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5',
'name': 'Add Constants',
'type': 'Constant'}
{'dependsOn': ['6d9d3106-a084-481d-a69d-74840f17d018',
'2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5'],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 492,
'y': 180},
'id': 'e9e76a06-7a82-429a-bb3f-f1e912e1d6bc',
'joinType': 'LEFT OUTER',
'keys1': ['alarmID'],
'keys2': ['alarmID'],
'name': 'Join Data',
'schemaModification2': [{'name': 'alarmID', 'remove': True, 'rename': ''},
{'name': 'Count', 'remove': True, 'rename': ''}],
'step1': '6d9d3106-a084-481d-a69d-74840f17d018',
'step2': '2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5',
'type': 'MergeJoin'}
{'dependsOn': ['e9e76a06-7a82-429a-bb3f-f1e912e1d6bc'],
'expressions': [{'expression': "IFNULL(`FilterCriteria`,'include')",
'fieldName': 'FilterCriteria',
'settings': None}],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 600,
'y': 180},
'id': '9a80fd0d-33fb-4085-a20a-3ab856f5a762',
'name': 'Add Formula',
'type': 'ExpressionEvaluator'}
{'dataSource': {'guid': '81121c6d-61c8-4723-b558-a90d16c1e10a',
'name': '@Zel output',
'type': 'DataFlow'},
'dependsOn': ['9a80fd0d-33fb-4085-a20a-3ab856f5a762'],
'gui': {'color': None,
'colorSource': None,
'sampleJson': None,
'x': 708,
'y': 180},
'id': 'f32d6203-2ab9-42b0-b44b-f0ee823202f3',
'name': '@Zel output',
'partitioned': False,
'schemaSource': 'DATAFLOW',
'type': 'PublishToVault',
'versionChainType': 'REPLACE'}
[]
generate_tag_body
generate_tag_body (dataflow_id, tag_ls)
= next((tag for tag in df_tags if tag.startswith('dl_')), None)
dl_tag
if dl_tag in df_tags:
df_tags.remove(dl_tag)
= f"dl_updated - {dt.date.today()}"
dl_tag += [dl_tag]
df_tags
await put_dataflow_tags_by_id(
(= token_auth,
auth = dataflow_id,
dataflow_id = df_tags
tag_ls )).response
{'flowId': 127, 'tags': ['dl_updated - 2025-02-21']}
Dataflow History
get_dataflow_versions
get_dataflow_versions (dataflow_id:int, auth:domolibrary.client.DomoAuth.DomoAuth, parent_class:str=None, session:httpx.AsyncClient=None, debug_num_stacks_to_drop=1, debug_api:bool=False)
= dmda.DomoTokenAuth(
token_auth =os.environ['DOMO_INSTANCE'],
domo_instance=os.environ["DOMO_ACCESS_TOKEN"],
domo_access_token
)
await get_dataflow_versions(dataflow_id=dataflow_id, auth=token_auth)).response[0:5] (
[{'id': 509,
'onboardFlowId': 127,
'timeStamp': 1676563975000,
'authorId': 966365811,
'numInputs': 1,
'numOutputs': 1,
'executionCount': 370,
'executionSuccessCount': 370,
'versionNumber': 1}]
get_dataflow_by_id_and_version
get_dataflow_by_id_and_version (dataflow_id:int, version_id:int, auth:domolibrary.client.DomoAuth.DomoAuth , parent_class:str=None, session:httpx.AsyncClient=None, debug_num_stacks_to_drop=1, debug_api:bool=False)
= (
versions await get_dataflow_versions(dataflow_id=dataflow_id, auth=token_auth)
).response
await get_dataflow_by_id_and_version(
(=dataflow_id,
dataflow_id=versions[0]["id"],
version_id=token_auth,
auth=False,
debug_api )).response
{'id': 509,
'onboardFlowId': 127,
'timeStamp': 1676563975000,
'authorId': 966365811,
'numInputs': 1,
'numOutputs': 1,
'executionCount': 370,
'executionSuccessCount': 370,
'versionNumber': 1,
'dataFlow': {'id': 127,
'name': '@Zel ETL',
'dapDataFlowId': '7daa2a4b-4b9f-47b1-be0a-c886889769f5',
'responsibleUserId': 966365811,
'runState': 'ENABLED',
'created': 1676563974012,
'modified': 1676563974012,
'actions': [{'type': 'LoadFromVault',
'id': '6d9d3106-a084-481d-a69d-74840f17d018',
'name': '@Zel Dojo',
'gui': {'x': 36,
'y': 180,
'color': 3238043,
'colorSource': None,
'sampleJson': None},
'dataSourceId': '864c1409-461e-46fc-b4b3-0ed644903782',
'executeFlowWhenUpdated': True,
'pseudoDataSource': False,
'truncateTextColumns': False,
'truncateRows': False,
'onlyLoadNewVersions': False},
{'type': 'Filter',
'id': '49f0cb44-56bb-4e19-ae8b-b83be193e3c6',
'name': 'LostConnectivity and Disregard',
'dependsOn': ['6d9d3106-a084-481d-a69d-74840f17d018'],
'gui': {'x': 144,
'y': 288,
'color': None,
'colorSource': None,
'sampleJson': None},
'filterList': [{'leftField': 'alarmDescription',
'rightField': None,
'rightValue': {'value': 'Lost Connectivity', 'type': 'STRING'},
'rightExpr': None,
'operator': 'EQ',
'expression': None,
'andFilterList': [{'leftField': 'alarmAction',
'rightField': None,
'rightValue': {'value': 'Disregard', 'type': 'STRING'},
'rightExpr': None,
'operator': 'EQ',
'expression': None,
'andFilterList': []}]}]},
{'type': 'GroupBy',
'id': 'b8d8da16-2db0-4d88-9287-b349901d7d54',
'name': 'Group By',
'dependsOn': ['49f0cb44-56bb-4e19-ae8b-b83be193e3c6'],
'gui': {'x': 264,
'y': 288,
'color': None,
'colorSource': None,
'sampleJson': None},
'addLineNumber': False,
'giveBackRow': False,
'allRows': False,
'groups': [{'name': 'alarmID'}],
'fields': [{'name': 'Count',
'source': 'alarmID',
'type': 'COUNT_ALL',
'valuefield': None,
'expression': None,
'settings': None}]},
{'type': 'Constant',
'id': '2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5',
'name': 'Add Constants',
'dependsOn': ['b8d8da16-2db0-4d88-9287-b349901d7d54'],
'gui': {'x': 372,
'y': 288,
'color': None,
'colorSource': None,
'sampleJson': None},
'fields': [{'type': 'STRING',
'name': 'FilterCriteria',
'value': 'exclude',
'expr': None}]},
{'type': 'MergeJoin',
'id': 'e9e76a06-7a82-429a-bb3f-f1e912e1d6bc',
'name': 'Join Data',
'dependsOn': ['6d9d3106-a084-481d-a69d-74840f17d018',
'2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5'],
'gui': {'x': 492,
'y': 180,
'color': None,
'colorSource': None,
'sampleJson': None},
'joinType': 'LEFT OUTER',
'step1': '6d9d3106-a084-481d-a69d-74840f17d018',
'step2': '2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5',
'keys1': ['alarmID'],
'keys2': ['alarmID'],
'schemaModification2': [{'name': 'alarmID', 'rename': '', 'remove': True},
{'name': 'Count', 'rename': '', 'remove': True}]},
{'type': 'ExpressionEvaluator',
'id': '9a80fd0d-33fb-4085-a20a-3ab856f5a762',
'name': 'Add Formula',
'dependsOn': ['e9e76a06-7a82-429a-bb3f-f1e912e1d6bc'],
'gui': {'x': 600,
'y': 180,
'color': None,
'colorSource': None,
'sampleJson': None},
'expressions': [{'expression': "IFNULL(`FilterCriteria`,'include')",
'fieldName': 'FilterCriteria',
'settings': None}]},
{'type': 'PublishToVault',
'id': 'f32d6203-2ab9-42b0-b44b-f0ee823202f3',
'name': '@Zel output',
'dependsOn': ['9a80fd0d-33fb-4085-a20a-3ab856f5a762'],
'gui': {'x': 708,
'y': 180,
'color': None,
'colorSource': None,
'sampleJson': None},
'dataSource': {'guid': '81121c6d-61c8-4723-b558-a90d16c1e10a',
'type': 'DataFlow',
'name': '@Zel output'},
'versionChainType': 'REPLACE',
'schemaSource': 'DATAFLOW',
'partitioned': False}],
'engineProperties': {'kettle.mode': 'STRICT'},
'hydrationState': 'DEHYDRATED',
'useLegacyTriggerBehavior': False,
'passwordProtected': False,
'deleted': False,
'abandoned': False,
'neverAbandon': False,
'settings': {'collation': 'BINARY'},
'paused': False,
'enabled': True,
'restricted': False,
'container': False,
'subsetProcessing': False,
'databaseType': 'MAGIC',
'triggeredByInput': False,
'onboardFlowVersion': {'id': 0,
'numInputs': 0,
'numOutputs': 0,
'executionCount': 0,
'executionSuccessCount': 0,
'versionNumber': 0},
'draft': False,
'editable': True,
'numInputs': 0,
'numOutputs': 0,
'magic': True}}
get_dataflow_execution_history
get_dataflow_execution_history (dataflow_id:int, auth:domolibrary.client.DomoAuth.DomoAuth , maximum:int=None, parent_class:str=None, session:httpx.AsyncClient=None, debug_num_stacks_to_drop=1, debug_loop:bool=False, debug_api:bool=False)
sample implementation of get_dataflow_execution_history
await get_dataflow_execution_history(dataflow_id=dataflow_id, maximum=2, auth=token_auth)).response[0] (
{'id': 662396,
'onboardFlowId': 127,
'previewRows': 0,
'dapDataFlowExecutionId': '1a6c2265-fde8-4a88-9173-0b71a09f6840',
'beginTime': 1739893664000,
'endTime': 1739893674000,
'lastUpdated': 1739893674000,
'failed': False,
'state': 'SUCCESS',
'activationType': 'MANUAL',
'dataProcessor': 'MAGIC',
'inputDataSources': [{'dataSourceId': '864c1409-461e-46fc-b4b3-0ed644903782',
'dataVersionId': None,
'rowsRead': 0,
'bytesRead': 0,
'downloadTime': 0,
'onlyLoadNewVersions': False,
'queryPlatform': None}],
'outputDataSources': [{'dataSourceId': '81121c6d-61c8-4723-b558-a90d16c1e10a',
'dataVersionId': 373,
'rowsWritten': 0,
'bytesWritten': 0,
'partsProcessed': None,
'versionChainType': None,
'queryPlatform': None}],
'telemetry': [{'name': 'activeOptimizations', 'value': 'd'}],
'totalBytesWritten': 0,
'totalRowsRead': 0,
'totalBytesRead': 0,
'meanDownloadRateKbps': 0.0,
'totalRowsWritten': 0,
'dataFlowVersion': 509}
get_dataflow_execution_by_id
get_dataflow_execution_by_id (auth:domolibrary.client.DomoAuth.DomoAuth, dataflow_id:int, execution_id:int, debug_api:bool=False, debug_num_stacks_to_drop=1, parent_class:str=None, session:httpx.AsyncClient=None)
sample implementation of get_dataflow_execution_by_id
= (await get_dataflow_execution_history(dataflow_id=dataflow_id, maximum=2, auth=token_auth)).response
executions
= await get_dataflow_execution_by_id(
res =dataflow_id, execution_id=executions[0]['id'], auth=token_auth
dataflow_id
)
res.response
{'id': 662396,
'onboardFlowId': 127,
'previewRows': 0,
'dapDataFlowExecutionId': '1a6c2265-fde8-4a88-9173-0b71a09f6840',
'beginTime': 1739893664000,
'endTime': 1739893674000,
'lastUpdated': 1739893674000,
'failed': False,
'state': 'SUCCESS',
'activationType': 'MANUAL',
'executionEngine': {'platform': 'K8S', 'engine': 'MAGIC'},
'actionResults': [{'actionId': '6d9d3106-a084-481d-a69d-74840f17d018',
'type': 'DataHubManifestLoaderAction',
'wasSuccessful': True,
'beginTime': 1739893671625,
'endTime': 1739893671625,
'rowsProcessed': 0,
'partsProcessed': 0,
'telemetry': [{'name': 'activeOptimizations', 'value': 'd'},
{'name': 'inputRowsAvailable', 'value': '11'}]},
{'actionId': '49f0cb44-56bb-4e19-ae8b-b83be193e3c6',
'type': 'Filter',
'wasSuccessful': True,
'beginTime': 1739893671625,
'endTime': 1739893671625,
'rowsProcessed': 0},
{'actionId': 'b8d8da16-2db0-4d88-9287-b349901d7d54',
'type': 'GroupBy',
'wasSuccessful': True,
'beginTime': 1739893671732,
'endTime': 1739893671732,
'rowsProcessed': 0},
{'actionId': '2c3aa4bb-07f5-45f4-abfa-26e9747f1fa5',
'type': 'Constant',
'wasSuccessful': True,
'beginTime': 1739893671732,
'endTime': 1739893671732,
'rowsProcessed': 0},
{'actionId': 'e9e76a06-7a82-429a-bb3f-f1e912e1d6bc',
'type': 'MergeJoin',
'wasSuccessful': True,
'beginTime': 1739893671724,
'endTime': 1739893671835,
'rowsProcessed': 0},
{'actionId': '9a80fd0d-33fb-4085-a20a-3ab856f5a762',
'type': 'ExpressionEvaluator',
'wasSuccessful': True,
'beginTime': 1739893671835,
'endTime': 1739893671835,
'rowsProcessed': 0},
{'actionId': 'f32d6203-2ab9-42b0-b44b-f0ee823202f3',
'type': 'PublishToVault',
'wasSuccessful': True,
'beginTime': 1739893672037,
'endTime': 1739893672037,
'rowsProcessed': 0,
'partsProcessed': 1,
'telemetry': [{'name': 'activeOptimizations', 'value': 'd'}]}],
'dataProcessor': 'MAGIC',
'inputDataSources': [{'dataSourceId': '864c1409-461e-46fc-b4b3-0ed644903782',
'dataVersionId': None,
'rowsRead': 0,
'bytesRead': 0,
'downloadTime': 0,
'onlyLoadNewVersions': False,
'queryPlatform': None}],
'outputDataSources': [{'dataSourceId': '81121c6d-61c8-4723-b558-a90d16c1e10a',
'dataVersionId': 373,
'rowsWritten': 0,
'bytesWritten': 0,
'partsProcessed': None,
'versionChainType': None,
'queryPlatform': None}],
'telemetry': [{'name': 'activeOptimizations', 'value': 'd'}],
'totalBytesWritten': 0,
'totalRowsRead': 0,
'totalBytesRead': 0,
'meanDownloadRateKbps': 0.0,
'totalRowsWritten': 0,
'dataFlowVersion': 509}
execute_dataflow
execute_dataflow (auth:domolibrary.client.DomoAuth.DomoAuth, dataflow_id:int, debug_api:bool=False, debug_num_stacks_to_drop=1, parent_class:str=None, session:httpx.AsyncClient=None)
sample execute_dataflow
try:
print(await execute_dataflow(dataflow_id=dataflow_id, auth=token_auth))
except dmde.DomoError as e:
print(e)
ResponseGetData(status=200, response={'id': 663567, 'onboardFlowId': 127, 'previewRows': 0, 'dapDataFlowExecutionId': 'fbf467cc-c42b-4d96-be63-fd739af13e5b', 'beginTime': 1740096487128, 'lastUpdated': 1740096487795, 'state': 'CREATED', 'activationType': 'MANUAL', 'executionEngine': {'platform': 'K8S', 'engine': 'MAGIC'}, 'dataProcessor': 'MAGIC', 'dataFlowVersion': 509}, is_success=True, parent_class=None)