From fbb30d2c53cbbd71c80d58b30d2ec77f3c14d403 Mon Sep 17 00:00:00 2001 From: "mozilla%colinogilvie.co.uk" <> Date: Mon, 19 May 2008 23:38:23 +0000 Subject: Bug 415278: Make the WebService's plugin discovery method more extendable Patch by: Colin Ogilvie ; r=mkanat; a=LpSolit --- contrib/bz_webservice_demo.pl | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl index a5e6af9f9..32c8561a0 100755 --- a/contrib/bz_webservice_demo.pl +++ b/contrib/bz_webservice_demo.pl @@ -54,6 +54,7 @@ my $legal_field_values; my $add_comment; my $private; my $work_time; +my $fetch_extension_info = 0; GetOptions('help|h|?' => \$help, 'uri=s' => \$Bugzilla_uri, @@ -66,7 +67,8 @@ GetOptions('help|h|?' => \$help, 'field:s' => \$legal_field_values, 'comment:s' => \$add_comment, 'private:i' => \$private, - 'worktime:f' => \$work_time + 'worktime:f' => \$work_time, + 'extension_info' => \$fetch_extension_info ) or pod2usage({'-verbose' => 0, '-exitval' => 1}); =head1 OPTIONS @@ -133,6 +135,10 @@ An optional non-zero value to specify B<--comment> as private. An optional double precision number specifying the work time for B<--comment>. +=item --extension_info + +If specified on the command line, the script returns the information about the +extensions that are installed. =back @@ -193,6 +199,25 @@ $soapresult = $proxy->call('Bugzilla.timezone'); _die_on_fault($soapresult); print 'Bugzilla\'s timezone is ' . $soapresult->result()->{timezone} . ".\n"; +=head2 Getting Extension Information + +Returns all the information any extensions have decided to provide to the webservice. + +=cut + +if ($fetch_extension_info) { + $soapresult = $proxy->call('Bugzilla.extensions'); + _die_on_fault($soapresult); + my $extensions = $soapresult->result()->{extensions}; + foreach my $extensionname (keys(%$extensions)) { + print "Extensionn '$extensionname' information\n"; + my $extension = $extensions->{$extensionname}; + foreach my $data (keys(%$extension)) { + print ' ' . $data . ' => ' . $extension->{$data} . "\n"; + } + } +} + =head2 Logging In and Out =head3 Using Bugzilla's Environment Authentication -- cgit v1.2.3-24-g4f1b