skipcheck

TM1 client · Docs · The client

Tm1Client

from skipcheck_tm1 import Tm1Client

Used 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 staticA builder for a client of one TM1 server.
of staticA client over session, which it shares.
session propertyThe session, which sends any request (Tm1Request).
api propertyThe generated API.
dimensions propertyThe dimension service, on this client's session.
hierarchies propertyThe hierarchy service, on this client's session.
elements propertyThe element service, on this client's session.
edges propertyThe edge service, on this client's session.
levels propertyThe level service, on this client's session.
members propertyThe member service, on this client's session.
subsets propertyThe subset service, on this client's session.
attributes propertyAttribute definitions.
localized_attributes propertyTranslated attribute values.
cubes propertyThe cube service, on this client's session.
views propertyThe view service, on this client's session.
cellsets propertyThe cellset service, on this client's session.
cells propertyCell writes.
member_sets propertyMember sets.
sandboxes propertyThe sandbox service, on this client's session.
change_sets propertyChange sets.
drillthrough propertyThe drillthrough service, on this client's session.
processes propertyThe process service, on this client's session.
process_debugging propertyProcess debugging.
chores propertyThe chore service, on this client's session.
users propertyThe user service, on this client's session.
groups propertyThe group service, on this client's session.
sessions propertyServer sessions.
threads propertyServer threads.
server propertyThe server.
logs propertyThe server's logs.
contents propertyThe contents tree.
annotations propertyAnnotations on cube cells.
git propertyTM1 Git.
encryption propertyEncryption at rest.
oidc_keys propertyThe cached OpenID Connect keys.
sql_data_sources propertyThe ODBC data sources on TM1's host.
batchA JSON $batch.
with_asyncA client whose requests TM1 runs asynchronously, polled every every seconds.
without_asyncA client on a synchronous view of this client's session (Tm1Session.without_async).
with_sandboxA client whose requests run in sandbox name.
without_sandboxA client on a view of this client's session whose requests run outside any sandbox, in base data (Tm1Session.without_sandbox).
with_change_setA client whose writes are recorded in change set change_set_id.
without_change_setA client on a view of this client's session whose writes go into no change set (Tm1Session.without_change_set).
connectLogs in now, rather than on the first request; returns this client.
closeEnds the session on the server.

__init__

constructor
__init__(session: Tm1Session)

builder

static
builder() -> Tm1ClientBuilder

A builder for a client of one TM1 server.

of

static
of(session: Tm1Session) -> Tm1Client

A client over session, which it shares.

session

property
session: Tm1Session

The session, which sends any request (Tm1Request).

api

property
api: Tm1Api

The generated API: a member for every endpoint, over the same session.

dimensions

property
dimensions: DimensionService

Dimensions: the dimension service, on this client's session.

hierarchies

property
hierarchies: HierarchyService

Hierarchies: the hierarchy service, on this client's session.

elements

property
elements: ElementService

Elements: the element service, on this client's session.

edges

property
edges: EdgeService

Edges: the edge service, on this client's session.

levels

property
levels: LevelService

Levels: the level service, on this client's session.

members

property
members: MemberService

Members: the member service, on this client's session.

subsets

property
subsets: SubsetService

Subsets: the subset service, on this client's session.

attributes

property
attributes: AttributeService

Attribute definitions: the attribute service, on this client's session.

localized_attributes

property
localized_attributes: LocalizedAttributeService

Translated attribute values: the localized attribute service, on this client's session.

cubes

property
cubes: CubeService

Cubes: the cube service, on this client's session.

views

property
views: ViewService

Views: the view service, on this client's session.

cellsets

property
cellsets: CellsetService

Cellsets: the cellset service, on this client's session.

cells

property
cells: CellService

Cell writes: the cell service, on this client's session.

member_sets

property
member_sets: MemberSetService

Member sets: the member set service, on this client's session.

sandboxes

property
sandboxes: SandboxService

Sandboxes: the sandbox service, on this client's session.

change_sets

property
change_sets: ChangeSetService

Change sets: the change set service, on this client's session.

drillthrough

property
drillthrough: DrillthroughService

Drillthrough: the drillthrough service, on this client's session.

processes

property
processes: ProcessService

Processes: the process service, on this client's session.

process_debugging

property
process_debugging: ProcessDebugService

Process debugging: the process debug service, on this client's session.

chores

property
chores: ChoreService

Chores: the chore service, on this client's session.

users

property
users: UserService

Users: the user service, on this client's session.

groups

property
groups: GroupService

Groups: the group service, on this client's session.

sessions

property
sessions: SessionService

Server sessions: the session service, on this client's session.

threads

property
threads: ThreadService

Server threads: the thread service, on this client's session.

server

property
server: ServerService

The server: the server service, on this client's session.

logs

property
logs: LogService

The server's logs: the log service, on this client's session.

contents

property
contents: ContentService

The contents tree: the content service, on this client's session.

annotations

property
annotations: AnnotationService

Annotations on cube cells: the annotation service, on this client's session.

git

property
git: GitService

TM1 Git: the Git service, on this client's session.

encryption

property
encryption: EncryptionService

Encryption at rest: the encryption service, on this client's session.

oidc_keys

property
oidc_keys: OidcKeyService

The cached OpenID Connect keys: the OIDC key service, on this client's session.

sql_data_sources

property
sql_data_sources: SqlDataSourceService

The ODBC data sources on TM1's host: the SQL data source service, on this client's session.

batch

batch() -> Tm1Batch

A JSON $batch: calls through batch.client are queued, and run sends them.

with_async

with_async(every: float | timedelta = 1.0) -> Tm1Client

A client whose requests TM1 runs asynchronously, polled every every seconds.

without_async

without_async() -> Tm1Client

A client on a synchronous view of this client's session (Tm1Session.without_async).

with_sandbox

with_sandbox(name: str) -> Tm1Client

A client whose requests run in sandbox name.

without_sandbox

without_sandbox() -> Tm1Client

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

with_change_set(change_set_id: str) -> Tm1Client

A client whose writes are recorded in change set change_set_id.

without_change_set

without_change_set() -> Tm1Client

A client on a view of this client's session whose writes go into no change set (Tm1Session.without_change_set).

connect

connect() -> Tm1Client

Logs in now, rather than on the first request; returns this client.

close

close() -> None

Ends the session on the server.