Extension Resource¶
Review Board’s extension resource.
This resource special-cases the one in Djblets to provide API token and OAuth token access.
Details¶
Name | extension |
URI | /api/extensions/{extension_name}/ |
Token Policy ID | extension |
HTTP Methods | |
Parent Resource | |
Child Resources | None |
Fields¶
authorString | The author of the extension. |
author_urlString | The author’s website. |
can_disableBoolean | Whether or not the extension can be disabled. |
can_enableBoolean | Whether or not the extension can be enabled. |
class_nameString | The class name for the extension. |
enabledBoolean | Whether or not the extension is enabled. |
installedBoolean | Whether or not the extension is installed. |
load_errorString | If the extension could not be loaded, this will contain any errors captured while trying to load. |
loadableBoolean | Whether or not the extension is currently loadable. An extension may be installed but missing or may be broken due to a bug. |
nameString | The name of the extension. |
summaryString | A summary of the extension’s functionality. |
versionString | The installed version of the extension. |
Links¶
Name |
Method |
Resource |
---|---|---|
self | GET |
|
update | PUT |
HTTP GET¶
Handle HTTP GETs to item resources.
By default, this will check for access permissions and query for the object. It will then return a serialized form of the object.
This may need to be overridden if needing more complex logic.
- Args:
- Returns:
WebAPIResourceHandlerResult: The HTTP response, API error, or tuple results from the API handler.
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
HTTP PUT¶
Updates the state of the extension.
If enabled
is true, then the extension will be enabled, if it is
not already. If false, it will be disabled.
Request Parameters¶
enabledBoolean | Required Whether or not to make the extension active. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
107 - Enable Extension FailedHTTP 500 - Internal Server Error | There was a problem enabling the extension |
108 - Disable Extension FailedHTTP 500 - Internal Server Error | There was a problem disabling the extension |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
application/vnd.reviewboard.org.extension+json¶
$ curl https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 693
Content-Type: application/vnd.reviewboard.org.extension+json
ETag: f19c4d848a36c54a401fd81c1d36a4cbae4e7e1d
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"extension": {
"author": null,
"author_url": null,
"can_disable": false,
"can_enable": false,
"class_name": "rbintegrations.extension.RBIntegrationsExtension",
"enabled": true,
"installed": true,
"links": {
"self": {
"href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/extensions/rbintegrations.extension.RBIntegrationsExtension/",
"method": "PUT"
}
},
"load_error": "This extension is not installed or could not be found. Try re-installing it and then click \"Reload Extensions\".",
"loadable": false,
"name": "Integrations",
"summary": null,
"version": null
},
"stat": "ok"
}