Current API does allow to list all projects. The /api/coprs/?search=<project> insists on at least 3 characters. (Why?) The /api/coprs/?username=<username> needs an user name to list projects of the users. But there is no service to list all users. I parsed all users from web interface, but it's too slow (over 3 minutes to retrieve 444 users scattered to 100 pages). Also the numbers (100 and 444) look suspicious. Is everything visible on the web?
(In reply to Petr Pisar from comment #0) > The /api/coprs/?search=<project> insists on at least 3 characters. (Why?) Copr works with FAS accounts and FAS requires usernames to be at least 3 characters long.
(In reply to Petr Šabata from comment #1) > (In reply to Petr Pisar from comment #0) > > The /api/coprs/?search=<project> insists on at least 3 characters. (Why?) > > Copr works with FAS accounts and FAS requires usernames to be at least 3 > characters long. However /api/coprs/?search=<project> searches for projects. Not for user names.
Hello Petr, we apologize, that this took years to someone to look at this RFE. Meanwhile, both APIv1 (aka Legacy API) and APIv2 (aka REST-like API) are deprecated. What was the actual goal? Getting all projects (from all users) in Copr? This was implemented in 3861a97 (PR#458) and you don't need to go through a list of users anymore. You can try this code sample from copr.v3 import Client from copr.v3.pagination import next_page client = Client.create_from_config_file() projects_page = client.project_proxy.get_list(pagination={"limit": 10}) while projects_page: for project in projects_page: print(project.full_name) projects_page = next_page(projects_page) (The example uses pagination, which is not otherwise required. I just wouldn't recommend anyone to query all projects in Copr without it.)
The actual goal was to enumerate all projects in Copr. I'm glad you implemented it. However the provided example does not work for me with current python3-copr-1.90-1.fc28: $ python3 /tmp/test Traceback (most recent call last): File "/tmp/test", line 6, in <module> projects_page = client.project_proxy.get_list(pagination={"limit": 10}) TypeError: get_list() missing 1 required positional argument: 'ownername' The ProjectProxy's get_list method still requires ownername as a second argument: def get_list(self, ownername, pagination=None): Do I understand the MODIFIED state correctly that the new code is not yet available in any Fedora, but it will be in near future? If it is so, just close this bug when the code reaches Fedora.
> Do I understand the MODIFIED state correctly that the new code is not yet available in any Fedora, but it will be in near future? Exactly. It is modified in the master, but not yet released.
This BZ was fixed during the latest Copr release. Feel free to reopen, if you encounter any difficulties with the provided solution.