How to upload a component via the WEB API?

I want to integrate SolarQube with Bonitasoft.

In a process, there is a lot of pieces of code everywhere. So, I would like to dynamically speak with a SolarQube to upload component, check them.

Basically, I would like to do using the WEB API:

  • Create project
    ==> api/projects/create?name=myProcess&project=myProcess&visibility=public

  • upload component in the project
    ==> ???

  • Ask SolarQube to analyse them
    ==> api/projects/update_key?from=myProcess&to=myProcess ?

  • collect issue
    => api/issues/search?s=FILE_LINE&resolved=false&ps=100&facets=severities%2Ctypes&additionalFields=_all&componentKeys=myProcess

So, I miss the point “how can I upload a component?”
If I can, I can write it on a file system, visible by sonarQub. But how do I know the file system?

Thank you for your help,

Hello @Pierre-Yves,

I think you misinterpreted how SQ works. It analyses code with the help of a scanner. The SonarQube application in itself does not analyze code.

Once the scanner is done, he sends its report to SonarQube which processes it (create components, store the code, measures, issues, etc.). This is not something you will do manually with API calls.

I invite you to carefully read the page I linked, and more generally the documentation.

Hello Antoine, thank you for your reply!

I don’t see the page you linked.
I understand now that SonarQube only registers the result. So, I need to find a way to execute the scanner by an API: could you point me to an API to execute it?
I found this page
I found this GitHub but no documentation “how to use it” or a Javadoc to use the API. I may need to re-engineering the source code :slight_smile:

Bizarre, the sonar scanner should be installed with the sonarqube (because it scans my example) but I don’t find it in the installation.

I will try to download it and try it then.

Thank you