EdgeService
from skipcheck_tm1.services import EdgeService Edges: /Dimensions('d')/Hierarchies('h')/Edges, the parent-child links of a
hierarchy, each keyed by its parent's and its component's names.
List a hierarchy's edges:
# Every parent-child link of the hierarchy, as "parent > child (weight)"
return [f"{edge.parent_name} > {edge.component_name} ({edge.weight})" for edge in tm1.edges.list("Region", "Region")]
Change an edge's weight:
# Make Cost count negatively in Margin
tm1.edges.update("Account", "Account", "Margin", "Cost", EdgePatch.builder().weight(-1.0).build())
Move an element to another parent:
# Move North from Total to Total Sales: add the new edge, then delete the old
edge = tm1.edges.create("Region", "Region", EdgePatch.builder().parent_name("Total Sales").component_name("North").weight(1.0).build())
tm1.edges.delete("Region", "Region", "Total", "North")
return edge
The asyncio flavor, skipcheck_tm1.aio, has the same methods to await, on AsyncEdgeService.
Members
list | GET …/Hierarchies('h')/Edges. |
get | GET …/Edges(ParentName='p',ComponentName='c'). |
create | Makes an element a child of a consolidation. |
update | Changes the edge's weight. |
delete | Takes an element out of a consolidation; the element stays in the hierarchy. |
parent | GET …/Edges(…)/Parent. |
component | GET …/Edges(…)/Component. |
hierarchy | GET …/Edges(…)/Hierarchy. |
list
list(dimension: str, hierarchy: str, query: ODataQuery | None = None, **options: Any) -> list[Edge]GET …/Hierarchies('h')/Edges.
TM1 REST Navigation Hierarchy/Edges
get
get(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> EdgeGET …/Edges(ParentName='p',ComponentName='c').
TM1 REST Navigation Hierarchy/Edges
create
create(dimension: str, hierarchy: str, edge: Any) -> EdgePOST …/Edges: makes an element a child of a consolidation.
TM1 REST Navigation Hierarchy/Edges
update
update(dimension: str, hierarchy: str, parent: str, component: str, patch: Any) -> NonePATCH …/Edges(ParentName='p',ComponentName='c'): changes the edge's weight.
TM1 REST Navigation Hierarchy/Edges
delete
delete(dimension: str, hierarchy: str, parent: str, component: str) -> NoneDELETE …/Edges(ParentName='p',ComponentName='c'): takes an element out of a consolidation; the element stays in the hierarchy.
TM1 REST Navigation Hierarchy/Edges
parent
parent(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> ElementGET …/Edges(…)/Parent.
TM1 REST Navigation Edge/Parent
component
component(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> ElementGET …/Edges(…)/Component.
TM1 REST Navigation Edge/Component
hierarchy
hierarchy(dimension: str, hierarchy: str, parent: str, component: str, query: ODataQuery | None = None, **options: Any) -> HierarchyGET …/Edges(…)/Hierarchy.
TM1 REST Navigation Edge/Hierarchy