fmartinou / whats-up-docker

What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
https://fmartinou.github.io/whats-up-docker
MIT License
939 stars 29 forks source link

Is there a way to execute a re-scan of containers via the API? #339

Closed aheath70 closed 5 months ago

aheath70 commented 6 months ago

I would like to be able to manually launch a re-scan of containers, either all or specific ones. As far as I can tell, the only ways to force a re-scan is to restart the WUD container or click on the WATCH NOW button in the web UI.

Would be great if there was a method in the API that could make it happen.

fmartinou commented 5 months ago

Hi @aheath70 ,

All actions performed through the UI are mapped to the REST API.

The API resource called by the WATCH NOW button is this one: https://fmartinou.github.io/whats-up-docker/#/api/container?id=watch-all-containers

Example:

curl -X POST http://wud:3000/api/containers/watch

[{
  "id":"31a61a8305ef1fc9a71fa4f20a68d7ec88b28e32303bbc4a5f192e851165b816",
  "name":"homeassistant",
  "watcher":"local",
  "includeTags":"^\\d+\\.\\d+.\\d+$",
  "image":{
    "id":"sha256:d4a6fafb7d4da37495e5c9be3242590be24a87d7edcc4f79761098889c54fca6",
    "registry":{
      "url":"123456789.dkr.ecr.eu-west-1.amazonaws.com"
    },
    "name":"test",
    "tag":{
      "value":"2021.6.4",
      "semver":true
    },
    "digest":{
      "watch":false,
      "repo":"sha256:ca0edc3fb0b4647963629bdfccbb3ccfa352184b45a9b4145832000c2878dd72"
    },
    "architecture":"amd64",
    "os":"linux",
    "created":"2021-06-12T05:33:38.440Z"
  },
  "result":{
    "tag":"2021.6.5"
  },
  "updateAvailable": true
}]