Aug 2, 2020

Connecting to the IBM Cloud remotely with TM1py

In this article, we explain how you can use TM1py from your laptop/desktop and connect remotely to the IBM Cloud via the REST API.

The key to connecting to the REST API is to have the correct URL (base_url) for your TM1 instance that looks like this:

https:// <hostname><folderInWhichDataReside>/

The Folder in which the data reside on the IBM cloud can be different than the instance name (Check with the IBM Cloud team).

To connect to an instance in the IBM Cloud, the TM1Service needs the following parameters:

  • base_url follows this pattern: https:// <hostname><folderInWhichDataReside>
  • namespace must be “LDAP”
  • user non_interactive_user
  • password password for non_interactive_user
  • verify must be True
  • async_requests_mode must be True

To test the connection with your instance you can use the code below (after replacing all parameters):

from TM1py import TM1Servicewith TM1Service(        base_url='',        user="user",        namespace="LDAP",        password="xxxx",        ssl=True,        verify=True,        async_requests_mode=True) as tm1:    print(tm1.server.get_product_version())

If the connection is successful, the code above will print the TM1 version number.

Give the TM1 Non-Interactive Account Admin Access

After you have logged in you will need to add the TM1 non-interactive user to the Admin group if it hasn’t been added already. To do this:

  1. Login in to Architect with your IBM Id
  2. Right-click on the server: Security > Clients/Groups
  3. Find the TM1 automation user and tick the Admin group box.
  4. Close the browser and log back into Arc.

Related content

Loading related content