cubewise-code / tm1py

TM1py is a Python package that wraps the TM1 REST API in a simple to use library.
http://tm1py.readthedocs.io/en/latest/
MIT License
190 stars 109 forks source link

Get Application Name #183

Closed tatwong closed 4 years ago

tatwong commented 5 years ago

Describe what did you try to do with TM1py Tried to look for code to get the name of the application or blob name that is displaying on TM1Web, but couldn't find the relevant code.

Describe what's not working the way you expect Didn't get the expected result? Describe:

  1. A property to get the name of the application.

Version

Additional context If you encounter an error, please add the error message and the stack trace

MariusWirtz commented 5 years ago

Hi @tatwong ,

you can retrieve the elements from }ApplicationEntries dimension. Here is a sample:

from TM1py import TM1Service

ADDRESS = '14.77.19.11'
PORT = 12354
USER = 'admin'
PASSWORD = 'apple'
SSL = True

with TM1Service(address=ADDRESS, port=PORT, user=USER, password=PASSWORD, ssl=SSL) as tm1:
    apps = tm1.dimensions.hierarchies.elements.get_element_names(
        dimension_name="}ApplicationEntries",
        hierarchy_name="}ApplicationEntries")
    for app in apps:
        print(app)