We currently donât have any public API to do the import of repositories.
If your repositories are compatible with Autoscan it should be enabled by default when you import your projects.
Otherwise Iâm wondering, do you know that you can import multiple projects at once ? Does this not answer your need ? Could you clarify your use case behind the need for an API to do the import ?
Let me explain in other words. You know, we are working with microservices. And it means that you have dozens of repositories and every day we are creating a new repository. We automized the creation of repositories by integrating them with other DevSecOps tools (SNYK, Veracode, etc). So, now we want to import repo to SonarCloud immediately right after the creation of repo.
It is not the solution, because we want to add right after creation with API.
Thanks for the explanation, it seems like a valid use case that we donât support yet and as far as I know we donât have plan to support it either. So I suggest that you do a feature request.
And unfortunately, in the mean time, I donât really have any solution for youâŠ
Also to note (because it was misleading for me), you should use this API instead of /api/projects/create and not in conjunction with it, as it creates project in SonarCloud itself.
Hey all, I know it has been a while. I am trying to use the two APIs mentioned above, but I am getting the following error for both:
â{âerrorsâ:[{âmsgâ:âAn unexpected error occurred. Please try again later.â}]}%â
Are the above APIS still valid?
I am using the following CURL commands:
âcurl --include \
ârequest POST \
âheader âContent-Type: application/x-www-form-urlencodedâ \ -u ${SONAR_TOKEN}: \ âdata-binary âinstallationKeys=${GITHUB_ORG}%2F${REPO_NAME}%7C${REPO_ID}&organization=${SONAR_ORG}â \ âhttps://sonarcloud.io/api/alm_integration/provision_projectsââ