cm_api
cm_api copied to clipboard
Builder for `ApiService`
When creating a new service your code have to go like
ApiService svc = new ApiService();
svc.setClusterRef(new ClusterRef(cluster.getName()));
svc.setName("hdfs");
svc.setType("HDFS");
List<ApiRoles> roles = new ArrayList<>();
svc.setRoles(roles);
ApiRole role = new ApiRole();
role.setName("mynamenode");
role.setType("NAMENODE");
roles.add(role);
etc.
It'll be nicer to have a nicer API like
ApiServiceBuilder.newHdfs("myhdfs1", cluster).
withRole(ApiRoleBuilder.newNameNode("mynamenode", host2)).
withRole(ApiRoleBuilder.newDataNode("myDataNode", host1)).
build();
Will you accept pull requests? I'm having something I can make a pull request from.