'Manage server operations'

@api.validate(server_manage_schema)
@api.response(501, model=yaml_error_schema, description=u'YAML    syntax    error')
@api.response(502, model=config_validation_schema, description=u'Config    validation    error')
@api.response(200, model=base_message_schema)
def post(self, session=None):

    data = request.json
    if (data[u'operation'] == u'reload'):
        try:
            self.manager.load_config(output_to_console=False)
        except YAMLError as e:
            if (hasattr(e, u'problem') and hasattr(e, u'context_mark') and hasattr(e, u'problem_mark')):
                error = {}
                if (e.problem is not None):
                    error.update({u'reason': e.problem})
                if (e.context_mark is not None):
                    error.update({u'line': e.context_mark.line, u'column': e.context_mark.column})
                if (e.problem_mark is not None):
                    error.update({u'line': e.problem_mark.line, u'column': e.problem_mark.column})
                raise APIError(message=u'Invalid    YAML    syntax', payload=error)
        except ValueError as e:
            errors = []
            for er in e.errors:
                errors.append({u'error': er.message, u'config_path': er.json_pointer})
            raise APIError((u'Error    loading    config:    %s' % e.args[0]), payload={u'errors': errors})
        response = u'Config    successfully    reloaded    from    disk'
    else:
        self.manager.shutdown(data.get(u'force'))
        response = u'Shutdown    requested'
    return success_response(response)
