ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower (JIRA)" <>
Subject [jira] [Commented] (AMBARI-1401) Provide API support for querying sub-resources
Date Mon, 16 Dec 2013 16:25:09 GMT


Tom Beerbower commented on AMBARI-1401:

Given the following API …


Note that the predicate contains elements that apply to the service resource as well as the
component sub resource.
Until now the use of sub resource elements in the predicate has not been supported.
The general approach to supporting sub-resource predicates is as follows … 

 # At each level of the query, extract the portion of the predicate that applies to that resource
type.  So, in the above example the predicate …
… will be used to query for the services, and the predicate …
… will be used to do the query for the component sub resources. 
 # Generate property maps for each resource which contain the properties of their sub resources
that were specified in the predicate.  In the case where there are multiple sub resources
the maps will be added to a set for each parent resource.  In the case where there are multiple
sub-resource types, the maps will be joined.  The logic to generate the property maps will
be recursive so that any level of sub resource depth can be handled.
 # From the original predicate, generate an extended predicate that can evaluate each resource
along with the complete set of sub-resource properties associated with it.

> Provide API support for querying sub-resources
> ----------------------------------------------
>                 Key: AMBARI-1401
>                 URL:
>             Project: Ambari
>          Issue Type: Sub-task
>            Reporter: John Speidel
>            Assignee: John Speidel
> Currently, query predicates can only be applied to the top level resource of a request.
 So, if we wanted to perform a query based on sub-resource state, this would require multiple
> For example, to query for all services which contain a component in any state other than
> .../api/v1/clusters/c1/services?components/ServiceComponentInfo/state!=STARTED
> Because the above request applies a predicate to a sub-resource of service(component),
this is not currently supported. The goal of this Jira is to allow predicates to be applied
to any sub-resource, in addition to the the top level resource of any request.

This message was sent by Atlassian JIRA

View raw message