bugzilla.rst 8.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
Bugzilla Information
====================

These methods are used to get general configuration information about this
Bugzilla instance.

Version
-------

Returns the current version of Bugzilla. Normally in the format of ``X.X`` or
``X.X.X``. For example, ``4.4`` for the initial release of a new branch. Or
``4.4.6`` for a minor release on the same branch.

**Request**

.. code-block:: text

   GET /rest/version

**Response**

.. code-block:: js

   {
     "version": "4.5.5+"
   }

=======  ======  =========================================
name     type    description
=======  ======  =========================================
version  string  The current version of this Bugzilla
=======  ======  =========================================

Extensions
----------

Gets information about the extensions that are currently installed and enabled
in this Bugzilla.

**Request**

.. code-block:: text

   GET /rest/extensions

**Response**

.. code-block:: js

   {
     "extensions": {
       "Voting": {
         "version": "4.5.5+"
       },
       "BmpConvert": {
         "version": "1.0"
       }
     }
   }

==========  ======  ====================================================
name        type    description
==========  ======  ====================================================
extensions  object  An object containing the extensions enabled as keys.
                    Each extension object contains the following keys:

                    * ``version`` (string) The version of the extension.
==========  ======  ====================================================

Timezone
--------

Returns the timezone in which Bugzilla expects to receive dates and times on the API.
Currently hard-coded to UTC ("+0000"). This is unlikely to change.

**Request**

.. code-block:: text

   GET /rest/timezone

.. code-block:: js

   {
     "timezone": "+0000"
   }

**Response**

========  ======  ===============================================================
name      type    description
========  ======  ===============================================================
timezone  string  The timezone offset as a string in (+/-)XXXX (RFC 2822) format.
========  ======  ===============================================================

Time
----

Gets information about what time the Bugzilla server thinks it is, and
what timezone it's running in.

**Request**

.. code-block:: text

   GET /rest/time

**Response**

.. code-block:: js

   {
     "web_time_utc": "2014-09-26T18:01:30Z",
     "db_time": "2014-09-26T18:01:30Z",
     "web_time": "2014-09-26T18:01:30Z",
     "tz_offset": "+0000",
     "tz_short_name": "UTC",
     "tz_name": "UTC"
   }

=============  ======  ==========================================================
name           type    description
=============  ======  ==========================================================
db_time        string  The current time in UTC, according to the Bugzilla
                       database server.

                       Note that Bugzilla assumes that the database and the
                       webserver are running in the same time zone. However,
                       if the web server and the database server aren't
                       synchronized or some reason, *this* is the time that
                       you should rely on or doing searches and other input
                       to the WebService.
web_time       string  This is the current time in UTC, according to
                       Bugzilla's web server.

                       This might be different by a second from ``db_time``
                       since this comes from a different source. If it's any
                       more different than a second, then there is likely
                       some problem with this Bugzilla instance. In this
                       case you should rely  on the ``db_time``, not the
                       ``web_time``.
web_time_utc   string  Identical to ``web_time``. (Exists only for
                       backwards-compatibility with versions of Bugzilla
                       before 3.6.)
tz_name        string  The literal string ``UTC``. (Exists only for
                       backwards-compatibility with versions of Bugzilla
                       before 3.6.)
tz_short_name  string  The literal string ``UTC``. (Exists only for
                       backwards-compatibility with versions of Bugzilla
                       before 3.6.)
tz_offset      string  The literal string ``+0000``. (Exists only for
                       backwards-compatibility with versions of Bugzilla
                       before 3.6.)
=============  ======  ==========================================================

Parameters
----------

Returns parameter values currently used in this Bugzilla.

**Request**

.. code-block:: text

   GET /rest/parameters

**Response**

Example response for anonymous user:

.. code-block:: js

   {
      "parameters" : {
         "maintainer" : "admin@example.com",
         "requirelogin" : "0"
      }
   }

Example response for authenticated user:

.. code-block:: js

   {
      "parameters" : {
          "allowemailchange" : "1",
          "attachment_base" : "http://bugzilla.example.com/",
          "commentonchange_resolution" : "0",
          "commentonduplicate" : "0",
          "cookiepath" : "/",
          "createemailregexp" : ".*",
          "defaultopsys" : "",
          "defaultplatform" : "",
          "defaultpriority" : "--",
          "defaultseverity" : "normal",
          "duplicate_or_move_bug_status" : "RESOLVED",
          "emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$",
          "emailsuffix" : "",
          "letsubmitterchoosemilestone" : "1",
          "letsubmitterchoosepriority" : "1",
          "mailfrom" : "bugzilla-daemon@example.com",
          "maintainer" : "admin@example.com",
          "maxattachmentsize" : "1000",
          "maxlocalattachment" : "0",
          "musthavemilestoneonaccept" : "0",
          "noresolveonopenblockers" : "0",
          "password_complexity" : "no_constraints",
          "rememberlogin" : "on",
          "requirelogin" : "0",
          "urlbase" : "http://bugzilla.example.com/",
          "use_see_also" : "1",
          "useclassification" : "1",
          "usemenuforusers" : "0",
          "useqacontact" : "1",
          "usestatuswhiteboard" : "1",
          "usetargetmilestone" : "1",
      }
   }

A logged-out user can only access the ``maintainer`` and ``requirelogin``
parameters.

A logged-in user can access the following parameters (listed alphabetically):

* allowemailchange
* attachment_base
* commentonchange_resolution
* commentonduplicate
* cookiepath
* defaultopsys
* defaultplatform
* defaultpriority
* defaultseverity
* duplicate_or_move_bug_status
* emailregexpdesc
* emailsuffix
* letsubmitterchoosemilestone
* letsubmitterchoosepriority
* mailfrom
* maintainer
* maxattachmentsize
* maxlocalattachment
* musthavemilestoneonaccept
* noresolveonopenblockers
* password_complexity
* rememberlogin
* requirelogin
* search_allow_no_criteria
* urlbase
* use_see_also
* useclassification
* usemenuforusers
* useqacontact
* usestatuswhiteboard
* usetargetmilestone

A user in the tweakparams group can access all existing parameters.
New parameters can appear or obsolete parameters can disappear depending
on the version of Bugzilla and on extensions being installed.
The list of parameters returned by this method is not stable and will
never be stable.

Last Audit Time
---------------

Gets the most recent timestamp among all of the events recorded in the audit_log
table.

**Request**

To get most recent audit timestamp for all classes:

.. code-block:: text

   GET /rest/last_audit_time

To get the the most recent audit timestamp for the ``Bugzilla::Product`` class:

.. code-block:: text

   GET /rest/last_audit_time?class=Bugzilla::Product

=====  =====  ===================================================================
name   type   description
=====  =====  ===================================================================
class  array  The class names are defined as ``Bugzilla::<class_name>"`` such as
              Bugzilla:Product`` for products.
=====  =====  ===================================================================

**Response**

.. code-block:: js

   {
     "last_audit_time": "2014-09-23T18:03:38Z"
   }

===============  ======  ====================================================
name             type    description
===============  ======  ====================================================
last_audit_time  string  The maximum of the at_time from the audit_log.
===============  ======  ====================================================