'Restore a previously deleted instance.'

@wsgi.response(202)
@extensions.expected_errors((403, 404, 409))
@wsgi.action('restore')
def _restore(self, req, id, body):

    context = req.environ['nova.context']
    context.can(dd_policies.BASE_POLICY_NAME)
    instance = common.get_instance(self.compute_api, context, id)
    try:
        self.compute_api.restore(context, instance)
    except exception.InstanceUnknownCell as error:
        raise webob.exc.HTTPNotFound(explanation=error.format_message())
    except exception.QuotaError as error:
        raise webob.exc.HTTPForbidden(explanation=error.format_message())
    except exception.InstanceInvalidState as state_error:
        common.raise_http_conflict_for_instance_invalid_state(state_error, 'restore', id)
