mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-10 03:23:04 +00:00
Merge pull request #1852 from summerswallow-whi/service-info
Attach an info field to the service
This commit is contained in:
@@ -689,6 +689,11 @@ definitions:
|
||||
description: The command used to start the service (if managed)
|
||||
items:
|
||||
type: string
|
||||
info:
|
||||
type: object
|
||||
description: |
|
||||
Additional information a deployment can attach to a service.
|
||||
JupyterHub does not use this field.
|
||||
Token:
|
||||
type: object
|
||||
properties:
|
||||
|
@@ -23,6 +23,7 @@ def service_model(service):
|
||||
'prefix': service.server.base_url if service.server else '',
|
||||
'command': service.command,
|
||||
'pid': service.proc.pid if service.proc else 0,
|
||||
'info': service.info
|
||||
}
|
||||
|
||||
class ServiceListAPIHandler(APIHandler):
|
||||
|
@@ -175,6 +175,13 @@ class Service(LoggingConfigurable):
|
||||
If unspecified, an API token will be generated for managed services.
|
||||
"""
|
||||
).tag(input=True)
|
||||
|
||||
info = Dict(
|
||||
help="""Provide a place to include miscellaneous information about the service,
|
||||
provided through the configuration
|
||||
"""
|
||||
).tag(input=True)
|
||||
|
||||
# Managed service API:
|
||||
spawner = Any()
|
||||
|
||||
|
@@ -1525,6 +1525,7 @@ def test_get_services(app, mockservice_url):
|
||||
'pid': mockservice.proc.pid,
|
||||
'prefix': mockservice.server.base_url,
|
||||
'url': mockservice.url,
|
||||
'info': {},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1551,6 +1552,7 @@ def test_get_service(app, mockservice_url):
|
||||
'pid': mockservice.proc.pid,
|
||||
'prefix': mockservice.server.base_url,
|
||||
'url': mockservice.url,
|
||||
'info': {},
|
||||
}
|
||||
|
||||
r = yield api_request(app, 'services/%s' % mockservice.name,
|
||||
|
Reference in New Issue
Block a user