Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

Source code for galaxy.webapps.galaxy.api.display_applications

"""
API operations on annotations.
"""

import logging
from typing import Optional

from fastapi import Body

from galaxy.managers.context import ProvidesUserContext
from galaxy.managers.display_applications import (
    CreateLinkFeedback,
    CreateLinkIncoming,
    DisplayApplication,
    DisplayApplicationsManager,
    ReloadFeedback,
)
from galaxy.webapps.galaxy.api import (
    depends,
    DependsOnTrans,
    Router,
)

log = logging.getLogger(__name__)

router = Router(tags=["display_applications"])


[docs] @router.cbv class FastAPIDisplayApplications: manager: DisplayApplicationsManager = depends(DisplayApplicationsManager)
[docs] @router.get( "/api/display_applications", public=True, summary="Returns the list of display applications.", name="display_applications_index", ) def index( self, ) -> list[DisplayApplication]: """ Returns the list of display applications. """ return self.manager.index()
[docs] @router.post( "/api/display_applications/reload", summary="Reloads the list of display applications.", name="display_applications_reload", require_admin=True, ) def reload( self, payload: Optional[dict[str, list[str]]] = Body(default=None), ) -> ReloadFeedback: """ Reloads the list of display applications. """ payload = payload or {} ids = payload.get("ids", []) result = self.manager.reload(ids) return result