httk.serve.optimade.endpoints.info¶
Generate OPTIMADE discovery and provider-link responses.
Functions¶
|
Build the service |
|
Build the |
|
Build the HTML response for the unversioned API base endpoint. |
|
Build the preference-ordered CSV of supported API major versions. |
|
Build the provider-links response. |
Module Contents¶
- httk.serve.optimade.endpoints.info.generate_info_endpoint_reply(request, config, schema)[source]¶
Build the service
/inforesponse.- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated request supplying the API version and base URL.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service metadata and license configuration.
schema (httk.serve.optimade.schema.served.ServedSchema) – Served entry types and properties.
- Returns:
JSON:API service-info document.
- Return type:
- httk.serve.optimade.endpoints.info.generate_entry_info_endpoint_reply(request, config, entry, schema)[source]¶
Build the
/info/{entry}response for one served entry type.- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated request supplying response metadata context.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service metadata configuration.
entry (str) – Served entry endpoint name.
schema (httk.serve.optimade.schema.served.ServedSchema) – Served entry definitions.
- Returns:
JSON:API entry-info document.
- Return type:
- httk.serve.optimade.endpoints.info.generate_base_endpoint_reply(request, config)[source]¶
Build the HTML response for the unversioned API base endpoint.
- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated request supplying the displayed API version.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service configuration.
- Returns:
HTML response body.
- Return type:
- httk.serve.optimade.endpoints.info.generate_versions_endpoint_reply(request, config)[source]¶
Build the preference-ordered CSV of supported API major versions.
- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated request context.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service configuration.
- Returns:
Restricted
/versionsCSV body.- Return type:
- httk.serve.optimade.endpoints.info.generate_links_endpoint_reply(request, config)[source]¶
Build the provider-links response.
- Parameters:
request (httk.serve.optimade.model.request.ValidatedRequest) – Validated request supplying response metadata context.
config (httk.serve.optimade.model.config.OptimadeConfig) – Service links and metadata configuration.
- Returns:
JSON:API links document.
- Return type: