DomoPage
DomoPage ¶
Page classes and functionality.
This module provides comprehensive page management functionality for Domo pages, organized using the subentity composition pattern:
- exceptions: Page-related exception classes
- core: Main DomoPage entity classes (DomoPage_Default, DomoPage factory)
- pages: DomoPages collection and hierarchy operations
- layout: Layout and content management subentity (DomoPageLayout)
Classes:
| Name | Description |
|---|---|
DomoPage |
Factory class for page operations |
DomoPage_Default |
Default page implementation |
DomoPages |
Collection class for managing multiple pages |
DomoPageAccessController |
Access control subentity |
DomoPageLayout |
Layout and content management subentity |
Example
Basic page usage with subentities:
>>> page = await DomoPage.get_by_id(page_id="123", auth=auth)
>>> access_list = await page.Access.get_accesslist()
>>> owners = await page.Access.get_owners()
>>> # Get cards
>>> cards = await page.Layout.get_cards()
>>> # Update layout
>>> await page.Layout.update(body={...})
DomoLineageLink_Page
dataclass
¶
DomoLineageLink_Page(
auth: DomoAuth,
id: str,
entity: Any,
_type: str | None = None,
dependencies: list[DomoLineage_Link] = list(),
dependents: list[DomoLineage_Link] = list(),
)
Bases: DomoLineage_Link
get_entity
async
¶
get_entity(
debug_api: bool = False,
session: AsyncClient | None = None,
*,
context=None
)
Get the entity associated with this lineage link.
Source code in src/crew_dcs/classes/DomoPage/lineage.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | |
DomoLineage_Page
dataclass
¶
DomoLineage_Page(
auth: DomoAuth,
parent: Any = None,
lineage: list[DomoLineage_Link] = list(),
immediate_dependencies: list[DomoLineage_Link] = list(),
immediate_dependents: list[DomoLineage_Link] = list(),
downstream_lineage: list[DomoLineage_Link] = list(),
cards: list[Any] = None,
)
Bases: DomoLineage
Lineage handler for page entities.
The parent is the page entity this lineage is based off of (not a dependency). Pages have cards as their immediate dependencies.
get
async
¶
get(
session: AsyncClient = None,
debug_api: bool = False,
return_raw: bool = False,
parent_auth: DomoAuth = None,
parent_auth_retrieval_fn: (
Callable[[str], Any] | None
) = None,
max_depth: int = 100,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoLineage_Link]
Get lineage for a page by traversing card lineage.
Pages do not have direct datacenter lineage. Instead, we load cards from the page layout and then fetch each card's lineage. Each card is added to the page lineage as a LineageLink with dependencies and dependents referenced from the card's lineage root node.
Source code in src/crew_dcs/classes/DomoPage/lineage.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
get_downstream
async
¶
get_downstream(
session: AsyncClient = None,
debug_api: bool = False,
return_raw: bool = False,
max_depth: int = 1,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoLineage_Link]
Get downstream lineage for a page.
A page's downstream dependents are publications that include this page. Also includes any datacenter API results.
Source code in src/crew_dcs/classes/DomoPage/lineage.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
DomoPage
dataclass
¶
DomoPage(
auth: DomoAuth,
id: int,
raw: dict,
Lineage: DomoLineage | None = None,
title: str | None = None,
top_page_id: int | None = None,
parent_page_id: int | None = None,
is_locked: bool | None = None,
collections: list[dict] = list(),
custom_attributes: dict[str, Any] = dict(),
parent_page: dict[str, Any] | None = None,
top_page: dict[str, Any] | None = None,
children: list[Any] = list(),
Access: DomoPageAccessController | None = None,
Layout: DomoPageLayout | None = None,
)
Bases: DomoPage_Default
DomoPage entity with federation support via FederationContext.
create
async
classmethod
¶
create(
auth: DomoAuth,
title: str,
parent_page_id: int = 0,
*,
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs
)
Create a new page (dashboard) and return the hydrated DomoPage.
For a full dashboard (page + cards + layout) use
dashboard_builder.create_dashboard; this creates the page shell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
DomoAuth instance. |
required |
title
|
str
|
Page title. |
required |
parent_page_id
|
int
|
Parent page id (0 for a top-level page). |
0
|
return_raw
|
bool
|
Return the raw create response instead of a DomoPage. |
False
|
context
|
RouteContext | None
|
Optional RouteContext. |
None
|
Source code in src/crew_dcs/classes/DomoPage/core.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 | |
delete
async
¶
delete(
*, context: RouteContext | None = None, **context_kwargs
)
Delete this page.
Source code in src/crew_dcs/classes/DomoPage/core.py
690 691 692 693 694 695 696 697 698 699 700 | |
get_by_id
async
classmethod
¶
get_by_id(
page_id: str,
auth: DomoAuth,
suppress_no_results_error: bool = True,
return_raw: bool = False,
debug_api: bool = False,
include_layout: bool = False,
debug_num_stacks_to_drop=2,
session: AsyncClient = None,
id=None,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
max_subscriptions_to_check: int | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Retrieve page data as a DomoPage instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_id
|
str
|
Page identifier |
required |
auth
|
DomoAuth
|
Authentication object |
required |
suppress_no_results_error
|
bool
|
Suppress errors when no results found |
True
|
return_raw
|
bool
|
Return raw API response |
False
|
debug_api
|
bool
|
Enable debug logging |
False
|
include_layout
|
bool
|
Include page layout in response |
False
|
debug_num_stacks_to_drop
|
Stack frames to drop in debug output |
2
|
|
session
|
AsyncClient
|
Optional HTTP session |
None
|
id
|
Alternative parameter for page_id |
None
|
|
check_if_published
|
bool | None
|
When True, checks if page is published (requires subscription check). If None and either parent_auth or parent_auth_retrieval_fn is provided, defaults to True. |
None
|
parent_auth_retrieval_fn
|
Callable | None
|
Callable returning publisher auth when given publisher domain |
None
|
parent_auth
|
DomoAuth | None
|
Pre-existing publisher auth (alternative to parent_auth_retrieval_fn) |
None
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
DomoPage instance |
Source code in src/crew_dcs/classes/DomoPage/core.py
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | |
DomoPageAccessController ¶
DomoPageAccessController(auth: DomoAuth, parent)
Bases: DomoAccessRelationshipController
Access controller for Domo pages.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
24 25 26 27 | |
add_owners
async
¶
add_owners(
domo_users: list[Any] | None = None,
domo_groups: list[Any] | None = None,
user_ids: list[str | int] | None = None,
group_ids: list[str | int] | None = None,
message: str | None = None,
send_email: bool = False,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> bool
Add owners to the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
create_relationship
async
¶
create_relationship(
target_entity_id: str,
target_entity_type: EntityType,
relationship_type: RelationshipType,
**kwargs
) -> bool
Create an access relationship for the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
get_accesslist
async
¶
get_accesslist(
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[Relationship]
Get access list for the page as relationships.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
get_direct_relationships
async
¶
get_direct_relationships() -> list[Relationship]
Get direct relationships for the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
33 34 35 | |
get_owners
async
¶
get_owners(
*, context: RouteContext | None = None, **context_kwargs
) -> list[Relationship]
Get owner relationships for the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
remove_owners
async
¶
remove_owners(
domo_users: list[Any] | None = None,
domo_groups: list[Any] | None = None,
user_ids: list[str | int] | None = None,
group_ids: list[str | int] | None = None,
**_kwargs
) -> bool
Remove owners from the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
265 266 267 268 269 270 271 272 273 274 275 276 | |
remove_relationship
async
¶
remove_relationship(
target_entity_id: str,
target_entity_type: EntityType,
relationship_type: RelationshipType,
**kwargs
) -> bool
Remove an access relationship for the page.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
share
async
¶
share(
domo_users: list[Any] | None = None,
domo_groups: list[Any] | None = None,
user_ids: list[str | int] | None = None,
group_ids: list[str | int] | None = None,
message: str | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> bool
Share the page with users or groups.
Source code in src/crew_dcs/classes/DomoPage/access_controller.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
DomoPageLayout
dataclass
¶
DomoPageLayout(
parent: DomoEntity,
layout: PageLayout | None = None,
cards: list[Any] = list(),
datasets: list[Any] = list(),
)
Bases: DomoSubEntity
Page layout and content management subentity.
Manages page layout configuration and content operations including cards and datasets. Combines layout management with content operations that require page definition.
Attributes:
| Name | Type | Description |
|---|---|---|
layout |
PageLayout | None
|
PageLayout configuration object |
cards |
list[Any]
|
list of DomoCard objects on the page |
datasets |
list[Any]
|
list of DomoDataset objects used by page cards |
Example
page = await DomoPage.get_by_id(page_id="123", auth=auth)
Get cards from page¶
await page.Layout.get_cards() print(f"Found {len(page.Layout.cards)} cards")
Update layout¶
await page.Layout.update(layout_changes={...})
get
async
¶
get(
*, context: RouteContext | None = None, **context_kwargs
) -> PageLayout
Fetch the page layout from the v4/layouts API.
Retrieves the full layout including content slots and grid templates. Stores the result in self.layout for subsequent operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
PageLayout
|
PageLayout object with content slots and grid templates |
Source code in src/crew_dcs/classes/DomoPage/layout.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
get_cards
async
¶
get_cards(
return_raw: bool = False,
*,
context: RouteContext | None = None,
parent_auth_retrieval_fn: (
Callable[[str], Any] | None
) = None,
check_if_published: bool | None = None,
**context_kwargs
)
Get all cards from the page.
Fetches page definition and returns all cards, optionally checking if they're published.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
return_raw
|
bool
|
Return raw ResponseGetData without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
parent_auth_retrieval_fn
|
Callable[[str], Any] | None
|
Callable returning publisher auth when given publisher domain |
None
|
check_if_published
|
bool | None
|
Check if cards are published (requires subscription check) |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
list of DomoCard objects or ResponseGetData if return_raw=True |
Source code in src/crew_dcs/classes/DomoPage/layout.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | |
get_datasets
async
¶
get_datasets(
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
Get all datasets used by cards on the page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
return_raw
|
bool
|
Return raw ResponseGetData without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
list of DomoDataset objects or ResponseGetData if return_raw=True |
Source code in src/crew_dcs/classes/DomoPage/layout.py
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | |
swap_cards
async
¶
swap_cards(
card_mappings: dict[int, int],
*,
context: RouteContext | None = None,
**context_kwargs
) -> bool
Swap card IDs in the layout content slots.
Replaces cards in the layout by content_key. Acquires write lock, updates layout, then releases lock.
Appendix behavior: The Domo layout API is append-only for content slots. When you change a cardId on a slot, the old card is NOT deleted — it gets displaced to the "appendix" (a hidden section of the page where unplaced content lives). Each swap adds a HEADER + the old card to the appendix. Repeated swaps will accumulate orphaned cards in the appendix. To clean up, use the Domo UI to delete appendix content, or call remove_appendix() after swapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
card_mappings
|
dict[int, int]
|
Dict mapping content_key → new card_id. Example: {0: 123456, 2: 789012} replaces the card at content_key 0 with card 123456 and content_key 2 with card 789012. |
required |
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
True if successful, False otherwise |
Source code in src/crew_dcs/classes/DomoPage/layout.py
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
update
async
¶
update(
body: dict | None = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
Update page layout.
Acquires write lock, updates layout, then releases lock. If no body is provided, uses self.layout.get_body().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
dict | None
|
Layout configuration dictionary (optional — uses self.layout.get_body() if not provided) |
None
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
|
True if successful, False otherwise |
Source code in src/crew_dcs/classes/DomoPage/layout.py
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | |
DomoPage_Default
dataclass
¶
DomoPage_Default(
auth: DomoAuth,
id: int,
raw: dict,
Lineage: DomoLineage | None = None,
title: str | None = None,
top_page_id: int | None = None,
parent_page_id: int | None = None,
is_locked: bool | None = None,
collections: list[dict] = list(),
custom_attributes: dict[str, Any] = dict(),
parent_page: dict[str, Any] | None = None,
top_page: dict[str, Any] | None = None,
children: list[Any] = list(),
Access: DomoPageAccessController | None = None,
Layout: DomoPageLayout | None = None,
)
Bases: DomoEntity_w_Lineage
entity_name
property
¶
entity_name: str
Get the display name for this page.
Pages use the 'title' field as their display name.
Returns:
| Type | Description |
|---|---|
str
|
Page title, or page ID as fallback |
name
property
¶
name: str
Get the display name for this page.
Implements abstract property from DomoEntity_w_Lineage. Pages use the 'title' field as their display name.
Returns:
| Type | Description |
|---|---|
str
|
Page title, or "Untitled Page {id}" as fallback |
to_dict ¶
to_dict(
override_fn: Callable | None = None,
return_snake_case: bool = False,
) -> dict
Serialize page for export/debugging with layout card details.
Source code in src/crew_dcs/classes/DomoPage/core.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
DomoPages
dataclass
¶
DomoPages(auth: DomoAuth, pages: list[Any] = None)
get
async
¶
get(**kwargs)
calls get_admin_summary to retrieve all pages in an instance
Source code in src/crew_dcs/classes/DomoPage/pages.py
21 22 23 | |
get_admin_summary
async
¶
get_admin_summary(
search_title: str | None = None,
parent_page_id: int | None = None,
return_raw: bool = False,
debug_api: bool = False,
session: AsyncClient = None,
*,
context: RouteContext | None = None,
**context_kwargs
)
use admin_summary to retrieve all pages in an instance -- regardless of user access NOTE: some Page APIs will not return results if page access isn't explicitly shared
Source code in src/crew_dcs/classes/DomoPage/pages.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |