Uploads and extracts a codebase zip file for a project. (* Maximum supported file size is 10GB.). Upload only files with extensions zip,tar,tar.gz and 7z. Do not upload any .gz files directly without archiving it in a tar file. The upload result may come wrong if any compressed files uploaded directly without archiving it. Only Project Admin and Analyst can upload project codebase to a project.
Try it out is not available for this API. This API can be tested using conventional REST API clients such as postman or cURL.
When calling this API from a REST client, you need to run curl as follows
curl -X POST "http://HOST:PORT/codeinsight/api/project/uploadProjectCodebase?projectId=PROJECT_ID&deleteExistingFileOnServer=true&expansionLevel=1" -H "accept: application/json" -H "Authorization: Bearer JWT_TOKEN" -H "content-type: application/octet-stream" --data-binary "@path/filename.zip"Delete existing files on server. By deleting exiting files on the server, all existing project codebase files will be permanently removed from the scan server. If you rescan the project without replacing these files via a new upload, the scan results for the removed files will be permanently deleted.
- Mock serverhttps://codeinsightapi.redocly.app/_mock/swagger/project/uploadProjectCodebase
- Code Insight REST API Serverhttps://codeinsightapi.redocly.app/codeinsight/api/project/uploadProjectCodebase
curl -i -X POST \
'https://codeinsightapi.redocly.app/_mock/swagger/project/uploadProjectCodebase?projectId=1&deleteExistingFileOnServer=false&expansionLevel=0&deleteArchiveAfterExpand=false&archiveDirSuffix=string' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/octet-stream' \
-d true