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 static | Reads a $metadata document; its endpoints are made the way the spec's inventory is (Endpoints in the Java client). |
with_product_version | A copy with the server's product version, which $metadata doesn't say, for messages. |
schema_version property | The REST API schema version the server reports in Core.SchemaVersion, such as 11.8.35, or None if it reports none. |
product_version property | The server's product version, such as 11.8.03500.6, or None if not known. |
supports | Whether the server defines it. |
check | None 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
staticparse(metadata: bytes, product_version: Tm1Version | None = None) -> Tm1CapabilitiesReads 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) -> Tm1CapabilitiesA copy with the server's product version, which $metadata doesn't say, for messages.
schema_version
propertyschema_version: str | NoneThe 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
propertyproduct_version: Tm1Version | NoneThe server's product version, such as 11.8.03500.6, or None if not known.
supports
supports(capability: Tm1Capability | str) -> boolWhether the server defines it: a capability, or an endpoint ID of the spec.
check
check(capability: Tm1Capability, server: str) -> Tm1UnsupportedOperationError | NoneNone if the server has it; otherwise the error saying what's missing, as Java's.
endpoints
endpoints