def check_node_groups_in_cluster_templates(plugin_name, hadoop_version, cluster_template_id): c_t = api.get_cluster_template(id=cluster_template_id) n_groups = c_t.to_wrapped_dict()['cluster_template']['node_groups'] check_network_config(n_groups) for node_group in n_groups: check_node_group_basic_fields(plugin_name, hadoop_version, node_group)
def _get_cluster_field(cluster, field): if cluster.get(field): return cluster[field] if cluster.get("cluster_template_id"): cluster_template = api.get_cluster_template(id=cluster["cluster_template_id"]) if cluster_template.get(field): return cluster_template[field] return None
def _get_cluster_field(cluster, field): if cluster.get(field): return cluster[field] if cluster.get('cluster_template_id'): cluster_template = api.get_cluster_template( id=cluster['cluster_template_id']) if cluster_template.get(field): return cluster_template[field] return None
def cluster_templates_get(cluster_template_id): return u.render( api.get_cluster_template(cluster_template_id).to_wrapped_dict())
def cluster_templates_get(cluster_template_id): return u.render( api.get_cluster_template(id=cluster_template_id).wrapped_dict)
def check_cluster_template_exists(cluster_template_id): if not api.get_cluster_template(id=cluster_template_id): raise ex.InvalidException("Cluster template with id '%s'" " doesn't exist" % cluster_template_id)
def check_node_groups_in_cluster_templates(plugin_name, hadoop_version, cluster_template_id): c_t = api.get_cluster_template(id=cluster_template_id) n_groups = c_t.to_wrapped_dict()["cluster_template"]["node_groups"] for node_group in n_groups: check_node_group_basic_fields(plugin_name, hadoop_version, node_group)