+ if gnbs, err := e.getGnbList(); err == nil {
+ nbs = append(nbs, gnbs...)
+ }
+ return nbs
+}
+
+func (e *HWApp) sendSubscription(meid string) {
+
+ xapp.Logger.Info("sending subscription request for meid : %s", meid)
+
+ subscriptionParams := clientmodel.SubscriptionParams{
+ ClientEndpoint: &clientEndpoint,
+ Meid: &meid,
+ RANFunctionID: &funId,
+ SubscriptionDetails: clientmodel.SubscriptionDetailsList{
+ &clientmodel.SubscriptionDetail{
+ RequestorID: &reqId,
+ InstanceID: &seqId,
+ EventTriggers: &clientmodel.EventTriggerDefinition{
+ OctetString: "1234",
+ },
+ ActionToBeSetupList: clientmodel.ActionsToBeSetup{
+ &clientmodel.ActionToBeSetup{
+ ActionDefinition: &clientmodel.ActionDefinition{
+ OctetString: "5678",
+ },
+ ActionID: &actionId,
+ ActionType: &actionType,
+ SubsequentAction: &clientmodel.SubsequentAction{
+ SubsequentActionType: &subsequestActioType,
+ TimeToWait: &timeToWait,
+ },
+ },
+ },
+ },
+ },
+ }
+
+ b, err := json.MarshalIndent(subscriptionParams, "", " ")
+
+ if err != nil {
+ xapp.Logger.Error("Json marshaling failed : %s", err)
+ return
+ }
+
+ xapp.Logger.Info("*****body: %s ", string(b))
+
+ resp, err := xapp.Subscription.Subscribe(&subscriptionParams)
+
+ if err != nil {
+ xapp.Logger.Error("subscription failed (%s) with error: %s", meid, err)
+
+ // subscription failed, raise alarm
+ err := xapp.Alarm.Raise(8086, alarm.SeverityCritical, meid, "subscriptionFailed")
+ if err != nil {
+ xapp.Logger.Error("Raising alarm failed with error %v", err)
+ }
+
+ return
+ }
+ xapp.Logger.Info("Successfully subcription done (%s), subscription id : %s", meid, *resp.SubscriptionID)