From 75a88eb9a7a6bbf26bbf8bec07af969f91b86aba Mon Sep 17 00:00:00 2001 From: Ikram Ul Haq Date: Fri, 30 Aug 2024 12:47:30 +0500 Subject: [PATCH] Add service instance id in the event notification and implement its logic --- .../server/capif-mgmt/model_capif_event_detail.go | 15 +++++++++++++++ .../server/capif-mgmt/model_event_notification.go | 2 ++ .../server/capif-mgmt/service-mgmt.go | 5 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 go-apps/meep-app-enablement/server/capif-mgmt/model_capif_event_detail.go diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_capif_event_detail.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_capif_event_detail.go new file mode 100644 index 000000000..1663a9d27 --- /dev/null +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_capif_event_detail.go @@ -0,0 +1,15 @@ +/* + * MEC service management realized by CAPIF APIs + * + * The ETSI MEC ISG MEC011 MEC Service Management realized by CAPIF APIs described using OpenAPI + * + * API version: 3.2.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type CapifEventDetail struct { + ServiceApiDescriptions []ServiceApiDescription `json:"serviceApiDescriptions,omitempty"` + ApiIds []string `json:"apiIds,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_event_notification.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_event_notification.go index e85d678ae..fdfa66df4 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/model_event_notification.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_event_notification.go @@ -14,4 +14,6 @@ type EventNotification struct { Events []CapifEvent `json:"events,omitempty"` // Identifier of the subscription resource to which the notification is related SubscriptionId string `json:"subscriptionId"` + // Detailed information for the event, conditionally included + EventDetail *CapifEventDetail `json:"eventDetail,omitempty"` } diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go index 8083e4937..b675cd024 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go @@ -1852,7 +1852,8 @@ func checkSerAvailNotification(sInfo *ServiceInfo, mep string, changeType CapifE notif := &EventNotification{ SubscriptionId: sub.Cfg.Id, } - + event_detail := &CapifEventDetail{} + event_detail.ApiIds = append(event_detail.ApiIds, sInfo.SerInstanceId) // Set the event type based on changeType var eventType CapifEvent switch changeType { @@ -1863,7 +1864,7 @@ func checkSerAvailNotification(sInfo *ServiceInfo, mep string, changeType CapifE case "SERVICE_API_UPDATE": eventType = UPDATE default: - // Handle any default case or errors + continue } // If eventType is set, append it to the Events slice -- GitLab