skipcheck

TM1 client · Docs · Versions and capabilities

Tm1Capabilities

from skipcheck_tm1 import Tm1Capabilities

What a connected TM1 server supports, read from its own $metadata: the way OData intends clients to detect features, with no version tables. It works for any TM1, including versions the client has never seen.

# Does the server's $metadata define the cube's tm1.Reserve action?
reserve = Tm1Capability.bound_operation("tm1.Cube", "tm1.Reserve").since("11.8.34")
return session.capabilities().supports(reserve)

Members

__init__ constructor
parse staticReads a $metadata document; its endpoints are made the way the spec's inventory is (Endpoints in the Java client).
with_product_versionA copy with the server's product version, which $metadata doesn't say, for messages.
schema_version propertyThe REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35, or None if it reports none.
product_version propertyThe server's product version, such as 11.8.03500.6, or None if not known.
supportsWhether the server defines it.
checkNone if the server has it; otherwise the error saying what's missing, as Java's.
endpoints

__init__

constructor
__init__(schema_version: str | None, product_version: Tm1Version | None, endpoints: frozenset[str], types: dict[str, _Type], bound: dict[str, set[str]], container: dict[str, set[str]], aliases: dict[str, str])

parse

static
parse(metadata: bytes, product_version: Tm1Version | None = None) -> Tm1Capabilities

Reads a $metadata document; its endpoints are made the way the spec's inventory is (Endpoints in the Java client). Whatever stops it being read is a skipcheck_tm1.errors.Tm1ProtocolError, never the parser's own error, so a caller of a session has one error to catch for a server that answers $metadata with something else. That includes a document with an operation marked bound that has no binding parameter, which is refused whole, as the other clients refuse it, and one with a DOCTYPE, so that no entity is ever fetched or expanded.

with_product_version

with_product_version(product_version: Tm1Version | None) -> Tm1Capabilities

A copy with the server's product version, which $metadata doesn't say, for messages.

schema_version

property
schema_version: str | None

The REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35, or None if it reports none. Not the product version: a different number.

product_version

property
product_version: Tm1Version | None

The server's product version, such as 11.8.03500.6, or None if not known.

supports

supports(capability: Tm1Capability | str) -> bool

Whether the server defines it: a capability, or an endpoint ID of the spec.

check

check(capability: Tm1Capability, server: str) -> Tm1UnsupportedOperationError | None

None if the server has it; otherwise the error saying what's missing, as Java's.

endpoints

endpoints