Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

crucible indexing performance by restapi

Hi , we've added 1000+ repositories in crucible . 95% of repositories status shows "Awiting poll" (I've installed new crucible version ), I want to check the indexing status using curl or wget method to hit the crucible URL

Please share me your idea about how to verify the indexing status or initial indexing performance using curl or wget from Crucible server

Thanks

Dhandapani

2 answers

Try using the REST interface explained at https://docs.atlassian.com/fisheye-crucible/latest/wadl/fisheye.html#d2e89

You may be able to use the finishedFullSlurp or repositoryState to find this information.

thanks Renjith, I am using this restapi call, but I receive error below .

my $token = "user:bccd9907f6654ba1bfd49e428eadd4485e096c";
my $client = REST::Client->new();
my $lwp_client = LWP::UserAgent->new;
$client->setHost('http://host:8060');

##############################################################################
my $xml = new XML::Simple;
my $url = 'http://host:8060/rest-service-fe/repositories-v1';
my $request = HTTP::Request->new(POST => $url);
$request->content_type("application/xml");
my $patch = <<EOF;
<repositoryList>
<repository repositoryState="RUNNING" name="project" finishedFullSlurp="true" enabled="true"/>
<repository repositoryState="STOPPED" name="project" finishedFullSlurp="true" enabled="false"/>
</repositoryList>
EOF

my $headers = {"Accept" =>'application/xml', "Content-Type" => 'application/xml', "Authorization" =>'Basic '};
#my $responseContent = $client->POST('/rest-service/reviews-v1/?FEAUTH='.$token, $patch, $headers);
my $responseContent = $client->POST('/rest-service/reviews-v1/?FEAUTH=',$patch, $headers);
print $client->responseContent();

But I am receiving this error, I am using valid token only. I am able to create reviews and add patch using my token. but the above query only report this below error.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>401</status-code><message>The login token provided is invalid</message></status>

I

Hold on a sec. I thought you want to get data of the respository status. Why are you Posting data to the REST interface then? You should just do a GET of the interface. And pass FEAUTH as a query parameter. (check https://answers.atlassian.com/questions/66167/token-login-with-fisheye-crucible-not-working-for-rest-request)

I've used curl , its working , but output format is not clear , the list is more than 1000+ repositoires. All are printing at same line.

my $cmd_exec = system("curl --cookie remember=$token -X GET http://host:8060/rest-service-fe/repositories-v1");

If I use rest api call, it doesn't work. I've added URL and header informtion.

REST::Client exception: headers must be presented as a hashref at test.pl line 49

In curl you are storing the session cookie and then using it. While using the API as I said, pass the token as GET query parameter FEAUTH. Try it out in a browser Dhandapani. Use this for a nice output in Chrome

https://chrome.google.com/webstore/detail/rest-console/cokgbflfommojglbmbpenpphppikmonn?hl=en

Hi Renjith

I am using this REST API call, I am trying to find my mistake here.

I am getting this error

REST::Client exception: headers must be presented as a hashref at test.pl line 48

use REST::Client;
use JSON;
use Data::Dumper;
use MIME::Base64;
use LWP::UserAgent;
use LWP::Simple;
use XML::Parser;
use XML::Twig;
use HTTP::Request::Common qw(GET);
my $tokenpath = "/tmp/token";
my $token = `/bin/cat $tokenpath`;
chomp $token;
my $client = REST::Client->new();

my $lwp_client = LWP::UserAgent->new;
$client->setHost('http://host:8060');


my $headers = { "Accept" => 'application/xml', "Content-Type" => 'application/xml', "Authorization" => 'Basic ' };

##############################################################################
my $xml = new XML::Simple;
my $url = 'http://host:8060/rest-service-fe/repositories-v1';
my $request = HTTP::Request->new(GET => $url);
$request->content_type("application/xml");
my $patch = <<EOF;
<repositoryList>
<repository repositoryState="RUNNING" name="project" finishedFullSlurp="true" enabled="true"/>
<repository repositoryState="STOPPED" name="project" finishedFullSlurp="true" enabled="false"/>
</repositoryList>
EOF

my $headers = {"Accept" =>'application/xml', "Content-Type" => 'application/xml', "Authorization" =>'Basic '};
my $responseContent = $client->GET('/rest-service-fe/repositories-v1/?FEAUTH='.$token, $patch, $headers);
print $client->responseContent();

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Comparison between Zephyr & Xray

I am sharing this article with both Zephyr and Xray information and everything should be in one place. It will be easy to know when selecting Zephyr or Xray. Zephyr and Xray are both Jira plug-ins u...

180 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you