netsandbox / ansible-galaxy-outdated

ansible-galaxy-outdated shows currently installed Ansible collections with updated version in Ansible Galaxy

Home Page:https://pypi.org/project/ansible-galaxy-outdated/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible Galaxy API v3

netsandbox opened this issue · comments

https://www.ansible.com/blog/new-ansible-galaxy

 def _get_latest_version(collection_name):
-    url = f"https://galaxy.ansible.com/api/v2/collections/{collection_name.replace('.', '/')}/"
+    url = f"https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/index/{collection_name.replace('.', '/')}/"
 
     with urllib.request.urlopen(url) as f:
         galaxy_data = json.load(f)
@@ -44,7 +44,7 @@
     if galaxy_data["deprecated"]:
         print(f"WARNING: collection {collection_name} is deprecated")
 
-    return galaxy_data["latest_version"]["version"]
+    return galaxy_data["highest_version"]["version"]