All,

I'm looking for some information regarding the API and repository sets. 
Specifically, I want to find out if a (redhat) repository is enabled or not 
(as trying to enable an already enabled repository throws an error: errors 
=> "The repository is already enabled").

So far I have a call to available_repositories:

https://sat-server/katello/api/products/52/repository_sets/4792/available_repositories
 
<https://usl10149341.am.hedani.net/katello/api/products/52/repository_sets/4792/available_repositories>
 

Which returns

{ 
"total": 2, 
"subtotal": 2, 
"page": null, 
"per_page": null, 
"error": null, 
"search": null, 
"sort": { 
"by": null, 
"order": null 
}, 
"results": [ 
{ 
"substitutions": { 
"basearch": "i386" 
}, 
"path": "/content/dist/rhel/server/6/6Server/i386/sat-tools/6.2/os", 
"repo_name": "Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs i386", 
"name": "Red Hat Satellite Tools 6.2 (for RHEL 6 Server) (RPMs)", 
"pulp_id": 
"NONAME-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_2_for_RHEL_6_Server_RPMs_i386",
 

"enabled": false, 
"promoted": false 
}, 
{ 
"substitutions": { 
"basearch": "x86_64" 
}, 
"path": "/content/dist/rhel/server/6/6Server/x86_64/sat-tools/6.2/os", 
"repo_name": "Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs x86_64", 
"name": "Red Hat Satellite Tools 6.2 (for RHEL 6 Server) (RPMs)", 
"pulp_id": 
"NONAME-Red_Hat_Enterprise_Linux_Server-Red_Hat_Satellite_Tools_6_2_for_RHEL_6_Server_RPMs_x86_64",
 

"enabled": true, 
"promoted": false 
} 
] 
}

1) I can't search the available_repositories call - passing search or other 
params are just ignored - is this a bug?
2) Only available_repositories seems to indicate the enabled / disabled 
status of a repo

Is there a better way to do this other that to iterate through the whole 
output and pick the repository based on name, basearch and/or releasever?

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to