How to access Bitbucket Server bundled elasticsearch via REST API
Asked Answered
G

0

14

I need to run a code search report across many projects/repositories hosted on Bitbucket Server.

The browser interface is not helpful for this task as it pages the results and requires manual scrolling to load the (many) results.

Found a REST API at /rest/search/1.0/search (marked private), but there's no indication how to construct the POST payload with code search terms.

Has anyone found a way to use this (I know, private) API?

Alternatively, is there a way to query the bundled elasticsearch server directly from the command line?

Glaring answered 6/6, 2017 at 17:22 Comment(1)
I spent about 3 hours looking at this and it's.. a mess. The actual endpoints and searches are done (I think) in the files located at: ./app/WEB-INF/atlassian-bundled-plugins/. I only put one of the many, many, many files online to decompile and it pulls configuration from all over the shop. I think your best bet might be to run a comprehensive CFR decompile overnight on the entire package and see what it's actually querying. As far as I could make it it passes from the REST api the application exposes to these *.java ones which then passes back to the REST and to the client.Inhospitable

© 2022 - 2024 — McMap. All rights reserved.