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.tours

"""
API Controller providing Galaxy Tours
"""
import logging

from galaxy.tours import (
    TourDetails,
    TourList,
    ToursRegistry,
)
from . import (
    depends,
    Router,
)

log = logging.getLogger(__name__)


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


[docs]@router.cbv class FastAPITours: # ugh - mypy https://github.com/python/mypy/issues/5374 registry: ToursRegistry = depends(ToursRegistry) # type: ignore[misc]
[docs] @router.get("/api/tours") def index(self) -> TourList: """Return list of available tours.""" return self.registry.get_tours()
[docs] @router.get("/api/tours/{tour_id}") def show(self, tour_id: str) -> TourDetails: """Return a tour definition.""" return self.registry.tour_contents(tour_id)
[docs] @router.post("/api/tours/{tour_id}", require_admin=True) def update_tour(self, tour_id: str) -> TourDetails: """Return a tour definition.""" return self.registry.load_tour(tour_id)