Refresh catalog in rancher with API call

78 views Asked by At

I can not find api call to refresh catalog/repository in rancher with API call. Is this function implemented? Version of rancher is v2.6.7. I can do it with rancher cli, but cli is not working for new apps, so we decided to use API calls.

1

There are 1 answers

0
Slickwarren On

you can enable view in api option to view most resources through the API screenshot of 'view in api' through rancher UI

If you do this for a catalog, you will see the norman / v3 api options. For catalogs, you have the refresh action which is what you're looking for. The curl call would look something like

curl -u "${CATTLE_ACCESS_KEY}:${CATTLE_SECRET_KEY}" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
'https://${rancher_url}/v3/catalogs/system-library?action=refresh' 

note that directly using the v3 api is not covered under rancher support, so use this at your own discretion.