Built-in Extensions

/cache

Cache Extension returns latest retrieved cache keys

class q2_sdk.extensions.Cache.extension.CacheHandler(application, request, **kwargs)[source]

/changelog

Shows aggregated CHANGELOG.md files for INSTALLED_EXTENSIONS

class q2_sdk.extensions.ChangeLog.extension.ChangeLogHandler(application, request, **kwargs)[source]

/status

HealthCheck Extension just returns 200 Helps ensure the service is up and responding

class q2_sdk.extensions.HealthCheck.extension.HealthCheckHandler(application, request, **kwargs)[source]
property LOGGING_FILTERS

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

reset_health_stats()[source]

Reset static variables on the class in case of inheritance

async get(*args, **kwargs)[source]

Returns 200

/inspect

Inspect Extension returns information about the current configuration

class q2_sdk.extensions.Inspect.extension.InspectHandler(application, request, **kwargs)[source]
set_default_headers()[source]

Override this to set HTTP headers at the beginning of the request.

For example, this is the place to set a custom Server header. Note that setting such headers in the normal flow of request processing may not do what you want, since headers may be reset during error handling.

return_server_info()[source]

Returns configured information for the running server

/logging

enum q2_sdk.extensions.Logging.extension.TaskType(value)[source]

Valid values are as follows:

LogLevel = <TaskType.LogLevel: 'LogLevel'>
FullResponse = <TaskType.FullResponse: 'FullResponse'>
class q2_sdk.extensions.Logging.extension.LoggingHandler(application, request, **kwargs)[source]

Endpoint to temporarily change the server’s LogLevel at runtime

Allows for setting a single override at a time. If an override is set, begins a timer as a separate asyncio Task, which will reset the LogLevel to default on expiration.

get()[source]

UI interface for interacting with this endpoint

async post()[source]

Business logic. Takes care of changing log levels and cleanup

/metrics

Metrics Extension returns usage data

class q2_sdk.extensions.Metrics.extension.MetricsHandler(application, request, **kwargs)[source]

/dbplan/{extension_name}

Endpoint to install an extension’s db_plan

class q2_sdk.extensions.DbPlan.extension.DbPlanHandler(application, request, **kwargs)[source]
set_default_headers()[source]

Override this to set HTTP headers at the beginning of the request.

For example, this is the place to set a custom Server header. Note that setting such headers in the normal flow of request processing may not do what you want, since headers may be reset during error handling.

/admin

Admin Extension provides an interface to do server level operations

class q2_sdk.extensions.Admin.extension.AdminHandler(application, request, **kwargs)[source]
async get()[source]

UI interface for interacting with this endpoint

async post()[source]

API Interface for interacting with this endpoint

on_finish()[source]

Fires as the request is ending

/{unmatched}

Fallback for any requests that don’t match anything else installed

class q2_sdk.extensions.Default.extension.DefaultHandler(application, request, **kwargs)[source]

Returns a 404 Not Found for all requests.

Similar to Tornado’s base behavior, but provides a hook for custom cleanup logic specific to the SDK framework.