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

(Updated Oct. 11, 2017, 8:13 a.m.)


Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


Changes
-------

Added PropertyNotFoundException.


Bugs: AMBARI-22196
    https://issues.apache.org/jira/browse/AMBARI-22196


Repository: ambari


Description
-------

**Following done as part of this JIRA:**

- Move all non-stack specific configs in **cluster-env.xml** to 
**cluster-settings.xml**.
- For example **cluster-env/security_enabled** is a cluster setting and 
shouldn't be associated with any **stack/mpack**. 
{code}
  <property>
    <name>security_enabled</name>
    <value>false</value>
    <description>Hadoop Security</description>
    <on-ambari-upgrade add="true"/>
  </property>
{code}

- Add new file as : **/var/lib/ambari-server/resources/cluster-settings.xml** 
which includes all the read only cluster specific settings.


- **New API Endpoint serving the cluster-settings** : api/v1/cluster_settings


**Followup work :**

- **AMBARI-22197** takes care of removing **cluster-env.xml** and associated 
code and API once we have **AMBARI-22198** completed.


Diffs (updated)
-----

  
ambari-server/src/main/java/org/apache/ambari/server/PropertyNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/ResourcesPathNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 7431f9d 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/RootClusterSettingsResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
 fd15105 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/RootClusterSettingService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
 67d3a15 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 f2c4c52 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 e9fa8db 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 c56483d 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ReadOnlyConfigurationResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/RootClusterSettingRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java
 fb31c19 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationRequest.java
 ea67207 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/StackLevelConfigurationResponse.java
 d33b5cb 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 0c5a579 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootClusterSettingsResourceProvider.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
 f8feef2 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
 6f5b0f8 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
 819507b 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
 a364c4c 
  
ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceLevelClusterSettingManager.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/resources/ResourceLevelClusterSettingManagerFactory.java
 PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
bb7fcbe 
  ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java 
63c850e 
  ambari-server/src/main/resources/cluster-settings.xml PRE-CREATION 


Diff: https://reviews.apache.org/r/62802/diff/3/

Changes: https://reviews.apache.org/r/62802/diff/2-3/


Testing
-------

API testing:

**Get all cluster-settings**

**http://<host>:<port>/api/v1/cluster_settings/**

{
"href": "http://172.22.102.6:8080/api/v1/cluster_settings/";,
"items": [
{
"href": 
"http://172.22.102.6:8080/api/v1/cluster_settings/agent_mounts_ignore_list";,
"ClusterSettingsInfo": {
"property_name": "agent_mounts_ignore_list"
}
},
{
"href": 
"http://172.22.102.6:8080/api/v1/cluster_settings/alerts_repeat_tolerance";,
"ClusterSettingsInfo": {
"property_name": "alerts_repeat_tolerance"
}
},
...
...
}


**Get specific cluster-setting**

**http://<host>:<port>/api/v1/cluster_settings/agent_mounts_ignore_list

{
"href": 
"http://172.22.102.6:8080/api/v1/cluster_settings/agent_mounts_ignore_list";,
"ClusterSettingsInfo": {
"final": "false",
"property_depends_on": [],
"property_description": "Comma separated list of the mounts which would be 
ignored by Ambari during property values suggestion by Stack Advisor",
"property_name": "agent_mounts_ignore_list",
"property_type": [],
"property_value": "",
"property_value_attributes": {
"visible": true,
"keyStore": false,
"empty_value_valid": true
},
"type": "cluster-settings.xml"
}
}


**Get specific non-existing cluster-setting**

**http://<host>:<port>/api/v1/cluster_settings/non-existing-setting**

{
"status": 404,
"message": "The requested resource doesn't exist: non-existing-setting, in 
cluster-settings.xml"
}


Thanks,

Swapan Shridhar

Reply via email to