Adding a new catalog without the UI


I am trying to add a new catalog, via Rancher-cli, but I can’t seem to fond a way to do it.
I was able to add new catalogs via the UI, by specifying the git url and branch, but still struggle to do it via cli.

Could you please give me some hints as to how I could achieve this?

Thanks for suggestions,

There is no support for this in the CLI. You can use the API though, global or per-environment?

Hi @vincent

Thank you for your response.
I followed your advise in using the API, and found this discussion, here, on the forum: Use API to add custom catalog

I managed to add new catalogs, via PUT method, with curl, like :

curl -u “admin:script”
-H ‘Accept: application/json’
-H ‘Content-Type: application/json’
-d ‘{“activeValue”:“library=, community=”,“name”:“catalog.url”,“source”:“Default Environment Variables”,“value”:“library=, community=, xx=https://newurl”}’

This seems to be adding the xx catalog correctly. I don’t know, however, what the “id”:“1as!catalog.url” in the discussion mentioned above is. Is this necessary?

Thanks again,

No, you only need to read and update /v1/settings/catalog.url. What’s returned is actually a slightly different activeSetting resource, but the difference is not relevant to you (or anyone really, we’re going to hide them for 2.0)