server

package
v0.0.0-...-8f6edbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

README

Go API Server for server

Metrics Service provides metrics about the active scenario

Micro-service
meep-metrics-engine

Type & Usage
Platform Service used by control/monitoring software and possibly by edge applications that require metrics

Details
API details available at your-AdvantEDGE-ip-address/api

Overview

This server was generated by the [swagger-codegen] (https://github.com/swagger-api/swagger-codegen) project.
By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
  • Build date: 2022-12-19T08:31:49.638-05:00
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

Constants

View Source
const ModuleName = "meep-metrics-engine"
View Source
const ServiceName = "Metrics Engine"

Variables

View Source
var METRICS_DB = 0
View Source
var SandboxName string

Functions

func CreateEventSubscription

func CreateEventSubscription(w http.ResponseWriter, r *http.Request)

func CreateNetworkSubscription

func CreateNetworkSubscription(w http.ResponseWriter, r *http.Request)

func DeleteEventSubscriptionById

func DeleteEventSubscriptionById(w http.ResponseWriter, r *http.Request)

func DeleteNetworkSubscriptionById

func DeleteNetworkSubscriptionById(w http.ResponseWriter, r *http.Request)

func GetEventSubscription

func GetEventSubscription(w http.ResponseWriter, r *http.Request)

func GetEventSubscriptionById

func GetEventSubscriptionById(w http.ResponseWriter, r *http.Request)

func GetNetworkSubscription

func GetNetworkSubscription(w http.ResponseWriter, r *http.Request)

func GetNetworkSubscriptionById

func GetNetworkSubscriptionById(w http.ResponseWriter, r *http.Request)

func Init

func Init() (err error)

Init - Metrics engine initialization

func Logger

func Logger(inner http.Handler, name string) http.Handler

func PostDataflowQuery

func PostDataflowQuery(w http.ResponseWriter, r *http.Request)

func PostEventQuery

func PostEventQuery(w http.ResponseWriter, r *http.Request)

func PostHttpQuery

func PostHttpQuery(w http.ResponseWriter, r *http.Request)

func PostNetworkQuery

func PostNetworkQuery(w http.ResponseWriter, r *http.Request)

func PostSeqQuery

func PostSeqQuery(w http.ResponseWriter, r *http.Request)

func Run

func Run() (err error)

Run - Start Metrics Engine execution

func Stop

func Stop()

Stop - Shut down the service

Types

type DataflowMetric

type DataflowMetric struct {

	// Time of interaction
	Time string `json:"time,omitempty"`

	// Mermaid formatted dataflow logs
	Mermaid string `json:"mermaid,omitempty"`
}

dataflow diagram logs

type DataflowMetricList

type DataflowMetricList struct {

	// Response name
	Name string `json:"name,omitempty"`

	// columns included in response based on queried values
	Columns []string `json:"columns,omitempty"`

	Values []DataflowMetric `json:"values,omitempty"`
}

type DataflowMetrics

type DataflowMetrics struct {
	DataflowMetricList *DataflowMetricList `json:"dataflowMetricList,omitempty"`

	// String of dataflow metrics with unique interactions
	DataflowMetricString string `json:"dataflowMetricString,omitempty"`
}

type DataflowQueryParams

type DataflowQueryParams struct {

	// Tag names to match in query. Supported values:<br>
	Tags []Tag `json:"tags,omitempty"`

	Scope *Scope `json:"scope,omitempty"`

	// Requested information. Supported values:<br><li>mermaid: Mermaid format<br>
	Fields []string `json:"fields,omitempty"`

	// Queried response Type. Supported Values:<br> NOTE1: only one of listonly or responly may be included  NOTE2: if listonly or responly are not included, the response contains both the list and string  <li>listonly: Include only a list of dataflow metrics in response<br> <li>stronly: Include only a concatenated string of dataflow metrics in response<br>
	ResponseType string `json:"responseType,omitempty"`
}

Seq metrics query parameters

type EventMetric

type EventMetric struct {

	// Time of event metrics
	Time string `json:"time,omitempty"`

	// JSON-fomatted event
	Event string `json:"event,omitempty"`
}

Value of a single event metric

type EventMetricList

type EventMetricList struct {

	// Response name
	Name string `json:"name,omitempty"`

	// columns included in response based on queried values
	Columns []string `json:"columns,omitempty"`

	Values []EventMetric `json:"values,omitempty"`
}

Event metrics query response

type EventQueryParams

type EventQueryParams struct {

	// Tag names to match in query. Supported values:<br> <li>type: Destination network element name
	Tags []Tag `json:"tags,omitempty"`

	// Field names to return in query response. Supported values:<br> <li>event: Downlink packet loss from dest to src (%)
	Fields []string `json:"fields,omitempty"`

	Scope *Scope `json:"scope,omitempty"`
}

Event metrics query parameters

type EventRegistration

type EventRegistration struct {
	// contains filtered or unexported fields
}

type EventSubscription

type EventSubscription struct {

	// Subscription identifier
	SubscriptionId string `json:"subscriptionId,omitempty"`

	// Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription.
	ClientCorrelator string `json:"clientCorrelator,omitempty"`

	CallbackReference *EventsCallbackReference `json:"callbackReference,omitempty"`

	// Self referring URL.
	ResourceURL string `json:"resourceURL,omitempty"`

	EventQueryParams *EventQueryParams `json:"eventQueryParams,omitempty"`

	// Notification interval in seconds, disabled if set to 0
	Period int32 `json:"period,omitempty"`

	// Type of subscription triggering notifications
	SubscriptionType string `json:"subscriptionType,omitempty"`
}

Events metrics subscription response

type EventSubscriptionList

type EventSubscriptionList struct {
	EventSubscription []EventSubscription `json:"eventSubscription,omitempty"`

	// Self referring URL.
	ResourceURL string `json:"resourceURL,omitempty"`
}

type EventSubscriptionParams

type EventSubscriptionParams struct {

	// Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription.
	ClientCorrelator string `json:"clientCorrelator,omitempty"`

	CallbackReference *EventsCallbackReference `json:"callbackReference,omitempty"`

	EventQueryParams *EventQueryParams `json:"eventQueryParams,omitempty"`

	// Notification interval in seconds, disabled if set to 0
	Period int32 `json:"period,omitempty"`

	// Type of subscription triggering notifications
	SubscriptionType string `json:"subscriptionType,omitempty"`
}

Events subscription parameters

type EventsCallbackReference

type EventsCallbackReference struct {

	// The URL of your own listener application.
	NotifyURL string `json:"notifyURL"`
}

Notification callback definition.

type HttpMetric

type HttpMetric struct {

	// Time of http metrics
	Time string `json:"time,omitempty"`

	// Http metrics identifier
	Id int32 `json:"id,omitempty"`

	// Http metrics queried endpoint
	Endpoint string `json:"endpoint,omitempty"`

	// Http metrics queried endpoint with query parameters
	Url string `json:"url,omitempty"`

	// Http metrics method
	Method string `json:"method,omitempty"`

	// Http metrics response status code
	RespCode string `json:"resp_code,omitempty"`

	// Http metrics response body
	RespBody string `json:"resp_body,omitempty"`

	// Http metrics body
	Body string `json:"body,omitempty"`

	// Request processing time in ms
	ProcTime string `json:"proc_time,omitempty"`

	// Service processing the http metric
	LoggerName string `json:"logger_name,omitempty"`

	// Http metric type (request, response, notification)
	MsgType string `json:"msg_type,omitempty"`

	// DEPRECATED -- Http type
	Direction string `json:"direction,omitempty"`
}

Value of a single http metric

type HttpMetricList

type HttpMetricList struct {

	// Response name
	Name string `json:"name,omitempty"`

	// columns included in response based on queried values
	Columns []string `json:"columns,omitempty"`

	Values []HttpMetric `json:"values,omitempty"`
}

Http metrics query response

type HttpQueryParams

type HttpQueryParams struct {

	// Tag names to match in query. Supported values:<br> <li>logger_name: Logger instances that issued the http notification or processed the request <li>msg_type: Http metric type (request, response, notification)
	Tags []Tag `json:"tags,omitempty"`

	// Field names to return in query response. Supported values:<br> <li>id: Http metrics identifier<br> <li>endpoint: Http metrics queried endpoint<br> <li>url: Http metrics queried endpoint with query parameters<br> <li>method: Http metrics method<br> <li>resp_code: Http metrics response status code<br> <li>resp_body: Http metrics response body<br> <li>body: Http metrics body<br> <li>proc_time: Request processing time in ms<br> <li>logger_name: Logger instances that issued the http notification or processed the request<br> <li>msg_type: Http metric type (request, response, notification)<br> <li>direction: DEPRECATED -- Http metric direction (RX, TX)
	Fields []string `json:"fields,omitempty"`

	Scope *Scope `json:"scope,omitempty"`
}

Http metrics query parameters

type NetworkCallbackReference

type NetworkCallbackReference struct {

	// The URL of your own listener application.
	NotifyURL string `json:"notifyURL"`
}

Notification callback definition.

type NetworkMetric

type NetworkMetric struct {

	// Time of network metrics
	Time string `json:"time,omitempty"`

	// Round-trip latency (ms)
	Lat int32 `json:"lat,omitempty"`

	// Uplink throughput from src to dest (Mbps)
	Ul float64 `json:"ul,omitempty"`

	// Downlink throughput from dest to src (Mbps)
	Dl float64 `json:"dl,omitempty"`

	// Uplink packet loss from src to dest (%)
	Ulos float64 `json:"ulos,omitempty"`

	// Uplink packet loss from dest to src (%)
	Dlos float64 `json:"dlos,omitempty"`
}

Value of a single network metric

type NetworkMetricList

type NetworkMetricList struct {

	// Response name
	Name string `json:"name,omitempty"`

	// columns included in response based on queried values
	Columns []string `json:"columns,omitempty"`

	Values []NetworkMetric `json:"values,omitempty"`
}

Network metrics query response

type NetworkQueryParams

type NetworkQueryParams struct {

	// Tag names to match in query. Supported values:<br> <li>src: Source network element name <li>dest: Destination network element name
	Tags []Tag `json:"tags,omitempty"`

	// Field names to return in query response. Supported values:<br> <li>lat: Round-trip latency (ms)<br> <li>ul: Uplink throughput from src to dest (Mbps) <li>dl: Downlink throughput from dest to src (Mbps) <li>ulos: Uplink packet loss from src to dest (%) <li>dlos: Downlink packet loss from dest to src (%)
	Fields []string `json:"fields,omitempty"`

	Scope *Scope `json:"scope,omitempty"`
}

Network metrics query parameters

type NetworkRegistration

type NetworkRegistration struct {
	// contains filtered or unexported fields
}

type NetworkSubscription

type NetworkSubscription struct {

	// Subscription identifier
	SubscriptionId string `json:"subscriptionId,omitempty"`

	// Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription.
	ClientCorrelator string `json:"clientCorrelator,omitempty"`

	CallbackReference *NetworkCallbackReference `json:"callbackReference,omitempty"`

	// Self referring URL.
	ResourceURL string `json:"resourceURL,omitempty"`

	NetworkQueryParams *NetworkQueryParams `json:"networkQueryParams,omitempty"`

	// Notification interval in seconds, disabled if set to 0
	Period int32 `json:"period,omitempty"`

	// Type of subscription triggering notifications
	SubscriptionType string `json:"subscriptionType,omitempty"`
}

Network metrics subscription response

type NetworkSubscriptionList

type NetworkSubscriptionList struct {
	NetworkSubscription []NetworkSubscription `json:"networkSubscription,omitempty"`

	// Self referring URL.
	ResourceURL string `json:"resourceURL,omitempty"`
}

type NetworkSubscriptionParams

type NetworkSubscriptionParams struct {

	// Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription.
	ClientCorrelator string `json:"clientCorrelator,omitempty"`

	CallbackReference *NetworkCallbackReference `json:"callbackReference,omitempty"`

	NetworkQueryParams *NetworkQueryParams `json:"networkQueryParams,omitempty"`

	// Notification interval in seconds
	Period int32 `json:"period,omitempty"`

	// Type of subscription triggering notifications
	SubscriptionType string `json:"subscriptionType,omitempty"`
}

Network metrics subscription parameters

type Scope

type Scope struct {

	// Maximum number of points in the response
	Limit int32 `json:"limit,omitempty"`

	// Length of time range (specify s for seconds, m for minutes, d for days)
	Duration string `json:"duration,omitempty"`
}

Query scope (time / number of points)

type SeqMetric

type SeqMetric struct {

	// Time of Seq logs
	Time string `json:"time,omitempty"`

	// Mermaid formatted seq logs
	Mermaid string `json:"mermaid,omitempty"`

	// Sequencediagram.org formatted seq logs
	Sdorg string `json:"sdorg,omitempty"`
}

Sequence diagram logs

type SeqMetricList

type SeqMetricList struct {

	// Response name
	Name string `json:"name,omitempty"`

	// columns included in response based on queried values
	Columns []string `json:"columns,omitempty"`

	Values []SeqMetric `json:"values,omitempty"`
}

Seq metrics query response

type SeqMetrics

type SeqMetrics struct {
	SeqMetricList *SeqMetricList `json:"seqMetricList,omitempty"`

	// String of sequence metrics
	SeqMetricString string `json:"seqMetricString,omitempty"`
}

type SeqQueryParams

type SeqQueryParams struct {

	// Tag names to match in query. Supported values:<br>
	Tags []Tag `json:"tags,omitempty"`

	// Requested information. Supported values:<br> NOTE: only one of mermaid or sdorg must be included  <li>mermaid: Mermaid format<br> <li>sdorg: Sequencediagram.org format<br>
	Fields []string `json:"fields,omitempty"`

	// Queried response Type. Supported Values:<br> NOTE1: only one of listonly or responly may be included  NOTE2: if listonly or responly are not included, the response contains both the list and string  <li>listonly: Include only a list of sequence metrics in response<br> <li>stronly: Include only a concatenated string of sequence metrics in response<br>
	ResponseType string `json:"responseType,omitempty"`

	Scope *Scope `json:"scope,omitempty"`
}

Seq metrics query parameters

type Tag

type Tag struct {

	// Tag name
	Name string `json:"name,omitempty"`

	// Tag value
	Value string `json:"value,omitempty"`
}

Filtering query parameter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL