Skip to main content
Question

Is there a technical way to export backups of processes/data model in Celonis so that we can restore them when necessary?

  • June 6, 2024
  • 2 replies
  • 43 views

Is there a technical way to export backups of processes/data model in Celonis so that we can restore them when necessary?

2 replies

Hi Sevde Aydin,

 

You can use python in your machine learning workbench and use pycelonis module for accessing the data in a data model and save them as files in the machine learning workbench itself.

 

Thanks,

Akshay


Hello Akshay Haridas,

 

Thank you very much for your support. I set up PyCelonis client library in Machine Learning Workbench and established the connection to our Celonis EMS API. However, I got an error when connecting to the EMS.

I wrote the following commands and I am sure that I used the correct for the environment variables 

CELONIS_URL, CELONIS_API_TOKEN and CELONIS_KEY_TYPE but still didn't work.

 

url = "https://<mycompany'steam>.<realm>.celonis.cloud/"

api_token = "<the-api-token(Application-Key)-for MLWorkbench-from-Admin & Settings -> Applications>"

key_type = "APP_KEY"

from pycelonis import get_celonis

celonis = get_celonis(base_url=url, api_token=api_token, key_type=key_type)

 

And I got the following error:

HTTPStatusError Traceback (most recent call last)

File ~/.local/lib/python3.8/site-packages/pycelonis_core/client/response_processor.py:49, in ResponseProcessor._verify_response(self, response)

48 try:

---> 49 response.raise_for_status()

50 except HTTPStatusError as error:

 

File ~/.local/lib/python3.8/site-packages/httpx/_models.py:749, in Response.raise_for_status(self)

748 message = message.format(self, error_type=error_type)

--> 749 raise HTTPStatusError(message, request=request, response=self)

 

HTTPStatusError: Server error '500 Internal Server Error' for url 'https://borusan.eu-2.celonis.cloud/api/cloud'

For more information check: https://httpstatuses.com/500

 

During handling of the above exception, another exception occurred:

 

PyCelonisHTTPStatusError Traceback (most recent call last)

Input In [23], in <cell line: 2>()

1 from pycelonis import get_celonis

----> 2 celonis = get_celonis(base_url=url, api_token=api_token, key_type=key_type)

 

File ~/.local/lib/python3.8/site-packages/pycelonis/__init__.py:135, in get_celonis(base_url, api_token, key_type, user_agent, proxies, connect, permissions, check_if_outdated, retries, delay, verify_ssl, **kwargs)

122 client = _infer_client(

123 base_url,

124 api_token,

(...)

131 **kwargs,

132 )

134 if connect:

--> 135 _connect(client)

137 celonis = Celonis(client)

139 if permissions:

 

File ~/.local/lib/python3.8/site-packages/pycelonis/__init__.py:292, in _connect(client)

290 def _connect(client: Client) -> None:

291 try:

--> 292 TeamService.get_api_cloud(client)

293 logger.info("Initial connect successful! PyCelonis Version: %s", __version__)

294 except PyCelonisPermissionError:

 

File ~/.local/lib/python3.8/site-packages/pycelonis/service/team/service.py:160, in TeamService.get_api_cloud(client)

149 @staticmethod

150 def get_api_cloud(client: Client) -> UserTransport:

151 logger.debug(

152 f"Request: 'GET' -> '/api/cloud'",

153 extra={

(...)

157 },

158 )

--> 160 return client.request(

161 method="GET",

162 url=f"/api/cloud",

163 parse_json=True,

164 type_=UserTransport,

165 )

 

File ~/.local/lib/python3.8/site-packages/pycelonis_core/client/client.py:154, in Client.request(self, method, url, content, data, files, json, params, headers, cookies, timeout, follow_redirects, type_, parse_json, request_body)

140 request = self.client.build_request(

141 method=method,

142 url=url,

(...)

150 timeout=timeout,

151 )

153 response = self.client.send(request, follow_redirects=follow_redirects)

--> 154 return self._response_processor.process(response=response, type_=type_, parse_json=parse_json)

 

File ~/.local/lib/python3.8/site-packages/pycelonis_core/client/response_processor.py:32, in ResponseProcessor.process(self, response, type_, parse_json)

25 def process(

26 self,

27 response: Response,

28 type_: typing.Optional[typing.Type[T]] = None,

29 parse_json: bool = True,

30 ) -> typing.Any:

31 """Verifies whether response is valid and parses response body if parse_json=True."""

---> 32 self._verify_response(response)

34 if parse_json:

35 return self._parse_response(response, type_)

 

File ~/.local/lib/python3.8/site-packages/pycelonis_core/client/response_processor.py:51, in ResponseProcessor._verify_response(self, response)

49 response.raise_for_status()

50 except HTTPStatusError as error:

---> 51 self._process_error(error)

 

File ~/.local/lib/python3.8/site-packages/pycelonis_core/client/response_processor.py:76, in ResponseProcessor._process_error(self, error)

68 def _process_error(self, error: HTTPStatusError) -> None:

69 message = f"""

70 Request : {error.request.method} -> {error.request.url}

71 Headers : {error.request.headers}

(...)

74 Data : {error.response.text}

75 """

---> 76 raise PyCelonisHTTPStatusError(message)

 

PyCelonisHTTPStatusError:

Request : GET -> https://borusan.eu-2.celonis.cloud/api/cloud

Headers : Headers({'host': 'borusan.eu-2.celonis.cloud', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br', 'connection': 'keep-alive', 'user-agent': 'pycelonis/2.9.0', 'authorization': '[secure]'})

Data :

Response: Server error '500 Internal Server Error' for url 'https://borusan.eu-2.celonis.cloud/api/cloud'

For more information check: https://httpstatuses.com/500

Data : Something went wrong while handling the request. Please contact Celonis customer support. Celonis Support ID: 3aa46e52-dec3-4174-9110-519bf3140c2c

How can I fix this problem? Thank you very much in advance.