0

I am trying to connect to IBM TM1 via a Pythonscript. However I am not sure how to configure the Address and Port parts of my script below.

I am running python on a work pc. I did create a file with a proxy address in order to install a python package.

Does anyone know how to find the address and port?

from TM1py.Services import TM1Service

        
with TM1Service(address='localhost', port=8001, user='excelguy', password='WordPass', ssl=True) as tm1:
    content = tm1.cubes.cells.get_view_content(cube_name='Stack', view_name='OverFlow', private=False)
    print(content)

I am getting the error message:

ConnectionError: HTTPSConnectionPool(host='localhost', port=8001): Max retries exceeded with url: /api/v1/Configuration/ProductVersion/$value (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000263C25C7A88>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

I think I am getting closer, getting a new error msg after getting the address and port from admin.

SSLError: HTTPSConnectionPool(host='host', port=port): Max retries exceeded with url: /api/v1/Configuration/ProductVersion/$value (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')")))
excelguy
  • 1,574
  • 6
  • 33
  • 67
  • A message like that usually means the service isn't running to accept connections – Tom Barron Nov 17 '20 at 16:24
  • Sorry what does that mean? Can I work around that? – excelguy Nov 17 '20 at 16:26
  • Check whether TM1 is running and if not, start it up. If it is running, is it listening on some other port than 8001? Is it running on localhost or some other machine? 'localhost' means your machine. If it's running somewhere else on your network, the 'address' argument should be the hostname where it is running. – Tom Barron Nov 17 '20 at 16:28
  • I mean I have it open on the internet. IBM Cognos TM1 web anyway. Is there a way to check these address and port it is running on? – excelguy Nov 17 '20 at 16:36
  • 1
    In the line "with TM1Service(address=FOO, port=BAR, ...)", FOO must be the name of the server where you want to access the service (analogous to google.com when connecting to Google for a web search) and BAR must be the port number to access the service. Looking at the TM1 support website, I see, "Enter the URL provided by your TM1 Web administrator in the following format. http ://machine_name:port_number/tm1web/". Set address to whatever you put in for machine_name and port to whatever you put in for port_number in your browser. – Tom Barron Nov 17 '20 at 16:44
  • 1
    You need to know the server address and port. For default ports I think you can check them [here](https://www.ibm.com/support/pages/what-are-tcpip-ports-used-tm1) . – progmatico Nov 17 '20 at 19:58
  • Thanks guys, I think I am getting closer. – excelguy Nov 17 '20 at 20:48

0 Answers0