/*
** Copyright 2022 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : contact@centreon.com
*/

syntax = "proto3";

package com.centreon.broker;

/**
 * @brief A severity is a way to give some importance to a resource. It has a
 * level that is an integer from 1. 1 is more important than 2, than 3...
 * It also has an id, a level, an icon_id and a name.
 *
 * Because a severity can be sent from several poller, and by moment a poller
 * can say it does not need it anymore, broker needs to know from which poller
 * the severity event comes from, so we have a poller_id in the message.
 *
 * For example, two pollers use a severity named 'foo'. Then the first one sends
 * a Severity message with the action DELETE. This means this poller does not
 * need it anymore but we don't know about the other poller. Then we can remove
 * relations between resources of our poller and this severity. And only if the
 * severity is no more used at all, we can remove it.
 */
message Severity {
  uint64 id = 1;
  enum Action {
    ADD = 0;
    DELETE = 1;
    MODIFY = 2;
  }
  Action action = 2;
  uint32 level = 3;
  uint64 icon_id = 4;
  string name = 5;
  enum Type {
    SERVICE = 0;
    HOST = 1;
  }
  Type type = 6;
  uint64 poller_id = 7;
}
