fedora-infra / mirrormanager2

Rewrite of the MirrorManager application in Flask and SQLAlchemy
https://mirrormanager.fedoraproject.org
GNU General Public License v2.0
63 stars 46 forks source link

JSON export with latest mirror update date #313

Closed abitrolly closed 1 year ago

abitrolly commented 1 year ago

Could not find any official API at https://mirrormanager.readthedocs.io/en/latest/ so it might be that the method that exports JSON data already exists. In any case it would be nice to have API documented.

I want to find the mirror that already contains the update FEDORA-2022-8cf9d64c36 pushed yesterday. I tried several with no luck. The website provides information that some mirrors are out of sync, but doesn't specify which are uptodate. With JSON data export I can quickly grep and sort to find this out.

adrianreber commented 1 year ago

There is no such API. If you can figure out the checksum of the repomd.xml that contains FEDORA-2022-8cf9d64c36 then it should be doable to get a list of mirrors that contains this update, but MirrorManager has no knowledge about things like FEDORA-2022-8cf9d64c36. MirrorManager only tracks the checksums of repomd.xml files.

I am closing this as we do not have any knowledge on the MirrorManager level about the content and labels like FEDORA-2022-8cf9d64c36. This is only about checksums.

abitrolly commented 1 year ago

@adrianreber can I get the JSON of everything that MirrorManager knows about repos? Time of the last update should cover it.

adrianreber commented 1 year ago

Each metalink contains a timestamp and checksum for each repository/architecture combination. Not JSON but XML.

abitrolly commented 1 year ago

Where to find these metalinks? I don't see them here https://admin.fedoraproject.org/mirrormanager/ to see how can I parse them.

adrianreber commented 1 year ago

Just have a look in your repository definition files in /etc/yum.repos.d/. Something like:

https://mirrors.fedoraproject.org/metalink?repo=fedora-36&arch=x86_64

abitrolly commented 1 year ago

So I need to go over these files one by one. Does mirrormanager2 parse them already?