Dashboards
Class DashboardsService
class DashboardsService(FavoriteMixin, CommonMixin, TagsMixin, PublishMixin,
NameMixin, PrintMixin, PaginationMixin)
get_slug
def get_slug(dashboard_id: int) -> Optional[str]
Get the slug for a dashboard by ID
refresh
def refresh(dashboard_id: int) -> None
Refresh a dashboard
share
def share(dashboard_id: int) -> str
get public url for dashboard
duplicate
def duplicate(dashboard_id: int, new_name: Optional[str] = None) -> Dict
Duplicate a dashboard and all its widgets with new_name
create_widget
def create_widget(*,
dashboard_id: int,
visualization_id: Optional[int],
options: Dict,
text: str = "") -> Dict
create new widget in given dashboard
Arguments:
dashboard_id
- id of dashboard to create widget invisualization_id
- id of visualization to use for widget (pass None for text widget)options
- options to use for widgettext
- text to use for text widget
Class FavoriteMixin
class FavoriteMixin()
Mixin for favoriteable services
favorited
def favorited() -> List[Dict]
Get all favorited objects
favorite
def favorite(id: int) -> Dict
Favorite an object
unfavorite
def unfavorite(id: int) -> Dict
Unfavorite an object
Class CommonMixin
class CommonMixin()
Mixin with common methods for services.
get
def get(id: int) -> Dict
Fetch one by ID
get_all
def get_all() -> List[Dict]
fetch all objects.
update
def update(id: int, data: Dict) -> Dict
Update by ID
create
def create(data: Dict) -> Dict
Create a new object with data
delete
def delete(id: int) -> None
Delete by ID
Class TagsMixin
class TagsMixin()
Mixin for taggable services
get_by_tags
def get_by_tags(tags: List[str],
without: bool = False,
match_all: bool = True) -> List[Dict]
Get all objects with all or any of tags
or all objects without any of tags
Class PublishMixin
class PublishMixin()
Mixin for publishable services
publish
def publish(id: int) -> Dict
Publish an object
unpublish
def unpublish(id: int) -> Dict
Unpublish an object
Class NameMixin
class NameMixin()
Mixin for nameable services (by name or slug).
exists
def exists(name_or_slug: str) -> bool
Check if an object with given name_or_slug
exists
get_by_name
def get_by_name(name_or_slug: str) -> Optional[Dict]
Get by name or slug
get_id
def get_id(name_or_slug: str) -> Optional[int]
Get the ID for an object by name or slug, returns None if not found
Class PrintMixin
class PrintMixin()
Mixin class for printing data
Class PaginationMixin
class PaginationMixin()
Mixin for paginated services
paginate
def paginate(page: int = 1, page_size: int = 100, **kwargs) -> List[Dict]
Load all items of a paginated resource
fetch_page
def fetch_page(page: int = 1, page_size: int = 100, **kwargs) -> List[Dict]
Load a page of a paginated resource