From 4bd80ce6efb3c19d896ed070bbff3f5d74e33bca Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 12 Sep 2022 15:11:51 -0400 Subject: [PATCH] Flush out documentation and service-info for DRS API a bit. --- doc/source/admin/galaxy_options.rst | 32 +++++++++++++++++++- lib/galaxy/config/sample/galaxy.yml.sample | 25 +++++++++++++++- lib/galaxy/config/schemas/config_schema.yml | 33 ++++++++++++++++++++- lib/galaxy/webapps/galaxy/api/drs.py | 5 ++++ 4 files changed, 92 insertions(+), 3 deletions(-) diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 4e28a86dbc6..7a471413286 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -3840,6 +3840,15 @@ Service ID for GA4GH services (exposed via the service-info endpoint for the Galaxy DRS API). If unset, one will be generated using the URL the target API requests are made against. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry and + https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + This value should likely reflect your service's URL. For instance + for usegalaxy.org this value should be org.usegalaxy. Particular + Galaxy implementations will treat this value as a prefix and + append the service type to this ID. For instance for the DRS + service "id" (available via the DRS API) for the above + configuration value would be org.usegalaxy.drs. :Default: ``None`` :Type: str @@ -3851,7 +3860,10 @@ :Description: Service name for host organization (exposed via the service-info endpoint for the Galaxy DRS API). If unset, one will be generated - using ga4gh_service_service_id. + using ga4gh_service_id. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry and + https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml :Default: ``None`` :Type: str @@ -3865,6 +3877,24 @@ service-info endpoint for the Galaxy DRS API). If unset, one will be generated using the URL the target API requests are made against. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry and + https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml +:Default: ``None`` +:Type: str + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``ga4gh_service_environment`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Service environment (exposed via the service-info endpoint for the + Galaxy DRS API) for implemented GA4GH services. + Suggested values are prod, test, dev, staging. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry and + https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml :Default: ``None`` :Type: str diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index 06585fcdd55..eb7092048fa 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -2091,18 +2091,41 @@ galaxy: # Service ID for GA4GH services (exposed via the service-info endpoint # for the Galaxy DRS API). If unset, one will be generated using the # URL the target API requests are made against. + # For more information on GA4GH service definitions - check out + # https://github.com/ga4gh-discovery/ga4gh-service-registry and + # https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + # This value should likely reflect your service's URL. For instance + # for usegalaxy.org this value should be org.usegalaxy. Particular + # Galaxy implementations will treat this value as a prefix and append + # the service type to this ID. For instance for the DRS service "id" + # (available via the DRS API) for the above configuration value would + # be org.usegalaxy.drs. #ga4gh_service_id: null # Service name for host organization (exposed via the service-info # endpoint for the Galaxy DRS API). If unset, one will be generated - # using ga4gh_service_service_id. + # using ga4gh_service_id. + # For more information on GA4GH service definitions - check out + # https://github.com/ga4gh-discovery/ga4gh-service-registry and + # https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml #ga4gh_service_organization_name: null # Organization URL for host organization (exposed via the service-info # endpoint for the Galaxy DRS API). If unset, one will be generated # using the URL the target API requests are made against. + # For more information on GA4GH service definitions - check out + # https://github.com/ga4gh-discovery/ga4gh-service-registry and + # https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml #ga4gh_service_organization_url: null + # Service environment (exposed via the service-info endpoint for the + # Galaxy DRS API) for implemented GA4GH services. + # Suggested values are prod, test, dev, staging. + # For more information on GA4GH service definitions - check out + # https://github.com/ga4gh-discovery/ga4gh-service-registry and + # https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + #ga4gh_service_environment: null + # Enable tool tags (associating tools with tags). This has its own # option since its implementation has a few performance implications # on startup for large servers. diff --git a/lib/galaxy/config/schemas/config_schema.yml b/lib/galaxy/config/schemas/config_schema.yml index 192e95ae7a8..a215eef970e 100644 --- a/lib/galaxy/config/schemas/config_schema.yml +++ b/lib/galaxy/config/schemas/config_schema.yml @@ -2792,12 +2792,26 @@ mapping: Service ID for GA4GH services (exposed via the service-info endpoint for the Galaxy DRS API). If unset, one will be generated using the URL the target API requests are made against. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry + and https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + + This value should likely reflect your service's URL. For instance for usegalaxy.org + this value should be org.usegalaxy. Particular Galaxy implementations will treat this + value as a prefix and append the service type to this ID. For instance for the DRS + service "id" (available via the DRS API) for the above configuration value would be + org.usegalaxy.drs. + ga4gh_service_organization_name: type: str required: false desc: | Service name for host organization (exposed via the service-info endpoint for the Galaxy DRS API). - If unset, one will be generated using ga4gh_service_service_id. + If unset, one will be generated using ga4gh_service_id. + + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry + and https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml ga4gh_service_organization_url: type: str @@ -2806,6 +2820,23 @@ mapping: Organization URL for host organization (exposed via the service-info endpoint for the Galaxy DRS API). If unset, one will be generated using the URL the target API requests are made against. + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry + and https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + + ga4gh_service_environment: + type: str + required: False + desc: | + Service environment (exposed via the service-info endpoint for the Galaxy DRS API) for + implemented GA4GH services. + + Suggested values are prod, test, dev, staging. + + For more information on GA4GH service definitions - check out + https://github.com/ga4gh-discovery/ga4gh-service-registry + and https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml + enable_tool_tags: type: bool default: false diff --git a/lib/galaxy/webapps/galaxy/api/drs.py b/lib/galaxy/webapps/galaxy/api/drs.py index 02aba4f1229..0527fd6970d 100644 --- a/lib/galaxy/webapps/galaxy/api/drs.py +++ b/lib/galaxy/webapps/galaxy/api/drs.py @@ -63,6 +63,10 @@ class DrsApi: artifact="drs", version="1.2.0", ) + environemnt = config.ga4gh_service_environment + extra_kwds = {} + if environemnt: + extra_kwds["environment"] = environemnt return Service( id=organization_id + ".drs", name=DRS_SERVICE_NAME, @@ -70,6 +74,7 @@ class DrsApi: organization=organization, type=service_type, version=VERSION, + **extra_kwds, ) @router.get("/ga4gh/drs/v1/objects/{object_id}")