3 // ========================LICENSE_START=================================
6 // Copyright (C) 2023: Nordix Foundation
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
12 // http://www.apache.org/licenses/LICENSE-2.0
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 // ========================LICENSE_END===================================
25 "github.com/confluentinc/confluent-kafka-go/kafka"
28 // // Data type for event xml file download
29 type XmlFileEventHeader struct {
30 ProductName string `json:"productName"`
31 VendorName string `json:"vendorName"`
32 Location string `json:"location"`
33 Compression string `json:"compression"`
34 SourceName string `json:"sourceName"`
35 FileFormatType string `json:"fileFormatType"`
36 FileFormatVersion string `json:"fileFormatVersion"`
37 StartEpochMicrosec int64 `json:"startEpochMicrosec"`
38 LastEpochMicrosec int64 `json:"lastEpochMicrosec"`
39 Name string `json:"name"`
40 ChangeIdentifier string `json:"changeIdentifier"`
41 InternalLocation string `json:"internalLocation"`
42 TimeZoneOffset string `json:"timeZoneOffset"`
43 ObjectStoreBucket string `json:"objectStoreBucket"`
46 // Data types for input xml file
47 type MeasCollecFile struct {
48 XMLName xml.Name `xml:"measCollecFile"`
49 Text string `xml:",chardata"`
50 Xmlns string `xml:"xmlns,attr"`
51 Xsi string `xml:"xsi,attr"`
52 SchemaLocation string `xml:"schemaLocation,attr"`
54 Text string `xml:",chardata"`
55 FileFormatVersion string `xml:"fileFormatVersion,attr"`
56 VendorName string `xml:"vendorName,attr"`
57 DnPrefix string `xml:"dnPrefix,attr"`
59 Text string `xml:",chardata"`
60 LocalDn string `xml:"localDn,attr"`
61 ElementType string `xml:"elementType,attr"`
64 Text string `xml:",chardata"`
65 BeginTime string `xml:"beginTime,attr"`
69 Text string `xml:",chardata"`
70 ManagedElement struct {
71 Text string `xml:",chardata"`
72 LocalDn string `xml:"localDn,attr"`
73 SwVersion string `xml:"swVersion,attr"`
74 } `xml:"managedElement"`
76 Text string `xml:",chardata"`
77 MeasInfoId string `xml:"measInfoId,attr"`
79 Text string `xml:",chardata"`
80 JobId string `xml:"jobId,attr"`
83 Text string `xml:",chardata"`
84 Duration string `xml:"duration,attr"`
85 EndTime string `xml:"endTime,attr"`
88 Text string `xml:",chardata"`
89 Duration string `xml:"duration,attr"`
92 Text string `xml:",chardata"`
93 P string `xml:"p,attr"`
96 Text string `xml:",chardata"`
97 MeasObjLdn string `xml:"measObjLdn,attr"`
99 Text string `xml:",chardata"`
100 P string `xml:"p,attr"`
102 Suspect string `xml:"suspect"`
107 Text string `xml:",chardata"`
109 Text string `xml:",chardata"`
110 EndTime string `xml:"endTime,attr"`
115 // Splitted in sevreal part to allow add/remove in lists
116 type MeasResults struct {
118 SValue string `json:"sValue"`
121 type MeasValues struct {
122 MeasObjInstID string `json:"measObjInstId"`
123 SuspectFlag string `json:"suspectFlag"`
124 MeasResultsList []MeasResults `json:"measResults"`
127 type SMeasTypes struct {
128 SMeasType string `json:"sMeasTypesList"`
131 type MeasInfoList struct {
133 SMeasInfoID string `json:"sMeasInfoId"`
134 } `json:"measInfoId"`
136 SMeasTypesList []string `json:"sMeasTypesList"`
138 MeasValuesList []MeasValues `json:"measValuesList"`
141 type PMJsonFile struct {
143 CommonEventHeader struct {
144 Domain string `json:"domain"`
145 EventID string `json:"eventId"`
146 Sequence int `json:"sequence"`
147 EventName string `json:"eventName"`
148 SourceName string `json:"sourceName"`
149 ReportingEntityName string `json:"reportingEntityName"`
150 Priority string `json:"priority"`
151 StartEpochMicrosec int64 `json:"startEpochMicrosec"`
152 LastEpochMicrosec int64 `json:"lastEpochMicrosec"`
153 Version string `json:"version"`
154 VesEventListenerVersion string `json:"vesEventListenerVersion"`
155 TimeZoneOffset string `json:"timeZoneOffset"`
156 } `json:"commonEventHeader"`
157 Perf3GppFields struct {
158 Perf3GppFieldsVersion string `json:"perf3gppFieldsVersion"`
159 MeasDataCollection struct {
160 GranularityPeriod int `json:"granularityPeriod"`
161 MeasuredEntityUserName string `json:"measuredEntityUserName"`
162 MeasuredEntityDn string `json:"measuredEntityDn"`
163 MeasuredEntitySoftwareVersion string `json:"measuredEntitySoftwareVersion"`
164 SMeasInfoList []MeasInfoList `json:"measInfoList"`
165 } `json:"measDataCollection"`
166 } `json:"perf3gppFields"`
170 type FileDownloadedEvt struct {
171 Filename string `json:"filename"`
174 type KafkaPayload struct {
179 // Type for controlling the topic reader
180 type ReaderControl struct {
184 // Type for controlling the topic writer
185 type WriterControl struct {
189 // == API Datatypes ==//
190 // Type for supported data types
191 type DataType struct {
192 ID string `json:"id"`
193 KafkaInputTopic string `json:"kafkaInputTopic"`
194 InputJobType string `json:inputJobType`
195 InputJobDefinition struct {
196 KafkaOutputTopic string `json:kafkaOutputTopic`
197 } `json:inputJobDefinition`
204 // Type for controlling the job
205 type JobControl struct {
212 var InfoTypes DataTypes
214 // Keep all info type jobs, key == type id
215 var TypeJobs map[string]TypeJobRecord = make(map[string]TypeJobRecord)
217 // Type for an infojob
218 type TypeJobRecord struct {
221 Data_in_channel chan *KafkaPayload
222 Reader_control chan ReaderControl
223 Job_control chan JobControl
228 type DataTypes struct {
229 ProdDataTypes []DataType `json:"types"`