Bugzilla:API Comparison: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 73: Line 73:


* /bug POST -- Bug.create
* /bug POST -- Bug.create
The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* The BzAPI call takes the initial description as a single member of the "comments" array rather than as a single-valued field called "description".
* The BzAPI call takes User objects rather than flat email addresses.
* The BzAPI call accepts any fields; it does a behind-the-scenes update for any fields not set in the initial Bug.create call. The RPC call only takes a [http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html#create limited set of fields].


===Retrieve bug===
===Retrieve bug===
Line 85: Line 93:


* /bug/<id>/comment GET -- Bug.comments
* /bug/<id>/comment GET -- Bug.comments
The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* The BzAPI call only works for a single bug, as specified in the URL used. The RPC call works for multiple bugs.
* The RPC call can request comments by ID; the BzAPI does not have that ability.
* BzAPI returns User objects rather than bare email addresses
* BzAPI does not return the bug_id field for each comment
* BzAPI returns attachment_ref fields if there is an attachment_id
* BzAPI does not return the "count" field (for consistency; as it's new - code comment says "feel free to add it back when making native" :-)
* BzAPI does not return the (deprecated) "time" field; it returns "creation_time" (which RPC also returns).


===Add new comment to bug===
===Add new comment to bug===


* /bug/<id>/comment POST -- Bug.add_comment
* /bug/<id>/comment POST -- Bug.add_comment
The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* BzAPI does not support the "work_time" parameter.
* BzAPI return value includes a "ref" as well as an "id".


===List history for bug===
===List history for bug===


* /bug/<id>/history GET -- Bug.history
* /bug/<id>/history GET -- Bug.history
The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* RPC "who" field is "changer" in BzAPI
* RPC "when" field is "change_time" in BzAPI
* The BzAPI call uses consistent, modern field names for the 'field_name' field on each history entry
* The BzAPI call returns User objects rather than email addresses for the 'changer' field


===List attachments for bug===
===List attachments for bug===
Line 109: Line 145:


* /user GET -- User.get
* /user GET -- User.get
The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* REST only supports search by name matching. RPC supports an exact name list, name matching, an ID list, and/or group.


===Retrieve user===
===Retrieve user===
Line 114: Line 156:
* /user/<id> GET -- User.get
* /user/<id> GET -- User.get


The BzAPI call is backed by the RPC call, so they are quite similar.
Differences:
* REST supports retrieving individual users by ID or by name. RPC just has the general search call which can be made specific.


==Configuration Calls: Details==
==Configuration Calls: Details==
Line 214: Line 261:


(although some config stuff is available as more specific calls)
(although some config stuff is available as more specific calls)
==Scratchpad==
* Need to check if there are differences in include_fields/exclude_fields support
* What about return values?

Revision as of 15:50, 21 May 2013

This page attempts to list the differences between the Bugzilla XML-RPC/JSON-RPC API (on the Bugzilla tip) and the BzAPI REST API (on the BzAPI tip). This will hopefully be useful data as we figure out how to align them, as Bugzilla implements a native REST API.

High Level

Matching Calls

  • Search for bugs: /bug GET -- Bug.search
  • Create new bug: /bug POST -- Bug.create
  • Retrieve bug: /bug/<id> GET -- Bug.get
  • Update bug: /bug/<id> PUT -- Bug.update / Bug.update_see_also / Bug.update_tags
  • List comments for bug: /bug/<id>/comment GET -- Bug.comments
  • Add new comment to bug: /bug/<id>/comment POST -- Bug.add_comment
  • List history for bug: /bug/<id>/history GET -- Bug.history
  • List attachments for bug: /bug/<id>/attachment GET -- Bug.attachments
  • Create new attachment: /bug/<id>/attachment POST -- Bug.add_attachment
  • Retrieve attachment: /attachment/<id> GET -- Bug.attachments
  • Search for users: /user GET -- User.get
  • Retrieve user: /user/<id> GET -- User.get

RPC Calls Supplying Subsets of REST /config Call

  • Get current Bugzilla version: Bugzilla.version
  • Get info about classifications by name or ID: Classification.get
  • Get info about products: Product.get
  • Get info about fields and their legal values: Bug.fields

RPC Calls Not In REST

User

  • Get list of installed extensions: Bugzilla.extensions
  • Get info about Bugzilla's notions of time: Bugzilla.time
  • Get safe parameter values: Bugzilla.parameters
  • Get the latest time from the audit_log table: Bugzilla.last_audit_time
  • Get info about products a user can search on: Product.get_selectable_products
  • Get info about products a user can enter bugs against: Product.get_enterable_products
  • Get info about products a user can search or enter bugs against: Product.get_accessible_products

Admin

  • Create a new group: Group.create
  • Update info about a group: Group.update
  • Create a new product: Product.create
  • Update info about a product: Product.update
  • Offer account by email: User.offer_account_by_email
  • Create a user account: User.create
  • Update a user account: User.update

Not Needed For REST

  • Log in to RPC interface: User.login
  • Log out of RPC interface: User.logout

Deprecated

  • Bugzilla.timezone
  • Bug.legal_values

REST Calls Not In RPC

  • List flags for bug: /bug/<id>/flag GET (no specific call, although Bug.get returns the info)
  • Count bugs: /count GET
  • Update attachment metadata: /attachment/<id> PUT
  • Get Configuration: /configuration GET (although some config stuff is available as more specific calls)


Matching Calls: Details

Create new bug

  • /bug POST -- Bug.create

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • The BzAPI call takes the initial description as a single member of the "comments" array rather than as a single-valued field called "description".
  • The BzAPI call takes User objects rather than flat email addresses.
  • The BzAPI call accepts any fields; it does a behind-the-scenes update for any fields not set in the initial Bug.create call. The RPC call only takes a limited set of fields.

Retrieve bug

  • /bug/<id> GET -- Bug.get

Update bug

  • /bug/<id> PUT -- Bug.update / Bug.update_see_also / Bug.update_tags

List comments for bug

  • /bug/<id>/comment GET -- Bug.comments

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • The BzAPI call only works for a single bug, as specified in the URL used. The RPC call works for multiple bugs.
  • The RPC call can request comments by ID; the BzAPI does not have that ability.
  • BzAPI returns User objects rather than bare email addresses
  • BzAPI does not return the bug_id field for each comment
  • BzAPI returns attachment_ref fields if there is an attachment_id
  • BzAPI does not return the "count" field (for consistency; as it's new - code comment says "feel free to add it back when making native" :-)
  • BzAPI does not return the (deprecated) "time" field; it returns "creation_time" (which RPC also returns).

Add new comment to bug

  • /bug/<id>/comment POST -- Bug.add_comment

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • BzAPI does not support the "work_time" parameter.
  • BzAPI return value includes a "ref" as well as an "id".

List history for bug

  • /bug/<id>/history GET -- Bug.history

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • RPC "who" field is "changer" in BzAPI
  • RPC "when" field is "change_time" in BzAPI
  • The BzAPI call uses consistent, modern field names for the 'field_name' field on each history entry
  • The BzAPI call returns User objects rather than email addresses for the 'changer' field

List attachments for bug

  • /bug/<id>/attachment GET -- Bug.attachments

Create new attachment

  • /bug/<id>/attachment POST -- Bug.add_attachment

Retrieve attachment

  • /attachment/<id> GET -- Bug.attachments

Search for users

  • /user GET -- User.get

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • REST only supports search by name matching. RPC supports an exact name list, name matching, an ID list, and/or group.

Retrieve user

  • /user/<id> GET -- User.get

The BzAPI call is backed by the RPC call, so they are quite similar.

Differences:

  • REST supports retrieving individual users by ID or by name. RPC just has the general search call which can be made specific.

Configuration Calls: Details

BzAPI has a single call to get a large config data structure, whereas the RPC API is more fine-grained.

Get current Bugzilla version

  • Bugzilla.version

Get info about classifications by name or ID

  • Classification.get

Get info about products

  • Product.get

Get info about fields and their legal values

  • Bug.fields

RPC Calls Not In REST: Details

Get list of installed extensions

  • Bugzilla.extensions

Get info about Bugzilla's notions of time

  • Bugzilla.time

Get safe parameter values

  • Bugzilla.parameters

Get the latest time from the audit_log table

  • Bugzilla.last_audit_time

Get info about products a user can search on

  • Product.get_selectable_products

Get info about products a user can enter bugs against

  • Product.get_enterable_products

Get info about products a user can search or enter bugs against

  • Product.get_accessible_products

Create a new group

  • Group.create

Update info about a group

  • Group.update

Create a new product

  • Product.create

Update info about a product

  • Product.update

Offer account by email

  • User.offer_account_by_email

Create a user account

  • User.create

Update a user account

  • User.update

REST Calls Not In RPC: Details

List flags for bug

  • /bug/<id>/flag GET

(no specific call, although Bug.get returns the info)

Count bugs

  • /count GET

Update attachment metadata

  • /attachment/<id> PUT

Get Configuration

  • /configuration GET

(although some config stuff is available as more specific calls)

Scratchpad

  • Need to check if there are differences in include_fields/exclude_fields support
  • What about return values?