= dmda.DomoTokenAuth(
token_auth =os.environ['DOMO_INSTANCE'],
domo_instance=os.environ["DOMO_ACCESS_TOKEN"]
domo_access_token )
Datacenter Routes
Dataflow_Type_Filter_Enum
Dataflow_Type_Filter_Enum (value, names=None, module=None, qualname=None, type=None, start=1)
An enumeration.
Exported source
class Datacenter_Enum(Enum):
= "ACCOUNT"
ACCOUNT = "CARD"
CARD = "DATAFLOW"
DATAFLOW = "DATASET"
DATASET = "GROUP"
GROUP = "PAGE"
PAGE = "USER"
USER = "CONNECTOR"
CONNECTOR = "PACKAGE"
PACKAGE = "DATA_APP"
DATA_APP
class Dataflow_Type_Filter_Enum(Enum):
= {
ADR "filterType": "term",
"field": "data_flow_type",
"value": "ADR",
"name": "ADR",
"not": False,
}
= {
MYSQL "filterType": "term",
"field": "data_flow_type",
"value": "MYSQL",
"name": "MYSQL",
"not": False,
}
= {
REDSHIFT "filterType": "term",
"field": "data_flow_type",
"value": "MYSQL",
"name": "MYSQL",
"not": False,
}
= {
MAGICV2 "filterType": "term",
"field": "data_flow_type",
"value": "MAGIC",
"name": "Magic ETL v2",
"not": False,
}
= {
MAGIC "filterType": "term",
"field": "data_flow_type",
"value": "ETL",
"name": "Magic ETL",
"not": False,
}
Datacenter_Enum
Datacenter_Enum (value, names=None, module=None, qualname=None, type=None, start=1)
An enumeration.
generate_search_datacenter_filter
generate_search_datacenter_filter (field, value, is_not:bool=False)
Type | Default | Details | |
---|---|---|---|
field | use Datacenter_Filter_Field_Enum | ||
value | |||
is_not | bool | False | to handle exclusion |
Exported source
class Datacenter_Filter_Field_Enum(Enum):
= "dataprovidername_facet"
DATAPROVIDER = "certification.state"
CERTIFICATION
class Datacenter_Filter_Field_Certification_Enum(Enum):
= "CERTIFIED"
CERTIFIED = "PENDING"
PENDING = "REQUESTED"
REQUESTED = "EXPIRED"
EXPIRED
def generate_search_datacenter_filter(
# use Datacenter_Filter_Field_Enum
field,
value,bool = False, # to handle exclusion
is_not:
):return {
"filterType": "term",
"field": field,
"value": value,
"not": is_not,
}
Datacenter_Filter_Field_Certification_Enum
Datacenter_Filter_Field_Certification_Enum (value, names=None, module=None, qualname=None, type=None, start=1)
An enumeration.
Datacenter_Filter_Field_Enum
Datacenter_Filter_Field_Enum (value, names=None, module=None, qualname=None, type=None, start=1)
An enumeration.
generate_search_datacenter_filter(=Datacenter_Filter_Field_Enum.CERTIFICATION.value,
field=Datacenter_Filter_Field_Certification_Enum.CERTIFIED.value,
value )
{'filterType': 'term',
'field': 'certification.state',
'value': 'CERTIFIED',
'not': False}
generate_search_datacenter_filter_search_term
generate_search_datacenter_filter_search_term (search_term)
sample implementation of generate_search_datacenter_filter_search_term
"hello world*") generate_search_datacenter_filter_search_term(
{'field': 'name_sort', 'filterType': 'wildcard', 'query': 'hello world*'}
generate_search_datacenter_body
generate_search_datacenter_body (search_text:str=None, entity_type:Union[str,list]='DATASET', additional_filters_ls:list[dict]=None, combineResults:bool=True, limit:int=100, offset:int=0)
Type | Default | Details | |
---|---|---|---|
search_text | str | None | |
entity_type | Union | DATASET | |
additional_filters_ls | list | None | can accept one entity_type or a list of entity_types |
combineResults | bool | True | |
limit | int | 100 | |
offset | int | 0 |
Exported source
def generate_search_datacenter_body(
str = None,
search_text:
entity_type: Union[str, list
= "DATASET", # can accept one entity_type or a list of entity_types
] list[dict] = None,
additional_filters_ls: bool = True,
combineResults: int = 100,
limit: int = 0,
offset:
):= (
filters_ls
[generate_search_datacenter_filter_search_term(search_text)]if search_text
else []
)
if not isinstance(entity_type, list):
= [entity_type]
entity_type
if additional_filters_ls:
if not isinstance(additional_filters_ls, list):
= [additional_filters_ls]
additional_filters_ls
+= additional_filters_ls
filters_ls
return {
"entities": entity_type,
"filters": filters_ls or [],
"combineResults": combineResults,
"query": "*",
"count": limit,
"offset": offset,
}
sample implementation of generate_search_datacenter_body
# from pprint import pprint
= generate_search_datacenter_body(
sample_search_body ="hello world",
search_text=Datacenter_Enum.DATAFLOW.value,
entity_type=[Dataflow_Type_Filter_Enum.MAGICV2.value],
additional_filters_ls
)
pprint(sample_search_body)
{'combineResults': True,
'count': 100,
'entities': ['DATAFLOW'],
'filters': [{'field': 'name_sort',
'filterType': 'wildcard',
'query': 'hello world'},
{'field': 'data_flow_type',
'filterType': 'term',
'name': 'Magic ETL v2',
'not': False,
'value': 'MAGIC'}],
'offset': 0,
'query': '*'}
generate_search_datacenter_account_body
generate_search_datacenter_account_body (search_str:str, is_exact_match:bool=True)
search_datacenter
search_datacenter (auth:domolibrary.client.DomoAuth.DomoAuth, maximum:int=None, body:dict=None, search_text=None, entity_type:Union[str,list]='dataset', additional_filters_ls=None, arr_fn:<built- infunctioncallable>=None, session:httpx.AsyncClient=None, debug_api:bool=False, debug_loop:bool=False, parent_class:str=None, debug_num_stacks_to_drop:int=1)
Type | Default | Details | |
---|---|---|---|
auth | DomoAuth | ||
maximum | int | None | |
body | dict | None | either pass a body or generate a body in the function using search_text, entity_type, and additional_filters parameters |
search_text | NoneType | None | |
entity_type | Union | dataset | |
additional_filters_ls | NoneType | None | can accept one value or a list of values |
arr_fn | callable | None | |
session | AsyncClient | None | |
debug_api | bool | False | |
debug_loop | bool | False | |
parent_class | str | None | |
debug_num_stacks_to_drop | int | 1 | |
Returns | ResponseGetData |
SearchDatacenter_GET_Error
SearchDatacenter_GET_Error (res, message=None)
base exception
SearchDatacenter_NoResultsFound
SearchDatacenter_NoResultsFound (res, message=None)
base exception
sample implementation of generate_search body and search datacenter
= [
additional_filters_ls "dataprovidername_facet", "Jupyter Data")
generate_search_datacenter_filter(
]
= await search_datacenter(
res =token_auth,
auth# search_text="*kb*",
=Datacenter_Enum.DATASET.value,
entity_type# additional_filters_ls=additional_filters_ls,
# debug_api = False,
# maximum = 10
)
pd.DataFrame(res.response)
entityType | databaseId | searchId | createDate | lastModified | lastIndexed | highlightedFields | language | requestAccess | score | ... | ownersLocalized | cloudName | cloudId | systemTagFields | winnerText | ownedByType | customer | description | transportType | accountId | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | dataset | da552832-c04d-46ac-936a-f982d9d3f2e6 | {'indexName': None, 'databaseId': 'da552832-c0... | 1675366713000 | 1735916781000 | 1735917364792 | {} | English | False | 3009.00000 | ... | {'localizedMessage': 'Jae Wilson1', 'count': 1} | Domo | domo | [system_tags] | SalesProject01_hello world_INT * | USER | mmmm-0012-0200 | NaN | NaN | NaN |
1 | dataset | cba137c0-779a-468a-bb74-042189a9dccd | {'indexName': None, 'databaseId': 'cba137c0-77... | 1735575508000 | 1735917236000 | 1735917367027 | {} | English | False | 180.11761 | ... | {'localizedMessage': 'Bob Clark', 'count': 1} | Domo | domo | [system_tags] | DOMO Sample bac | USER | mmmm-0012-0200 | CONNECTOR | NaN | |
2 | dataset | 6f111590-6e0a-4b6e-8f53-4fc847962655 | {'indexName': None, 'databaseId': '6f111590-6e... | 1675444944000 | 1676736358000 | 1676736703247 | {} | English | False | 73.56778 | ... | {'localizedMessage': 'Scott Thompson', 'count'... | Domo | domo | [system_tags] | Demo Performance Data | USER | mmmm-0012-0200 | NaN | WEBFORM | NaN |
3 | dataset | a87b40e6-90e5-4809-8201-983758c0f2b3 | {'indexName': None, 'databaseId': 'a87b40e6-90... | 1734555013000 | 1735572380000 | 1735572710435 | {} | English | False | 72.56778 | ... | {'localizedMessage': 'Jonathan Pilafas', 'coun... | Domo | domo | [system_tags] | REF | NCAAM Conference & ESPN Team Name Mapping | USER | mmmm-0012-0200 | NaN | WEBFORM | NaN |
4 | dataset | 6bbff3ee-351c-467b-bf9b-d121af70dfb8 | {'indexName': None, 'databaseId': '6bbff3ee-35... | 1686328406000 | 1686328675000 | 1686330407631 | {} | English | False | 9.00000 | ... | {'localizedMessage': 'Jae Wilson1', 'count': 1} | Domo | domo | [system_tags] | LesMisNodes | USER | mmmm-0012-0200 | NaN | WEBFORM | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
1858 | dataset | d260d155-9c39-4523-bca9-3610989b377a | {'indexName': None, 'databaseId': 'd260d155-9c... | 1606324395000 | 1735920677000 | 1735920993137 | {} | English | False | 7.00000 | ... | {'localizedMessage': 'Ken Lorenz', 'count': 1} | Domo | domo | [system_tags] | PRD | MetaData | Groups | USER | mmmm-0012-0200 | NaN | NaN | NaN |
1859 | dataset | 74e73205-8863-4032-9cb3-3268ae8a0b3d | {'indexName': None, 'databaseId': '74e73205-88... | 1606324395000 | 1735920677000 | 1735920993137 | {} | English | False | 7.00000 | ... | {'localizedMessage': 'Ken Lorenz', 'count': 1} | Domo | domo | [system_tags] | PRD | MetaData | People | USER | mmmm-0012-0200 | NaN | NaN | NaN |
1860 | dataset | 1a8d005c-f1c2-46a3-b27d-0bffd9c59bce | {'indexName': None, 'databaseId': '1a8d005c-f1... | 1716995220000 | 1735920964000 | 1735921872368 | {} | English | False | 7.00000 | ... | {'localizedMessage': 'Elliott Leonard', 'count... | Domo | domo | [system_tags] | DomoStats - Stream Ids | USER | mmmm-0012-0200 | VIEW | NaN | |
1861 | dataset | 1246a7d4-3a6b-45b0-9978-884a5417e24b | {'indexName': None, 'databaseId': '1246a7d4-3a... | 1718116492000 | 1735920241000 | 1735922044000 | {} | English | False | 7.00000 | ... | {'localizedMessage': 'Sarah Ajaeb', 'count': 1} | Domo | domo | [system_tags] | DOMO Covid Time Series Tracker Data | USER | mmmm-0012-0200 | NaN | NaN | NaN |
1862 | dataset | 631a1f4b-3106-41b8-a16b-a7145af7450d | {'indexName': None, 'databaseId': '631a1f4b-31... | 1673739991000 | 1735921239000 | 1735922050617 | {} | English | False | 7.00000 | ... | {'localizedMessage': 'Elliott Leonard', 'count... | Domo | domo | [system_tags] | Comments__APP_DB | USER | mmmm-0012-0200 | Auto generated from appdb service. datastore: ... | NaN | NaN |
1863 rows × 50 columns
get_connectors
get_connectors (auth:domolibrary.client.DomoAuth.DomoAuth, search_text=None, session:httpx.AsyncClient=None, debug_api:bool=False, debug_num_stacks_to_drop=1, parent_class:str=None, additional_filters_ls=None, return_raw:bool=False)
= await get_connectors(
res ="Snowflake",
search_text=token_auth,
auth= False,
debug_api = False
return_raw
)
0:5]) pd.DataFrame(res.response[
entityType | databaseId | searchId | createDate | lastModified | lastIndexed | highlightedFields | language | requestAccess | score | ... | dataSources | isPublic | connectorFAQS | producer | writebackEnabled | publisherName | entitySubType | popularity | winnerText | customer | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | connector | com.domo.connector.snowflakekeypairauthentication | {'indexName': None, 'databaseId': 'com.domo.co... | 1729116198000 | 1729177192000 | 1729177374245 | {} | English | False | 5.854239 | ... | [Snowflake Key Pair Authentication Connector] | True | [{'connectorQuestion': 'When should I use this... | domo | False | domo | Connector | 0 | Snowflake Key Pair Authentication Connector | GlobalSearchCustomer |
1 | connector | com.domo.connector.snowflake.oauth.config | {'indexName': None, 'databaseId': 'com.domo.co... | 1731003142000 | 1731011730000 | 1731011972096 | {} | English | False | 5.854239 | ... | [Snowflake Enterprise OAuth Connector] | True | [{'connectorQuestion': 'What kind of credentia... | domo | False | domo | Connector | 0 | Snowflake Enterprise OAuth Connector | GlobalSearchCustomer |
2 | connector | com.domo.connector.snowflake.partition | {'indexName': None, 'databaseId': 'com.domo.co... | 1733334126000 | 1733411053000 | 1733411284736 | {} | English | False | 5.854239 | ... | [Snowflake Partition Connector] | True | [{'connectorQuestion': 'When should I use this... | domo | False | domo | Connector | 0 | Snowflake Partition Connector | GlobalSearchCustomer |
3 | connector | com.domo.connector.snowflake.oauth | {'indexName': None, 'databaseId': 'com.domo.co... | 1731003077000 | 1731011726000 | 1731011972096 | {} | English | False | 5.854086 | ... | [Snowflake OAuth Connector] | True | [{'connectorQuestion': 'I am receiving an erro... | domo | False | domo | Connector | 0 | Snowflake OAuth Connector | GlobalSearchCustomer |
4 | connector | com.domo.connector.snowflakeunload | {'indexName': None, 'databaseId': 'com.domo.co... | 1731003741000 | 1731015689000 | 1731016458050 | {} | English | False | 5.854086 | ... | [Snowflake Unload Connector] | True | [{'connectorQuestion': 'When should I use this... | domo | False | domo | Connector | 0 | Snowflake Unload Connector | GlobalSearchCustomer |
5 rows × 29 columns
get_lineage_upstream
get_lineage_upstream (auth:domolibrary.client.DomoAuth.DomoAuth, entity_type:str, entity_id:str, session:httpx.AsyncClient=None, debug_api:bool=False, parent_class:str=None, debug_num_stacks_to_drop=1)
sample implementation of get_lineage_upstream
= await get_lineage_upstream(
res =token_auth, entity_type=Datacenter_Enum.DATAFLOW.value, entity_id=4
auth
)
# pd.DataFrame([obj for obj in res.response.values()])
res.response
{'DATA_SOURCE45a7a24e-c738-44f9-9019-00d5a33613ae': {'type': 'DATA_SOURCE',
'id': '45a7a24e-c738-44f9-9019-00d5a33613ae',
'descendantCounts': {},
'ancestorCounts': {'DATA_SOURCE': 2, 'DATAFLOW': 2},
'complete': True,
'children': [{'type': 'DATAFLOW',
'id': '4',
'complete': True,
'children': [],
'parents': []}],
'parents': [{'type': 'DATAFLOW',
'id': '3',
'complete': True,
'children': [],
'parents': []}]},
'DATAFLOW4': {'type': 'DATAFLOW',
'id': '4',
'descendantCounts': {},
'ancestorCounts': {'DATA_SOURCE': 3, 'DATAFLOW': 2},
'complete': True,
'children': [],
'parents': [{'type': 'DATA_SOURCE',
'id': '45a7a24e-c738-44f9-9019-00d5a33613ae',
'complete': True,
'children': [],
'parents': []}]},
'DATA_SOURCE0647a9ed-1a8e-420e-bd66-34f313a18595': {'type': 'DATA_SOURCE',
'id': '0647a9ed-1a8e-420e-bd66-34f313a18595',
'descendantCounts': {},
'ancestorCounts': {'DATA_SOURCE': 1, 'DATAFLOW': 1},
'complete': True,
'children': [{'type': 'DATAFLOW',
'id': '3',
'complete': True,
'children': [],
'parents': []}],
'parents': [{'type': 'DATAFLOW',
'id': '2',
'complete': True,
'children': [],
'parents': []}]},
'DATAFLOW2': {'type': 'DATAFLOW',
'id': '2',
'descendantCounts': {},
'ancestorCounts': {'DATA_SOURCE': 1},
'complete': True,
'children': [{'type': 'DATA_SOURCE',
'id': '0647a9ed-1a8e-420e-bd66-34f313a18595',
'complete': True,
'children': [],
'parents': []}],
'parents': [{'type': 'DATA_SOURCE',
'id': '241025d7-3cca-4369-b7c0-b3264277c0e1',
'complete': True,
'children': [],
'parents': []}]},
'DATA_SOURCE241025d7-3cca-4369-b7c0-b3264277c0e1': {'type': 'DATA_SOURCE',
'id': '241025d7-3cca-4369-b7c0-b3264277c0e1',
'descendantCounts': {},
'ancestorCounts': {},
'complete': True,
'children': [{'type': 'DATAFLOW',
'id': '2',
'complete': True,
'children': [],
'parents': []}],
'parents': []},
'DATAFLOW3': {'type': 'DATAFLOW',
'id': '3',
'descendantCounts': {},
'ancestorCounts': {'DATA_SOURCE': 2, 'DATAFLOW': 1},
'complete': True,
'children': [{'type': 'DATA_SOURCE',
'id': '45a7a24e-c738-44f9-9019-00d5a33613ae',
'complete': True,
'children': [],
'parents': []}],
'parents': [{'type': 'DATA_SOURCE',
'id': '0647a9ed-1a8e-420e-bd66-34f313a18595',
'complete': True,
'children': [],
'parents': []}]}}