> On June 14, 2016, 3:24 p.m., Nate Cole wrote:
> > Can you give an example of a read directive?

This is for a future enhancement I need to make.  With the addition of the 
`when` clause for a Kerberos descriptor identity, we are able to optionally 
include Kerberos identities depending on what services are installed - soon to 
be the ability to specifiy other expressions as well.  These `when` expressions 
are processed when performing Kerberos-releated operations; however, they are 
not performed when obtaining the Kerberos descriptor JSON data from Ambari via 
the API. Front-ends can use this data to display a page allowing a user to 
customize pricinal names and keytab file locations - for example the `Configure 
Identities` page of the `Enable Kerberos Wizard` in the Ambari server web 
client.  

It is desirable to provide the Kerberos descriptor JSON document, both, in its 
complete form and processed to remove the Kerberos identities that should be 
eliminated due to their `when` clauses.  I propose to provide this ability by 
allowing the caller to specify a directive in the GET command for the Kerberos 
descriptor to declare their desired version of the documment.  For example: 
`evaluate_when=true`

# Retrieve the raw JSON document
```
GET /api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE
```

# Retrieve the processed JSON document
```
GET 
/api/v1/clusters/CLUSTER_NAME/kerberos_descriptors/COMPOSITE?evaluate_when=true
```


- Robert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48702/#review137568
-----------------------------------------------------------


On June 14, 2016, 2:57 p.m., Robert Levas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48702/
> -----------------------------------------------------------
> 
> (Updated June 14, 2016, 2:57 p.m.)
> 
> 
> Review request for Ambari, Ajit Kumar, Di Li, Jonathan Hurley, and Nate Cole.
> 
> 
> Bugs: AMBARI-17224
>     https://issues.apache.org/jira/browse/AMBARI-17224
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add ability to set GET request directives so that directives may be specified 
> in a GET requests. For example, to limit or increase the amount of work 
> needed to be performed internally to generate the data being returned.
> 
> Most data in GET requests are retrieved but filtered from the response based 
> on the predicate. This means that any data the requires significant 
> processing to calculate will be calculated regardless of the requested 
> fields. By using a directive this can be controlled.
> 
> Note: It may be possible the use of a PropertyProvider to control this 
> instead, but that may not be desired in all cases.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/handlers/ReadHandler.java
>  95e45d6 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/Query.java 
> fff842a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java 
> 18fd94b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
>  dcc5217 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
>  8df1a02 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/SimpleResourceDefinition.java
>  394e295 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/UpgradeResourceDefinition.java
>  bf7860b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseRequest.java
>  0ebeb19 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestFactory.java
>  19fee8e 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
>  5cb601e 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
>  f174cb6 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/SimpleResourceDefinitionTest.java
>  6169ee7 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/RequestFactoryTest.java
>  11568c9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/AuditEventCreatorTestHelper.java
>  2642418 
> 
> Diff: https://reviews.apache.org/r/48702/diff/
> 
> 
> Testing
> -------
> 
> # Local test results: 
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 1:25:36.424s
> [INFO] Finished at: Tue Jun 14 14:53:08 EDT 2016
> [INFO] Final Memory: 59M/1864M
> [INFO] 
> ------------------------------------------------------------------------
> 
> # Jenkins test results: PENDING
> 
> 
> Thanks,
> 
> Robert Levas
> 
>

Reply via email to