Tm1Database
from skipcheck_tm1_testcontainers import Tm1Database A database of a Tm1EngineContainer: what a test of TM1 v12 uses.
An engine holds instances, and an instance holds databases. The REST API of one
database is at rest_url; a user logs in to its instance
(login), and the session serves every database there.
Members
__init__ constructor | |
engine property | The engine this database is in. |
instance property | The instance this database is in; tm1 unless one was named. |
name property | The database's name. |
rest_url property | The REST API's service root as seen from the host, ending in /, e.g. |
version property | The version of TM1 the engine runs. |
login | A login as a user. |
oauth2_login | A login through OAuth 2.0. |
pass_through_login | A pass-through login. |
pass_through_login_with | A pass-through login with an Authorization header of your own, which TM1 v12 passes on as it is. |
__init__
constructor__init__(engine: Tm1EngineContainer, instance: str, name: str) -> Noneengine
propertyengine: Tm1EngineContainerThe engine this database is in.
instance
propertyinstance: strThe instance this database is in; tm1 unless one was named.
name
propertyname: strThe database's name.
rest_url
propertyrest_url: strThe REST API's service root as seen from the host, ending in /, e.g. http://localhost:54321/tm1/api/v1/Databases('planning')/.
version
propertyversion: Tm1VersionThe version of TM1 the engine runs. Only available once it has started.
login
login(user: str = 'admin') -> Tm1LoginA login as a user: admin, the administrator every database has, unless one is named. TM1 makes a session for any name; a user who isn't in this database is then refused here (403).
oauth2_login
oauth2_login(user: str) -> Tm1LoginA login through OAuth 2.0: as a user the engine's Keycloak knows the password of (Tm1EngineContainer.with_login). The login gets a token from Keycloak with that password and sends it to TM1, as a program acting for the user would. A RuntimeError if the engine has no Tm1EngineContainer.with_oauth2, and a ValueError if the user has no password.
pass_through_login
pass_through_login(user: str | None = None, password: str | None = None) -> Tm1LoginA pass-through login: it sends TM1 v12 what the TM1 11 server takes, and TM1 v12 asks that server who that is.
* pass_through_login(): as the server's own user (Tm1ServerContainer.username): the administrator of a server with its own users, or the first administrator of one in Cognos (CAM) security. * pass_through_login(user): as a user whose password the containers know: one of Cognos's test users when the server is in CAM security, and otherwise the server's own user only. A ValueError if the user's password isn't known. * pass_through_login(user, password): with a name and password of your own: a user you created on the TM1 11 server, or a wrong password to see refused. They go as Basic, or as CAMNamespace when the server is in CAM security.
A RuntimeError if the engine has no Tm1EngineContainer.with_pass_through.
pass_through_login_with
pass_through_login_with(authorization: str) -> Tm1LoginA pass-through login with an Authorization header of your own, which TM1 v12 passes on as it is: "CAMPassport " + passport from a Cognos logon, say. The login has no user name or password. A RuntimeError if the engine has no Tm1EngineContainer.with_pass_through.