Hi,
Is there anybody, who have experience with connection tm1py with PA on Cloud (2.0.7). I want to start playing with this tool, but I'm struggling with simple connection step. I think, but I'm not sure, the problem is with link to the server and way how it works on Cloud. I'm asking about working PoC or some advice how to achieve it.
Regards,
Michal
tm1py with PAoC 2.0.7IF3 - connection
-
- Community Contributor
- Posts: 287
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: tm1py with PAoC 2.0.7IF3 - connection
I use TM1py with PA cloud. I'm going to assume you have your non-interactive user set up and know the LDAP username & password for said user. If not, read the docs on setting up your non-interactive user. When instantiating the TM1 Service with TM1py, you'll want to specify the base_url and skip the address & port arguments.
example code establishing TM1Service using TM1py:
If you use a proxy, you may need to set your HTTP_PROXY and HTTPS_PROXY before attempting to connect to TM1. You can do that in the python script with following code
docs for TM1 Rest API with cloud instance:
https://www.ibm.com/support/knowledgece ... stapi.html
example code establishing TM1Service using TM1py:
Code: Select all
tm1 = TM1Service(base_url='https://[Customer_Name].planning-analytics.ibmcloud.com/tm1/api/[Server Name]/', user='[non-interactive username]', password='non-interactive user password', namespace='LDAP', ssl=[your ssl option, try False first])
If you use a proxy, you may need to set your HTTP_PROXY and HTTPS_PROXY before attempting to connect to TM1. You can do that in the python script with following code
Code: Select all
import os
os.environ['HTTPS_PROXY'] = '[your http proxy address here]'
os.environ['HTTP_PROXY'] = '[your https proxy address here]'
docs for TM1 Rest API with cloud instance:
https://www.ibm.com/support/knowledgece ... stapi.html
-
- Posts: 2
- Joined: Wed Oct 30, 2019 6:18 am
- OLAP Product: PAoC2.0.7IF3
- Version: TM1 11.5
- Excel Version: O365
Re: tm1py with PAoC 2.0.7IF3 - connection
Many THX! - what I did wrong is that, instead of use "base_url" param I used "address"
-
- Community Contributor
- Posts: 287
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: tm1py with PAoC 2.0.7IF3 - connection
emes83, glad to hear you got it to work.
The address and port arguments are used by TM1py to build the URL when no base_url is defined. Since cloud instance doesn't use a port number, you must specify a base_url. The relevant code from TM1py RestService is below.
https://github.com/cubewise-code/tm1py/ ... Service.py
The address and port arguments are used by TM1py to build the URL when no base_url is defined. Since cloud instance doesn't use a port number, you must specify a base_url. The relevant code from TM1py RestService is below.
Code: Select all
if 'base_url' in kwargs:
self._base_url = kwargs['base_url']
else:
self._base_url = "http{}://{}:{}".format(
's' if self._ssl else '',
'localhost' if len(self._address) == 0 else self._address,
self._port)