/*
 * ============LICENSE_START=======================================================
 * dcaegen2-collectors-veshv
 * ================================================================================
 * Copyright (C) 2018 NOKIA
 * ================================================================================
 * 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.
 * ============LICENSE_END=========================================================
 */
syntax = "proto3";
package org.onap.ves;

message VesEvent                            // top-level message, currently the maximum event size supported by the HV-VES Collector is 1 MiB
{
    CommonEventHeader commonEventHeader=1;  // required

    bytes eventFields=2;                    // required, payload
        // this field contains a domain-specific GPB message
        // the field being opaque (bytes), the decoding of the payload occurs in a separate step
        // the name of the GPB message for domain XYZ is XyzFields
        // e.g. for domain==perf3gpp, the GPB message is Perf3gppFields
}

// VES CommonEventHeader adapted to GPB (Google Protocol Buffers)

message CommonEventHeader
{
    string version = 1;                     // required, "version of the gpb common event header", current value "1.0"
    string domain = 2;                      // required, "the eventing domain associated with the event", allowed values:
                                            // fault, heartbeat, measurement, mobileFlow, other, pnfRegistration, sipSignaling,
                                            // stateChange, syslog, thresholdCrossingAlert, voiceQuality, perf3gpp

    uint32 sequence = 3;                    // required, "ordering of events communicated by an event source instance or 0 if not needed"

    enum Priority
    {
        PRIORITY_NOT_PROVIDED = 0;
        HIGH = 1;
        MEDIUM = 2;
        NORMAL = 3;
        LOW = 4;
    }
    Priority priority = 4;                  // required, "processing priority"

    string eventId = 5;                     // required, "event key that is unique to the event source"
    string eventName = 6;                   // required, "unique event name"
    string eventType = 7;                   // "for example - guest05,  platform"

    uint64 lastEpochMicrosec = 8;           // required, "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds"
    uint64 startEpochMicrosec = 9;          // required, "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds"

    string nfNamingCode = 10;               // "4 character network function type, aligned with vnf naming standards"
    string nfcNamingCode = 11;              // "3 character network function component type, aligned with vfc naming standards"
    string nfVendorName = 12;               // " Vendor Name providing the nf "

    bytes reportingEntityId = 13;           // "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process"
    string reportingEntityName = 14;        // required, "name of the entity reporting the event, for example, an EMS name; may be the same as sourceName should match A&AI entry"
    bytes sourceId = 15;                    // "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process"
    string sourceName = 16;                 // required, "name of the entity experiencing the event issued use A&AI entry"
    string timeZoneOffset = 17;             // "Offset to GMT to indicate local time zone for the device"
    string vesEventListenerVersion = 18;    // required, "Version of the VesEvent Listener", current value "7.2"

    reserved "InternalHeaderFields";        // "enrichment fields for internal VES Event Listener service use only, not supplied by event sources"
    reserved 100;
}
