Index
Module to interact with EMS services.
This module serves as entry point to all high-level functionality within the EMS.
get_celonis ¶
get_celonis(
base_url=None,
api_token=None,
key_type=None,
user_agent=None,
proxies=None,
connect=True,
permissions=True,
check_if_outdated=True,
retries=0,
delay=1,
verify_ssl=False,
**kwargs
)
Get a Celonis object.
Parameters:
-
base_url
(
typing.Optional[str]
) –Celonis base URL.
-
api_token
(
typing.Optional[APITokenType]
) –Celonis API token.
-
key_type
(
typing.Optional[typing.Union[str, KeyType]]
) –KeyType of API token. One of [
APP_KEY
,USER_KEY
] or pycelonis_core.client.KeyType. -
user_agent
(
typing.Optional[str]
) –Session header value for
User-Agent
. -
proxies
(
typing.Optional[ProxiesTypes]
) –Web proxy server URLs passed on to the httpx client HTTPX Proxying
-
connect
(
bool
) –If True connects to Celonis on initialization (initial request to check if the
token
&key_type
combination is correct). -
permissions
(
bool
) –If True provides permission information.
-
check_if_outdated
(
bool
) –If true checks if current pycelonis version is outdated.
-
retries
(
int
) –Number of total retries if request is failing.
-
delay
(
int
) –Delay between retries in seconds.
-
verify_ssl
(
typing.Union[str, bool, ssl.SSLContext]
) –Requiring requests to verify the TLS certificate at the remote end. For more details see HTTPX SSL Certificates.
Returns:
-
Celonis
–The Celonis object.
Examples:
Connecting to EMS using CELONIS_API_TOKEN and CELONIS_URL environmental variables:
Connecting with a different set of credentials:
Connecting with a dynamic set of credentials:
def get_api_token():
# Obtain credentials dynamically (e.g. during an OAuth 2.0 flow).
pass
celonis = get_celonis(
base_url="<url>", api_token=get_api_token, key_type="<key_type>"
)
Initialising object without testing connection and reading permissions:
Connecting with httpx web proxies: