[katello-devel] returning only specific fields when querying API

Ivan Necas inecas at redhat.com
Fri Jul 12 06:54:26 UTC 2013


It has not so far, but seems reasonable. We will need some notion of 'dynamic' format for
the purpose of modularization as well: some fields in output only when foreman is installed etc.

-- Ivan

----- Original Message -----
> 
> With the increased usage of katello's API, I am wondering if anyone has
> suggestions for infrastructure to allow fetching of just a subset of an
> objects fields.
> 
> Consider this fictional scenario...
> 
> GET /katello/api/systems
>     {[
>       {
>         id: 1                <- stored in katello, no backend service call
>         name: system1        <- stored in katello, no backend service call
>         running: yes         <- backend service call to foreman
>         entitlements: green  <- backend service call to candlepin
>         new_errata: yes      <- backend service call to pulp
>       },
>       {
>         id: 1                <- stored in katello, no backend service call
>         name: system2        <- stored in katello, no backend service call
>         running: no          <- backend service call to foreman
>         entitlements: green  <- backend service call to candlepin
>         new_errata: yes      <- backend service call to pulp
>       }
>     ]}
> 
> Total service calls:
>     1 call to elasticsearch to get all systems
>     2 calls to foreman
>     2 calls to candlepin
>     2 calls to pulp
> 
> 
> GET /katello/api/systems?fields=[name,running]
>     {[
>       {
>         name: system1        <- stored in katello, no backend service call
>         running: yes         <- backend service call to foreman
>       },
>       {
>         name: system2        <- stored in katello, no backend service call
>         running: no          <- backend service call to foreman
>       }
>     ]}
> 
> Total service calls:
>     1 call to elasticsearch to get all systems
>     2 calls to foreman
> 
> 
> Has anything like this been considered?
> 
> Quick search results:
> https://wiki.mozilla.org/Bugzilla:REST_API#Field_Control
> https://community.attask.com/attask-restful-api
> https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Query+issues#JIRARESTAPIExample-Queryissues-Queryofissueswhilstrestrictingtheresult%27sfields
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
> 




More information about the katello-devel mailing list