[
https://issues.apache.org/jira/browse/AMBARI-6275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14206978#comment-14206978
]
John Speidel commented on AMBARI-6275:
--------------------------------------
Below is the proposed api for add hosts.
There are multiple variations of the api:
- add hosts based on a blueprint and hostgroup
- add hosts based on an existing host to "clone"
- add hosts using a hostgroup which is defined inline
All variants will support adding a single host or multiple hosts.
In addition to feedback on the actual API syntax, I would like to get feedback
on prioritization of the specified api variants. It is possible that we may
not be able to implement all of the variants immediately so it will be very
helpful if the community could provide feedback on prioritization.
h4. Specify a blueprint and hostgroup:
h6. Single Host:
{code}
POST clusters/c1/hosts/newHost
{
"blueprint_name" : "test.com",
"host_group" : "hostgroup_1"
}
{code}
h6. Multiple Hosts:
{code}
POST clusters/c1/hosts
[
{
"hostname" : "test.com",
"blueprint_name" : "blueprint1",
"host_group" : "hostgroup_1"
},
{
"hostname" : "test2.com",
"blueprint_name" : "blueprint2",
"host_group" : "hostgroup_2"
}
]
{code}
h4. Specify an existing host to clone:
h6. Single Host:
{code}
POST clusters/c1/hosts/newHost
{
"host_to_clone" : "existing-host1.com"
}
{code}
h6. Multiple Hosts:
{code}
POST clusters/c1/hosts
[
{
"hostname" : "test.com",
"host_to_clone" : "existing-host1.com"
},
{
"hostname" : "test2.com",
"host_to_clone" : "existing-host2.com"
}
]
{code}
h4. Specify an inlined hostgroup
h6. Single Host:
{code}
POST clusters/c1/hosts/newHost
{
"host_group" : {
{
"name" : "host_group_1", // in this case name may not be necessary
"components" : [
{
"name" : "HDFS_CLIENT",
"name" : "YARN_CLIENT",
...
}
},
"configurations" : {
...
}
}
{code}
Multiple hosts would follow the same pattern.
h4. Alternate multi host format which allows multiple hosts to use the same
information
{code}
POST clusters/c1/hosts
[
{
"blueprint_name" : "blueprint1",
"host_group" : "hostgroup_1"
"hosts": [
{ "hostname" : "test1.com" },
{ "hostname" : "test2.com" }
]
},
...
]
{code}
This approach differs from the current multi host add api but may be simpler to
use if there are a lot of hosts using the same information.
> Add support for "add hosts" with Blueprints API
> -----------------------------------------------
>
> Key: AMBARI-6275
> URL: https://issues.apache.org/jira/browse/AMBARI-6275
> Project: Ambari
> Issue Type: Improvement
> Components: ambari-server
> Affects Versions: 1.7.0
> Reporter: Yusaku Sako
> Assignee: John Speidel
> Fix For: 2.0.0
>
>
> Support for "adding hosts" based on *blueprint* style *host_group* via Ambari
> REST API. There are two scenarios to consider for this JIRA:
> 1) Add hosts based on an existing host in the cluster (and it's *blueprint*
> style *host_group* component layout). This enables the user to add hosts with
> components similar to existing hosts in the cluster. For example: expand this
> cluster with these X hosts and make each of these hosts like Y host
> (components + configs) existing in the cluster.
> 2) Add hosts based on components + configs. This would be a verbose method
> that uses *blueprint* style *host_groups* and *configs* to allow you to add
> hosts to a cluster that do not necessarily have a component layout or config
> of a similar host existing in the cluster. For example: expand this cluster
> with these X hosts and make each of these hosts include Y components with Z
> configs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)