Jump to >

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:dict
get_capabilities()[source]

Return the capabilities made available in the API.

Returns:The dictionary of capabilities.
Return type:dict
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 capabilties_id attribute passed in, and can only be registerd once. A KeyError will be thrown if attempting to register a second time.

Parameters:
  • capabilities_id (unicode) – A unique ID representing this collection of capabilities. This can only be used once until unregistered.
  • caps (dict) – The dictionary of capabilities to register. Each key msut be a string, and each value should be a boolean or a dictionary of string keys to booleans.
Raises:

KeyError – The capabilities ID has already been used.

unregister_webapi_capabilities(capabilities_id)[source]

Unregister a previously registered set of web API capabilities.

Parameters:capabilities_id (unicode) – The unique ID representing a registered collection of capabilities.
Raises:KeyError – A set of capabilities matching the ID were not found.