Commit 75a88eb9 authored by Ikram Haq's avatar Ikram Haq
Browse files

Add service instance id in the event notification and implement its logic

parent 3d718305
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
/*
 * 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"`
}
+2 −0
Original line number Diff line number Diff line
@@ -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"`
}
+3 −2
Original line number Diff line number Diff line
@@ -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