Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0.0
-
None
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 JIRA, 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" } } ] }
Attachments
Attachments
Issue Links
- is depended upon by
-
AMBARI-21824 Make services as sub-resource of ServiceGroups and use Servicegroup while doing Creation, Update and retrieval of HostComponents and ServiceComponents.
- Resolved
- links to