@extensions.expected_errors(404)
    def show(self, req, id):
        context = req.environ['nova.context']
        authorize(context)
        host_name = id
        try:
            compute_node = (
                objects.ComputeNode.get_first_node_by_host_for_old_compat(
                    context, host_name))
        except exception.ComputeHostNotFound as e:
            raise webob.exc.HTTPNotFound(explanation=e.format_message())
        instances = self.api.instance_get_all_by_host(context, host_name)
        resources = [self._get_total_resources(host_name, compute_node)]
        resources.append(self._get_used_now_resources(host_name,
                                                      compute_node))
        resources.append(self._get_resource_totals_from_instances(host_name,
                                                                  instances))
        by_proj_resources = self._get_resources_by_project(host_name,
                                                           instances)
        for resource in six.itervalues(by_proj_resources):
            resources.append({'resource': resource})
        return {'host': resources}
Parameters for the group
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/hosts.py/HostController.show--crossover with--dataset/ETHPy150Open gdanezis/petlib/examples/pouf.py/POUF_setup