'Return data about the given instance action.'

@extensions.expected_errors(404)
def show(self, req, server_id, id):

    context = req.environ['nova.context']
    instance = self._get_instance(req, context, server_id)
    context.can(ia_policies.BASE_POLICY_NAME, instance)
    action = self.action_api.action_get_by_request_id(context, instance, id)
    if (action is None):
        msg = (_('Action    %s    not    found') % id)
        raise exc.HTTPNotFound(explanation=msg)
    action_id = action['id']
    action = self._format_action(action)
    show_events = False
    show_traceback = False
    if context.can((ia_policies.POLICY_ROOT % 'events'), fatal=False):
        show_events = show_traceback = True
    elif api_version_request.is_supported(req, '2.51'):
        show_events = True
    if show_events:
        events_raw = self.action_api.action_events_get(context, instance, action_id)
        action['events'] = [self._format_event(evt, show_traceback) for evt in events_raw]
    return {'instanceAction': action}
