Reference: http://www.bugzilla.org/docs/3.2/en/html/api/Bugzilla/WebService.html
API Name
Bugzilla::webservice-bugzilla's Web Service interface
Describe
This is the standard API that external programs want to interact with Bugzilla, which provides various ways of each module. The only way to access the API currently is through XML-RPC, the relevant standards can be see: http://www.xmlrpc.com/spec
The Access portal for Bugzilla webservices is the script file in the Bugzilla installation directory xmlrpc.cgi
. For example, if your Bugzilla is located on bugzilla.yourdomain.com,那么
your XML-RPC client, you will have access to the API:http://bugzilla.yourdomain.com/xmlrpc.cgi
Method invocation
Bugzilla currently does not implement the extended attribute of the standard Xml-rpc method invocation. The Xml-rpc method is called in a regular-mode manner. Methods are grouped in the form of "packages", such as a Bug corresponding to Bugzilla::webservice::bug. So if it is "get" in bugzilla::webservice::bug, it should be used in XML-RPCBug.get调用。
Parameters
In addition to the standard parameter types such as int
, string等外,XML-RPC还有两种数据结构
<struct>
and<array>。
Structs
XML-RPC:
<struct> <member> <name>fruit</name> <value><string>oranges </string></value> </member> <member> <name>vegetable</name> <value><string>lettuce</string></value> </member> </struct>
In the API documentation:
{fruit = ' oranges ', vegetable = ' lettuce '}
Arrays
The following sample code, [
and ]
the end-to-end definition used to represent the array.
For example, an array in the XML-RPC
<array> <data> <value><i4>1</i4></value> <value>< i4>2</i4></value> <value><i4>3</i4></value> </data> < /array>
In the API documentation, you will write:
[1, 2, 3]
Bugzilla WebService method How to receive parameters
all the The Bugzilla webservices function receives parameters in the form of <struct>. In other words, all functions receive only a single parameter, and all parameters are included in this parameter. The parameters of the corresponding names listed in the API documentation imply that they are placed in the struct data structure.
Account Login
You can use the "login" in Bugzilla::webservice::user interface to login to the Bugzilla account. This will result in standard HTTP cookies, which must be used in future calls, so your XML-RPC client must be able to receive and send cookies.
Methods a stable, experimental, and unstable state.
Methods is marked STABLE If you can expect their parameters and return values does to change between versions of Bugzilla. You is best off always using methods markedSTABLE. We may add parameters and additional items to the return values, but your old code would always continue EW changes we make. If we ever break aSTABLE interface, we'll post a big notice in the Release Notes, and it'll only happen during A major new release.
Methods (or parts of Methods) is marked experimental if we believe they would be stable, but there ' s a s Light chance that small parts'll change in the future.
Certain parts of a method ' s description May is marked as UNSTABLE, in which case those parts is not guaranteed t o stay the same between Bugzilla versions.
Error
If a webservice call fails, it throws a standard XML-RPC error. Includes a number format error code, along with the corresponding description text. These error codes are fixed and do not change due to bugzilla version changes.
Various thrown errors are declared by the corresponding documents of those functions. If you need to know what errors will be thrown in your code, use a numeric code instead of parsing those descriptive text, as the versions may change.
Temporary errors and critical errors
If the error code is a number greater than 0, the error can be called a temporary error, which means that the user's input caused the error, not the system itself.
If the error code is less than 0, then the error is fatal, meaning a system error and may need to be contacted by the administrator to resolve.
Negative and positive errors are not symmetric, such as having a code name of 302, but not necessarily a 302 error.
Unknown error
Sometimes a function may throw a specific error code, in which case-32000 represents a system critical error, and 32000 represents a temporary error.
About the Bugzilla WebService interface