is it possible to add a repository in JFrog Artifactory without the GUI?

时间:2019-01-18 18:32:13

标签: artifactory

Is it possible to add a repository in Artifactory without the GUI?

Can I configure Artifactory as infrastructure as code?

Thanks!

1 个答案:

答案 0 :(得分:4)

是的,您使用REST API

PUT /api/repositories/new-repo-name
{
  "key": "new-repo-name",
  "rclass" : "local",
  "packageType": "generic"
}

您几乎可以通过REST API在用户界面中做的所有事情,它非常广泛。我遇到了很少的事情,我无法通过这种方式轻松实现自动化。

您还可以使用Artifactory Java clientJFrog Go client,它们分别是Java和Go的库,它们包装了REST API。据我所知,后者是一个相当新的东西,它可能还不支持所有功能。