Description
Artifactory's virtual repository type allows you to set a "Default Deployment Repository", enabling users to upload artifacts via the virtual repository:
In addition to the UI, you can also add or modify a "Default Deployment Repository" via API, such as through the following API:
(Update Repository Configuration: https://jfrog.com/help/r/jfrog-rest-apis/update-repository-configuration)
curl -uadmin:password -X POST http://localhost:8082/artifactory/api/repositories/generic-virtual -H "Content-Type: application/json" -d '{"defaultDeploymentRepo" : "generic-local1"}'
Response:
Repository generic-virtual update successfully.
However, if you want to remove the "Default Deployment Repository" via API, you usually don't know how to do it. Setting the "defaultDeploymentRepo" to "null" or removing the "defaultDeploymentRepo" parameter doesn't work.
How to solve this issue? Here is a workaround.
Solution
You can set the "Default Deployment Repository" to a Non-existent repository name, such as "generic-xxx":
curl -uadmin:password -X POST http://localhost:8082/artifactory/api/repositories/generic-virtual -H "Content-Type: application/json" -d '{"defaultDeploymentRepo" : "generic-xxx"}'After that, you can see the "Default Deployment Repository" has been removed from the UI:
This might be helpful if you have a lot of virtual repositories that need to be configured via API.