Tm1Client
from skipcheck_tm1 import Tm1ClientUsed in the walkthroughs Connect and list your cubes, Test your code against a real TM1, Add TM1 to a Spring Boot application.
The client for one TM1 server: one Tm1Session, and every service built on it,
such as dimensions. Services arrive with the endpoint phases;
session sends any request, for what has no service yet.
tm1 = Tm1Client.builder().base_url("http://localhost:8010/api/v1/").basic_auth("admin", "apple").build()
# Leaving the block closes the session on TM1
with tm1:
for cube in tm1.cubes.model_cubes(ODataQuery.none().select(Cube.NAME)):
print(cube.name)
Run a long process asynchronously, so no request stays open for its whole run:
# TM1 runs it in the background and the client polls for the result, so no
# request stays open. In the asyncio flavor, cancelling the call stops the process on TM1.
return tm1.with_async(2).processes.execute_with_return("Rebuild Forecast")
The asyncio flavor, skipcheck_tm1.aio, has the same methods to await, on AsyncTm1Client.
Members
__init__ constructor | |
builder static | A builder for a client of one TM1 server. |
of static | A client over session, which it shares. |
session property | The session, which sends any request (Tm1Request). |
api property | The generated API. |
dimensions property | The dimension service, on this client's session. |
hierarchies property | The hierarchy service, on this client's session. |
elements property | The element service, on this client's session. |
edges property | The edge service, on this client's session. |
levels property | The level service, on this client's session. |
members property | The member service, on this client's session. |
subsets property | The subset service, on this client's session. |
attributes property | Attribute definitions. |
localized_attributes property | Translated attribute values. |
cubes property | The cube service, on this client's session. |
views property | The view service, on this client's session. |
cellsets property | The cellset service, on this client's session. |
cells property | Cell writes. |
member_sets property | Member sets. |
sandboxes property | The sandbox service, on this client's session. |
change_sets property | Change sets. |
drillthrough property | The drillthrough service, on this client's session. |
processes property | The process service, on this client's session. |
process_debugging property | Process debugging. |
chores property | The chore service, on this client's session. |
users property | The user service, on this client's session. |
groups property | The group service, on this client's session. |
sessions property | Server sessions. |
threads property | Server threads. |
server property | The server. |
logs property | The server's logs. |
contents property | The contents tree. |
annotations property | Annotations on cube cells. |
git property | TM1 Git. |
encryption property | Encryption at rest. |
oidc_keys property | The cached OpenID Connect keys. |
sql_data_sources property | The ODBC data sources on TM1's host. |
batch | A JSON $batch. |
with_async | A client whose requests TM1 runs asynchronously, polled every every seconds. |
without_async | A client on a synchronous view of this client's session (Tm1Session.without_async). |
with_sandbox | A client whose requests run in sandbox name. |
without_sandbox | A client on a view of this client's session whose requests run outside any sandbox, in base data (Tm1Session.without_sandbox). |
with_change_set | A client whose writes are recorded in change set change_set_id. |
without_change_set | A client on a view of this client's session whose writes go into no change set (Tm1Session.without_change_set). |
connect | Logs in now, rather than on the first request; returns this client. |
close | Ends the session on the server. |
__init__
constructor__init__(session: Tm1Session)builder
staticbuilder() -> Tm1ClientBuilderA builder for a client of one TM1 server.
of
staticof(session: Tm1Session) -> Tm1ClientA client over session, which it shares.
session
propertysession: Tm1SessionThe session, which sends any request (Tm1Request).
api
propertyapi: Tm1ApiThe generated API: a member for every endpoint, over the same session.
dimensions
propertydimensions: DimensionServiceDimensions: the dimension service, on this client's session.
hierarchies
propertyhierarchies: HierarchyServiceHierarchies: the hierarchy service, on this client's session.
elements
propertyelements: ElementServiceElements: the element service, on this client's session.
edges
propertyedges: EdgeServiceEdges: the edge service, on this client's session.
levels
propertylevels: LevelServiceLevels: the level service, on this client's session.
members
propertymembers: MemberServiceMembers: the member service, on this client's session.
subsets
propertysubsets: SubsetServiceSubsets: the subset service, on this client's session.
attributes
propertyattributes: AttributeServiceAttribute definitions: the attribute service, on this client's session.
localized_attributes
propertylocalized_attributes: LocalizedAttributeServiceTranslated attribute values: the localized attribute service, on this client's session.
cubes
propertycubes: CubeServiceCubes: the cube service, on this client's session.
views
propertyviews: ViewServiceViews: the view service, on this client's session.
cellsets
propertycellsets: CellsetServiceCellsets: the cellset service, on this client's session.
cells
propertycells: CellServiceCell writes: the cell service, on this client's session.
member_sets
propertymember_sets: MemberSetServiceMember sets: the member set service, on this client's session.
sandboxes
propertysandboxes: SandboxServiceSandboxes: the sandbox service, on this client's session.
change_sets
propertychange_sets: ChangeSetServiceChange sets: the change set service, on this client's session.
drillthrough
propertydrillthrough: DrillthroughServiceDrillthrough: the drillthrough service, on this client's session.
processes
propertyprocesses: ProcessServiceProcesses: the process service, on this client's session.
process_debugging
propertyprocess_debugging: ProcessDebugServiceProcess debugging: the process debug service, on this client's session.
chores
propertychores: ChoreServiceChores: the chore service, on this client's session.
users
propertyusers: UserServiceUsers: the user service, on this client's session.
groups
propertygroups: GroupServiceGroups: the group service, on this client's session.
sessions
propertysessions: SessionServiceServer sessions: the session service, on this client's session.
threads
propertythreads: ThreadServiceServer threads: the thread service, on this client's session.
server
propertyserver: ServerServiceThe server: the server service, on this client's session.
logs
propertylogs: LogServiceThe server's logs: the log service, on this client's session.
contents
propertycontents: ContentServiceThe contents tree: the content service, on this client's session.
annotations
propertyannotations: AnnotationServiceAnnotations on cube cells: the annotation service, on this client's session.
git
propertygit: GitServiceTM1 Git: the Git service, on this client's session.
encryption
propertyencryption: EncryptionServiceEncryption at rest: the encryption service, on this client's session.
oidc_keys
propertyoidc_keys: OidcKeyServiceThe cached OpenID Connect keys: the OIDC key service, on this client's session.
sql_data_sources
propertysql_data_sources: SqlDataSourceServiceThe ODBC data sources on TM1's host: the SQL data source service, on this client's session.
batch
batch() -> Tm1BatchA JSON $batch: calls through batch.client are queued, and run sends them.
with_async
with_async(every: float | timedelta = 1.0) -> Tm1ClientA client whose requests TM1 runs asynchronously, polled every every seconds.
without_async
without_async() -> Tm1ClientA client on a synchronous view of this client's session (Tm1Session.without_async).
with_sandbox
with_sandbox(name: str) -> Tm1ClientA client whose requests run in sandbox name.
without_sandbox
without_sandbox() -> Tm1ClientA client on a view of this client's session whose requests run outside any sandbox, in base data (Tm1Session.without_sandbox).
with_change_set
with_change_set(change_set_id: str) -> Tm1ClientA client whose writes are recorded in change set change_set_id.
without_change_set
without_change_set() -> Tm1ClientA client on a view of this client's session whose writes go into no change set (Tm1Session.without_change_set).
connect
connect() -> Tm1ClientLogs in now, rather than on the first request; returns this client.
close
close() -> NoneEnds the session on the server.