@extensions.expected_errors((404, 409))
@wsgi.action('pause')
def _pause(self, req, id, body):
    'Permit Admins to pause the server.'
    ctxt = req.environ['nova.context']
    authorize(ctxt, 'pause')
    server = common.get_instance(self.compute_api, ctxt, id, want_objects=True)
    try:
        self.compute_api.pause(ctxt, server)
    except exception.InstanceIsLocked as e:
        raise exc.HTTPConflict(explanation=e.format_message())
    except exception.InstanceInvalidState as state_error:
        common.raise_http_conflict_for_instance_invalid_state(state_error, 'pause')
    except exception.InstanceNotFound as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    return webob.Response(status_int=202)
Permit Admins to pause the server.
@extensions.expected_errors((404, 409))
@wsgi.action('pause')
def _pause(self, req, id, body):
    
    ctxt = req.environ['nova.context']
    authorize(ctxt, 'pause')
    server = common.get_instance(self.compute_api, ctxt, id, want_objects=True)
    try:
        self.compute_api.pause(ctxt, server)
    except exception.InstanceIsLocked as e:
        raise exc.HTTPConflict(explanation=e.format_message())
    except exception.InstanceInvalidState as state_error:
        common.raise_http_conflict_for_instance_invalid_state(state_error, 'pause')
    except exception.InstanceNotFound as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    return webob.Response(status_int=202)