diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-07-12 16:39:50 -0400 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-07-12 16:39:50 -0400 |
commit | 384d1d254d14bafc3fdf62a08668c6cb36249563 (patch) | |
tree | 4d4845fb43d9f3a85ee8cdb5c97afcb8aa7dff8a /Bugzilla/WebService/User.pm | |
parent | 8a2ac0569e86483b6825d8b71bca4adbac345a1c (diff) | |
download | bugs-384d1d254d14bafc3fdf62a08668c6cb36249563.tar bugs-384d1d254d14bafc3fdf62a08668c6cb36249563.tar.gz bugs-384d1d254d14bafc3fdf62a08668c6cb36249563.tar.bz2 bugs-384d1d254d14bafc3fdf62a08668c6cb36249563.tar.xz bugs-384d1d254d14bafc3fdf62a08668c6cb36249563.zip |
Bug 866927 - Enhance Bugzilla WebServices to allow data access using REST
r=glob,a=justdave
Diffstat (limited to 'Bugzilla/WebService/User.pm')
-rw-r--r-- | Bugzilla/WebService/User.pm | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index b8a3763a2..08c812076 100644 --- a/Bugzilla/WebService/User.pm +++ b/Bugzilla/WebService/User.pm @@ -127,7 +127,7 @@ sub create { # $call = $rpc->call( 'User.get', { ids => [1,2,3], # names => ['testusera@redhat.com', 'testuserb@redhat.com'] }); sub get { - my ($self, $params) = validate(@_, 'names', 'ids'); + my ($self, $params) = validate(@_, 'names', 'ids', 'match', 'group_ids', 'groups'); Bugzilla->switch_to_shadow_db(); @@ -399,6 +399,10 @@ log in/out using an existing account. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Logging In and Out =head2 login @@ -417,7 +421,7 @@ etc. This method logs in an user. =over -=item C<login> (string) - The user's login name. +=item C<login> (string) - The user's login name. =item C<password> (string) - The user's password. @@ -541,6 +545,13 @@ actually receive an email. This function does not check that. You must be logged in and have the C<editusers> privilege in order to call this function. +=item B<REST> + +POST /user + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B<Params> =over @@ -584,6 +595,8 @@ password is under three characters.) =item Error 503 (Password Too Long) removed in Bugzilla B<3.6>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -598,6 +611,14 @@ B<EXPERIMENTAL> Updates user accounts in Bugzilla. +=item B<REST> + +PUT /user/<user_id_or_name> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> and C<names> params are overridden as they +are pulled from the URL path. + =item B<Params> =over @@ -684,6 +705,14 @@ Logged-in users are not authorized to edit other users. =back +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head1 User Info @@ -698,6 +727,18 @@ B<STABLE> Gets information about user accounts in Bugzilla. +=item B<REST> + +To get information about a single user: + +GET /user/<user_id_or_name> + +To search for users by name, group using URL params same as below: + +GET /user + +The returned data format is the same as below. + =item B<Params> B<Note>: At least one of C<ids>, C<names>, or C<match> must be specified. @@ -920,6 +961,8 @@ illegal to pass a group name you don't belong to. =item C<groups>, C<saved_searches>, and C<saved_reports> were added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back |