2 // ========================LICENSE_START=================================
5 // Copyright (C) 2021: Nordix Foundation
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 // ========================LICENSE_END===================================
29 "oransc.org/usecase/oruclosedloop/internal/ves"
33 message := ves.FaultMessage{
35 CommonEventHeader: ves.CommonEventHeader{
37 SourceName: "ERICSSON-O-RU-11220",
39 FaultFields: ves.FaultFields{
44 client := &http.Client{
45 Timeout: 5 * time.Second,
49 for range time.Tick(2 * time.Second) {
51 message.Event.FaultFields.EventSeverity = "CRITICAL"
55 message.Event.FaultFields.EventSeverity = "NORMAL"
57 m, _ := json.Marshal(message)
58 msgToSend, _ := json.Marshal([]string{string(m)})
60 req, _ := http.NewRequest(http.MethodPost, "http://localhost:40935", bytes.NewBuffer(msgToSend))
61 req.Header.Set("Content-Type", "application/json; charset=utf-8")