Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-08-02 Thread Swapan Shridhar

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

(Updated Aug. 2, 2017, 8:26 a.m.)


Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


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


Repository: ambari


Description (updated)
---

**ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
be used to logically group a set of services (coming out of Management Pack 
selected).
 
**Example of a Service groups can be a:** 
- “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
default.
- “Streaming” Service Group containing Kafka, Storm, Nifi.
- “Data Science” Service Group containing Hive, Spark, Zeppelin.
- “EDW” Service Group containing Hive, Spark.

As part of this review, following has been implemented:
- SG added as sub-resource of cluster.
- GET, POST and DELETE API for SG.



*API calls and response:*

*1.* 

POST:


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
*Body :*


[
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "CORE"
  }
},
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "EDW"
  }
}
]


*Response:* 201 CREATED


{
  "resources" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 803,
"service_group_name" : "EDW"
  }
}
  ]
}


*2.*
===
GET :
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/

*Body:*

[]


*Response:* 200 OK


{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
  "items" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "EDW"
  }
}
  ]
}


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK

{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
}


*3.*
===
DELETE:
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK


{
  "deleteResult" : [
{
  "deleted" : {
"key" : "cluster_name: c1, service_group_name: CORE"
  }
}
  ]
}


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 f689841 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 73963df 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 44d50731 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 d792717 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 12e4a08 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 28c0d10 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
 3912138 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 3228a7f 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java
 248abad 
  
ambari-server/src/main/java/org

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-08-02 Thread Swapan Shridhar


> On Aug. 1, 2017, 5:51 a.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
> > Lines 234 (patched)
> > 
> >
> > Shouldn't this be
> > for(ServiceGroupRequest request : requests) {
> >   deleteStatusMetaData.addDeletedKey(request.getClusterName() + "/" + 
> > request.getServiceGroupName());
> > }
> 
> Swapan Shridhar wrote:
> request already has these 2 values only. 
> This is the result with : 'requests.toString()'
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> Jayush Luniya wrote:
> what I meant was for bulk delete should it be adding a deleted key for 
> each?

Done.


- Swapan


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


On July 31, 2017, 9:06 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 9:06 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> amba

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-08-01 Thread Jayush Luniya


> On Aug. 1, 2017, 5:51 a.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
> > Lines 234 (patched)
> > 
> >
> > Shouldn't this be
> > for(ServiceGroupRequest request : requests) {
> >   deleteStatusMetaData.addDeletedKey(request.getClusterName() + "/" + 
> > request.getServiceGroupName());
> > }
> 
> Swapan Shridhar wrote:
> request already has these 2 values only. 
> This is the result with : 'requests.toString()'
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }

what I meant was for bulk delete should it be adding a deleted key for each?


- Jayush


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


On July 31, 2017, 9:06 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 9:06 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-08-01 Thread Swapan Shridhar


> On Aug. 1, 2017, 5:51 a.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
> > Lines 234 (patched)
> > 
> >
> > Shouldn't this be
> > for(ServiceGroupRequest request : requests) {
> >   deleteStatusMetaData.addDeletedKey(request.getClusterName() + "/" + 
> > request.getServiceGroupName());
> > }

request already has these 2 values only. 
This is the result with : 'requests.toString()'


{
  "deleteResult" : [
{
  "deleted" : {
"key" : "[clusterName=c1, serviceGroupName=CORE]"
  }
}
  ]
}


- Swapan


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


On July 31, 2017, 9:06 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 9:06 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
>

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Jayush Luniya

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


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
Lines 234 (patched)


Shouldn't this be
for(ServiceGroupRequest request : requests) {
  deleteStatusMetaData.addDeletedKey(request.getClusterName() + "/" + 
request.getServiceGroupName());
}


- Jayush Luniya


On July 31, 2017, 9:06 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 9:06 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/serve

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Madhuvanthi Radhakrishnan

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


Ship it!




Ship It!

- Madhuvanthi Radhakrishnan


On July 31, 2017, 9:06 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 9:06 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariMana

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Swapan Shridhar

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

(Updated July 31, 2017, 9:06 p.m.)


Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


Changes
---

Fixed code as per review suggestions.


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


Repository: ambari


Description
---

**ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
be used to logically group a set of services (coming out of Management Pack 
selected).
 
**Example of a Service groups can be a:** 
- “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
default.
- “Streaming” Service Group containing Kafka, Storm, Nifi.
- “Data Science” Service Group containing Hive, Spark, Zeppelin.
- “EDW” Service Group containing Hive, Spark.

As part of this review, following has been implemented:
- SG added as sub-resource of cluster.
- GET, POST and DELETE API for SG.



*API calls and response:*

*1.* 

POST:


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
*Body :*


[
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "CORE"
  }
},
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "EDW"
  }
}
]


*Response:* 201 CREATED


{
  "resources" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 803,
"service_group_name" : "EDW"
  }
}
  ]
}


*2.*
===
GET :
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/

*Body:*

[]


*Response:* 200 OK


{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
  "items" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "EDW"
  }
}
  ]
}


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK

{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
}


*3.*
===
DELETE:
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK


{
  "deleteResult" : [
{
  "deleted" : {
"key" : "[clusterName=c1, serviceGroupName=CORE]"
  }
}
  ]
}


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 f689841 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 73963df 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 44d50731 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 d792717 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 12e4a08 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 28c0d10 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
 3912138 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 3228a7f 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultProviderModule.java

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Swapan Shridhar


> On July 28, 2017, 10:47 p.m., Madhuvanthi Radhakrishnan wrote:
> > We also need to add ServiceGroupResourceProvider initialization in 
> > DefaultProviderModule
> 
> Swapan Shridhar wrote:
> I dont think that required, as I dont see CLuster, Service, HostComponent 
> added there. Suggest ?
> 
> Madhuvanthi Radhakrishnan wrote:
> True, it does not break anything if added or not added. Since 
> DefaultResourceProvider defaults to getting the ResourceProvider from 
> AbstractControllerResourceProvider, if we define it in DefaultProviderModule 
> it need not go that extra step. You can mark this as fixed. Thank you.

Done.


- Swapan


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


On July 31, 2017, 6:53 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 6:53 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/r

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Swapan Shridhar


> On July 28, 2017, 10:42 p.m., Madhuvanthi Radhakrishnan wrote:
> > ambari-server/src/main/resources/properties.json
> > Lines 15 (patched)
> > 
> >
> > Do we want to avoid using properties.json? You can directly define it 
> > in the ResourceProvider

Done.


- Swapan


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


On July 31, 2017, 6:53 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 6:53 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> amba

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Swapan Shridhar


> On July 28, 2017, 10:42 p.m., Madhuvanthi Radhakrishnan wrote:
> > ambari-server/src/main/resources/key_properties.json
> > Lines 9 (patched)
> > 
> >
> > Do we want to avoid using key_properties.json? You can directly define 
> > it in the ResourceProvider

Done.


- Swapan


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


On July 31, 2017, 6:53 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 6:53 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-31 Thread Madhuvanthi Radhakrishnan


> On July 28, 2017, 10:47 p.m., Madhuvanthi Radhakrishnan wrote:
> > We also need to add ServiceGroupResourceProvider initialization in 
> > DefaultProviderModule
> 
> Swapan Shridhar wrote:
> I dont think that required, as I dont see CLuster, Service, HostComponent 
> added there. Suggest ?

True, it does not break anything if added or not added. Since 
DefaultResourceProvider defaults to getting the ResourceProvider from 
AbstractControllerResourceProvider, if we define it in DefaultProviderModule it 
need not go that extra step. You can mark this as fixed. Thank you.


- Madhuvanthi


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


On July 31, 2017, 6:53 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 31, 2017, 6:53 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "deleteResult" : [
> {
>   "deleted" : {
> "key" : "[clusterName=c1, serviceGroupName=CORE]"
>   }
> }
>   ]
> }
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963d

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-30 Thread Swapan Shridhar

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

(Updated July 31, 2017, 6:53 a.m.)


Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


Changes
---

- Added response for Delete API call.
- Fixed UTs.


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


Repository: ambari


Description (updated)
---

**ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
be used to logically group a set of services (coming out of Management Pack 
selected).
 
**Example of a Service groups can be a:** 
- “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
default.
- “Streaming” Service Group containing Kafka, Storm, Nifi.
- “Data Science” Service Group containing Hive, Spark, Zeppelin.
- “EDW” Service Group containing Hive, Spark.

As part of this review, following has been implemented:
- SG added as sub-resource of cluster.
- GET, POST and DELETE API for SG.



*API calls and response:*

*1.* 

POST:


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
*Body :*


[
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "CORE"
  }
},
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "EDW"
  }
}
]


*Response:* 201 CREATED


{
  "resources" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 803,
"service_group_name" : "EDW"
  }
}
  ]
}


*2.*
===
GET :
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/

*Body:*

[]


*Response:* 200 OK


{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
  "items" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "EDW"
  }
}
  ]
}


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK

{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
}


*3.*
===
DELETE:
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK


{
  "deleteResult" : [
{
  "deleted" : {
"key" : "[clusterName=c1, serviceGroupName=CORE]"
  }
}
  ]
}


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 f689841 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 73963df 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 44d50731 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 d792717 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 12e4a08 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 28c0d10 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
 3912138 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 3228a7f 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Ser

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-30 Thread Swapan Shridhar


> On July 28, 2017, 10:47 p.m., Madhuvanthi Radhakrishnan wrote:
> > We also need to add ServiceGroupResourceProvider initialization in 
> > DefaultProviderModule

I dont think that required, as I dont see CLuster, Service, HostComponent added 
there. Suggest ?


- Swapan


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


On July 28, 2017, 10 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 10 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717 
> 

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-30 Thread Swapan Shridhar


> On July 28, 2017, 10:42 p.m., Madhuvanthi Radhakrishnan wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
> > Lines 230 (patched)
> > 
> >
> > You can also choose to send a response back informing which key was 
> > deleted or any other information using
> > DeleteStatusMetaData, the invoke method and return a 
> > DeleteStatusMetaData object instead of RequestStatusResponse and then you 
> > can do an 
> > deleteStatusMetaData.addDeletedKey());
> > 
> > getRequestStatus(null, null, deleteStatusMetaData);

Done.

Response after delete:

{
  "deleteResult" : [
{
  "deleted" : {
"key" : "[clusterName=c1, serviceGroupName=EDW]"
  }
}
  ]
}


- Swapan


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


On July 28, 2017, 10 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 10 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> amba

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Madhuvanthi Radhakrishnan

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



We also need to add ServiceGroupResourceProvider initialization in 
DefaultProviderModule

- Madhuvanthi Radhakrishnan


On July 28, 2017, 10 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 10 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
>  12e4a08 
>   
> ambari-server/src/main/java/or

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Madhuvanthi Radhakrishnan

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


Ship it!




- Madhuvanthi Radhakrishnan


On July 28, 2017, 10 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 10 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
>  12e4a08 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
>  28c0d10 
>   
> amba

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Madhuvanthi Radhakrishnan

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




ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
Lines 230 (patched)


You can also choose to send a response back informing which key was deleted 
or any other information using
DeleteStatusMetaData, the invoke method and return a DeleteStatusMetaData 
object instead of RequestStatusResponse and then you can do an 
deleteStatusMetaData.addDeletedKey());

getRequestStatus(null, null, deleteStatusMetaData);



ambari-server/src/main/resources/key_properties.json
Lines 9 (patched)


Do we want to avoid using key_properties.json? You can directly define it 
in the ResourceProvider



ambari-server/src/main/resources/properties.json
Lines 15 (patched)


Do we want to avoid using properties.json? You can directly define it in 
the ResourceProvider


- Madhuvanthi Radhakrishnan


On July 28, 2017, 10 p.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 10 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/Ser

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Swapan Shridhar

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

(Updated July 28, 2017, 10 p.m.)


Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


Changes
---

Updated code based on review comments by Jayush.


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


Repository: ambari


Description
---

**ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
be used to logically group a set of services (coming out of Management Pack 
selected).
 
**Example of a Service groups can be a:** 
- “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
default.
- “Streaming” Service Group containing Kafka, Storm, Nifi.
- “Data Science” Service Group containing Hive, Spark, Zeppelin.
- “EDW” Service Group containing Hive, Spark.

As part of this review, following has been implemented:
- SG added as sub-resource of cluster.
- GET, POST and DELETE API for SG.



*API calls and response:*

*1.* 

POST:


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
*Body :*


[
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "CORE"
  }
},
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "EDW"
  }
}
]


*Response:* 201 CREATED


{
  "resources" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 803,
"service_group_name" : "EDW"
  }
}
  ]
}


*2.*
===
GET :
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/

*Body:*

[]


*Response:* 200 OK


{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
  "items" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "EDW"
  }
}
  ]
}


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK

{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
}


*3.*
===
DELETE:
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK


[]


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 f689841 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 73963df 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 44d50731 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 d792717 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 12e4a08 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 28c0d10 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
 3912138 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 3228a7f 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
 199450

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Swapan Shridhar


> On July 28, 2017, 6:51 p.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceGroupEntityPK.java
> > Lines 43 (patched)
> > 
> >
> > service group id instead

Fixed.


> On July 28, 2017, 6:51 p.m., Jayush Luniya wrote:
> > ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
> > Lines 159 (patched)
> > 
> >
> > primary key should be service group id.

Fixed.


- Swapan


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


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Swapan Shridhar


> On July 28, 2017, 6:49 p.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceGroupEntity.java
> > Lines 57 (patched)
> > 
> >
> > Primary key in DB should be service group id and not service group name

Fixed.


- Swapan


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


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Swapan Shridhar


> On July 28, 2017, 6:46 p.m., Jayush Luniya wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
> > Lines 201 (patched)
> > 
> >
> > Bulk update for multiple service groups shouldnt take 
> > "serviceGroupName" path param.

Removed the parameter.


- Swapan


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


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATIO

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Jayush Luniya

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




ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceGroupEntityPK.java
Lines 43 (patched)


service group id instead



ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
Lines 159 (patched)


primary key should be service group id.


- Jayush Luniya


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Jayush Luniya

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




ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ServiceGroupEntity.java
Lines 57 (patched)


Primary key in DB should be service group id and not service group name


- Jayush Luniya


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717 
>   
> ambari-

Re: Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-28 Thread Jayush Luniya

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




ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
Lines 201 (patched)


Bulk update for multiple service groups shouldnt take "serviceGroupName" 
path param.


- Jayush Luniya


On July 28, 2017, 3:48 a.m., Swapan Shridhar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61201/
> ---
> 
> (Updated July 28, 2017, 3:48 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.
> 
> 
> Bugs: AMBARI-21594
> https://issues.apache.org/jira/browse/AMBARI-21594
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> **ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
> be used to logically group a set of services (coming out of Management Pack 
> selected).
>  
> **Example of a Service groups can be a:** 
> - “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
> default.
> - “Streaming” Service Group containing Kafka, Storm, Nifi.
> - “Data Science” Service Group containing Hive, Spark, Zeppelin.
> - “EDW” Service Group containing Hive, Spark.
> 
> As part of this review, following has been implemented:
> - SG added as sub-resource of cluster.
> - GET, POST and DELETE API for SG.
> 
> 
> 
> *API calls and response:*
> 
> *1.* 
> 
> POST:
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
> *Body :*
> 
> 
> [
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "CORE"
>   }
> },
> {
>   "ServiceGroupInfo" : {
> "cluster_id": "2",
> "service_group_name": "EDW"
>   }
> }
> ]
> 
> 
> *Response:* 201 CREATED
> 
> 
> {
>   "resources" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 803,
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> *2.*
> ===
> GET :
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
>   "items" : [
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "CORE"
>   }
> },
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
>   "ServiceGroupInfo" : {
> "cluster_name" : "c1",
> "service_group_name" : "EDW"
>   }
> }
>   ]
> }
> 
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> {
>   "href" : 
> "http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
>   "ServiceGroupInfo" : {
> "cluster_id" : 2,
> "cluster_name" : "c1",
> "service_group_id" : 804,
> "service_group_name" : "CORE"
>   }
> }
> 
> 
> *3.*
> ===
> DELETE:
> ===
> 
> API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE
> 
> *Body:*
> 
> []
> 
> 
> *Response:* 200 OK
> 
> 
> []
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  f689841 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  73963df 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  44d50731 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
>  d792717

Review Request 61201: AMBARI-21594. MultiEverything : Add Servicegroup as a subresource of Cluster.

2017-07-27 Thread Swapan Shridhar

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

Review request for Ambari, Jayush Luniya and Madhuvanthi Radhakrishnan.


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


Repository: ambari


Description
---

**ServiceGroup (SG)** : is defined as sub-resource of cluster. It would later 
be used to logically group a set of services (coming out of Management Pack 
selected).
 
**Example of a Service groups can be a:** 
- “Core” Service Group  containing HDFS and Zookeeper. This will be formed by 
default.
- “Streaming” Service Group containing Kafka, Storm, Nifi.
- “Data Science” Service Group containing Hive, Spark, Zeppelin.
- “EDW” Service Group containing Hive, Spark.

As part of this review, following has been implemented:
- SG added as sub-resource of cluster.
- GET, POST and DELETE API for SG.



*API calls and response:*

*1.* 

POST:


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups
*Body :*


[
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "CORE"
  }
},
{
  "ServiceGroupInfo" : {
"cluster_id": "2",
"service_group_name": "EDW"
  }
}
]


*Response:* 201 CREATED


{
  "resources" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 803,
"service_group_name" : "EDW"
  }
}
  ]
}


*2.*
===
GET :
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/

*Body:*

[]


*Response:* 200 OK


{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/";,
  "items" : [
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "CORE"
  }
},
{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/EDW";,
  "ServiceGroupInfo" : {
"cluster_name" : "c1",
"service_group_name" : "EDW"
  }
}
  ]
}


API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK

{
  "href" : 
"http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE";,
  "ServiceGroupInfo" : {
"cluster_id" : 2,
"cluster_name" : "c1",
"service_group_id" : 804,
"service_group_name" : "CORE"
  }
}


*3.*
===
DELETE:
===

API: http://c6404.ambari.apache.org:8080/api/v1/clusters/c1/servicegroups/CORE

*Body:*

[]


*Response:* 200 OK


[]


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/ServiceGroupNotFoundException.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
 f689841 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 73963df 
  
ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceGroupResourceDefinition.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
 44d50731 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceGroupService.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 d792717 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 12e4a08 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 28c0d10 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
 3912138 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupRequest.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceGroupResponse.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
 3228a7f 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceGroupResourceProvider.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
 1994501 
  ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java 
9a5ee79 
  
ambari-server/src/