def clusters_get(cluster_id): c = None try: c = api.get_cluster(id=cluster_id) except Exception, e: abort_and_log(500, 'Exception while getting Cluster with id ' '\'%s\'' % cluster_id, e)
def check_cluster_scaling(data, cluster_id, **kwargs): cluster = api.get_cluster(id=cluster_id) if not (plugin_base.PLUGINS.is_plugin_implements(cluster.plugin_name, 'scale_cluster') and (plugin_base.PLUGINS.is_plugin_implements(cluster.plugin_name, 'decommission_nodes'))): raise ex.InvalidException( "Requested plugin '%s' doesn't support cluster scaling feature" % cluster.plugin_name) if cluster.status != 'Active': raise ex.InvalidException("Cluster cannot be scaled not in 'Active' " "status. Cluster status: " + cluster.status) if data.get("resize_node_groups"): b.check_resize(cluster, data['resize_node_groups']) if data.get("add_node_groups"): b.check_add_node_groups(cluster, data['add_node_groups'])
def check_cluster_scaling(data, cluster_id, **kwargs): cluster = api.get_cluster(id=cluster_id) if not (plugin_base.PLUGINS.is_plugin_implements(cluster.plugin_name, 'scale_cluster') and ( plugin_base.PLUGINS.is_plugin_implements(cluster.plugin_name, 'decommission_nodes'))): raise ex.InvalidException( "Requested plugin '%s' doesn't support cluster scaling feature" % cluster.plugin_name) if cluster.status != 'Active': raise ex.InvalidException("Cluster cannot be scaled not in 'Active' " "status. Cluster status: " + cluster.status) if data.get("resize_node_groups"): b.check_resize(cluster, data['resize_node_groups']) if data.get("add_node_groups"): b.check_add_node_groups(cluster, data['add_node_groups'])
def clusters_get(cluster_id): return u.render(api.get_cluster(cluster_id).to_wrapped_dict())
def clusters_get(cluster_id): return u.render(api.get_cluster(id=cluster_id).wrapped_dict)
def check_cluster_exists(id): if not api.get_cluster(id): raise ex.InvalidException("Cluster with id '%s'" " doesn't exist" % id)
def clusters_get(cluster_id): tenant_id = request.headers['X-Tenant-Id'] c = api.get_cluster(id=cluster_id, tenant_id=tenant_id) return api_u.render(c.wrapped_dict)