/*
 * ============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)
// Aligned with VES 7.0.1 schema, and extending to Performance Domain.

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.0.2"

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