/*
 *  Copyright (c) 2019 AT&T Intellectual Property.
 *  Copyright (c) 2018-2019 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.
 *
 *  This source code is part of the near-RT RIC (RAN Intelligent Controller)
 *  platform project (RICP).
 *
 */

package main

import (
	"time"
)

// Structs are copied from https://github.com/nokia/ONAP-VESPA/tree/master/ves-agent/config
// and from https://github.com/nokia/ONAP-VESPA/blob/master/govel/config.go
// Using tag v0.3.0

// HeartbeatConfiguration parameters
type HeartbeatConfiguration struct {
	DefaultInterval time.Duration `yaml:"defaultInterval"`
}

// Label represents a VES field by it's name, with an expression
// for getting its value
type Label struct {
	Name string `yaml:"name"`
	Expr string `yaml:"expr"`
}

// MetricRule defines how to retrieve metrics and map them
// into a list of evel.EventMeasurement struct
type MetricRule struct {
	Target         string  `yaml:"target"`          // Target VES event field
	Expr           string  `yaml:"expr"`            // Prometheus query expression
	VMIDLabel      string  `yaml:"vmId"`            // Metric label holding the VNF ID
	Labels         []Label `yaml:"labels"`          // Set of VES fields to map to values of given label
	ObjectName     string  `yaml:"object_name"`     // JSON Object Name
	ObjectInstance string  `yaml:"object_instance"` // JSON Object instance
	ObjectKeys     []Label `yaml:"object_keys"`     // JSON Object keys
}

// MetricRules defines a list of rules, and defaults values for them
type MetricRules struct {
	DefaultValues *MetricRule  `yaml:"defaults"` // Default rules to apply (except for expr), labels are merged
	Metrics       []MetricRule `yaml:"metrics"`  // List of query and mapping of rules
}

// PrometheusConfig parameters
type PrometheusConfig struct {
	Address   string        `yaml:"address"`   // Base URL to prometheus API
	Timeout   time.Duration `yaml:"timeout"`   // API request timeout
	KeepAlive time.Duration `yaml:"keepalive"` // HTTP Keep-Alive
	Rules     MetricRules   `yaml:"rules"`     // Querying rules
}

// MeasurementConfiguration parameters
type MeasurementConfiguration struct {
	DomainAbbreviation   string           `yaml:"domainAbbreviation"`   // "Measurement" or "Mfvs"
	DefaultInterval      time.Duration    `yaml:"defaultInterval"`      // Default measurement interval
	MaxBufferingDuration time.Duration    `yaml:"maxBufferingDuration"` // Maximum timeframe size of buffering
	Prometheus           PrometheusConfig `yaml:"prometheus"`           // Prometheus configuration
}

// CollectorConfiguration parameters
type CollectorConfiguration struct {
	ServerRoot string `yaml:"serverRoot"`
	FQDN       string `yaml:"fqdn"`
	Port       int    `yaml:"port"`
	Secure     bool   `yaml:"secure"`
	Topic      string `yaml:"topic"`
	User       string `yaml:"user"`
	Password   string `yaml:"password"`
	PassPhrase string `yaml:"passphrase,omitempty"` // passPhrase used to encrypt collector password in file
}

//NfcNamingCode mapping bettween NfcNamingCode (oam or etl) and Vnfcs
type NfcNamingCode struct {
	Type  string   `yaml:"type"`
	Vnfcs []string `yaml:"vnfcs"`
}

// EventConfiguration parameters
type EventConfiguration struct {
	VNFName             string          `yaml:"vnfName"`             // Name of this VNF, eg: dpa2bhsxp5001v
	ReportingEntityName string          `yaml:"reportingEntityName"` // Value of reporting entity field. Usually local VM (VNFC) name
	ReportingEntityID   string          `yaml:"reportingEntityID"`   // Value of reporting entity UUID. Usually local VM (VNFC) UUID
	MaxSize             int             `yaml:"maxSize"`
	NfNamingCode        string          `yaml:"nfNamingCode,omitempty"` // "hspx"
	NfcNamingCodes      []NfcNamingCode `yaml:"nfcNamingCodes,omitempty"`
	RetryInterval       time.Duration   `yaml:"retryInterval,omitempty"`
	MaxMissed           int             `yaml:"maxMissed,omitempty"`
}

// VESAgentConfiguration parameters
type VESAgentConfiguration struct {
	PrimaryCollector CollectorConfiguration   `yaml:"primaryCollector"`
	Heartbeat        HeartbeatConfiguration   `yaml:"heartbeat,omitempty"`
	Measurement      MeasurementConfiguration `yaml:"measurement,omitempty"`
	Event            EventConfiguration       `yaml:"event,omitempty"`
	Debug            bool                     `yaml:"debug,omitempty"`
	CaCert           string                   `yaml:"caCert,omitempty"` // Root certificate content
	DataDir          string                   `yaml:"datadir"`          // Path to directory containing data
}
