reviewboard.webapi.server_info¶
Server information and capability registration for the API.
- get_server_info(request=None)[source]¶
Return server information for use in the API.
This is used for the root resource and for the deprecated server info resource.
- Parameters:
request (
django.http.HttpRequest
, optional) – The HTTP request from the client.- Returns:
A dictionary of information about the server and its capabilities.
- Return type:
- get_capabilities(request=None)[source]¶
Return the capabilities made available in the API.
- Parameters:
request (
django.http.HttpRequest
, optional) – The http request from the client.- Returns:
The dictionary of capabilities.
- Return type:
- get_feature_gated_capabilities(request=None)[source]¶
Return the capabilities gated behind enabled features.
- Parameters:
request (
django.http.HttpRequest
, optional) – The HTTP request from the client.- Yields:
tuple
– A 3-tuple of the following:The category of the capability (
unicode
).The capability name (
unicode
).Whether or not the capability is enabled (
bool
).
- register_webapi_capabilities(capabilities_id, caps)[source]¶
Register a set of web API capabilities.
These capabilities will appear in the dictionary of available capabilities with the ID as their key.
A capabilities_id attribute passed in, and can only be registered once. A KeyError will be thrown if attempting to register a second time.
- Parameters:
- Raises:
KeyError – The capabilities ID has already been used.