// In v2.2.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
SubscriptionType:APP_TERMINATION_NOTIF_SUB_TYPE,
Href:sub.Cfg.Self,
}
@@ -647,6 +646,13 @@ func timingCurrentTimeGET(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w,string(jsonResponse))
}
/*
* appRegistrationPOST handles the registration of applications.
* It decodes the request body into an AppInfo struct, validates mandatory parameters, retrieves app instance information, validates the app info, and stores it in Redis.
* @param {string} keyName App Info stored with this key
* @param {jsonResponse} contains APP Info response
* @return {error} error An error will return if occurs
log.Error("Shall be present when IsInsByMec is FALSE")
errHandlerProblemDetails(w,"Shall be present when IsInsByMec is FALSE.",http.StatusBadRequest)
errHandlerProblemDetails(w,"Endpoint shall be present when IsInsByMec is FALSE.",http.StatusBadRequest)
return
}
@@ -725,6 +731,13 @@ func appRegistrationPOST(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w,jsonResponse)
}
/*
* appRegistrationGET handles retrieving the registration information of an application.
* It fetches the appInstanceId from the URL variables, retrieves the associated application info from Redis, and sends it back in the response. If the appInstanceId is not found or an error occurs, it responds with the appropriate status and error message.
* @param {http.ResponseWriter} w HTTP response writer
* @param {string} jsonAppInfo Application information
* @return {error} error An error will return if occurs
@@ -763,6 +776,14 @@ func appRegistrationGET(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w,jsonResponse)
}
/*
* appRegistrationPUT modifies the registration information of an application.
* It fetches the appInstanceId from the URL variables, decodes the request body into an AppInfo struct, validates the parameters, checks for the existence of the app info in Redis, updates the Redis entry if validation passes,and responds with the appropriate status.
* @param {string} jsonAppInfo Application information
* @param {http.ResponseWriter} w HTTP response writer
* @param {http.Request} r HTTP request
* @return {error} error An error will return if occurs
@@ -820,13 +841,16 @@ func appRegistrationPUT(w http.ResponseWriter, r *http.Request) {
log.Error("Failed to store AppInfo in the redis DB: ",err)
}
// Prepare & send response
jsonResponse:=convertAppInfoToJson(&appInfoPut)
w.WriteHeader(http.StatusOK)
fmt.Fprint(w,jsonResponse)
w.WriteHeader(http.StatusNoContent)
}
/*
* appRegistrationDELETE handles the deletion of an application's registration information.
* It fetches the appInstanceId from the URL variables, checks if the app info exists in Redis, deletes the Redis entry if it exists, and responds with the appropriate status.
* @param {http.ResponseWriter} w HTTP response writer
* @param {http.Request} r HTTP request
* @return {error} error An error will return if occurs
* MEC Service Management Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC011 Application Enablement API](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/011/03.01.01_60/gs_MEC011v030101p.pdf) <p>[Copyright (c) ETSI 2024](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-app-enablement](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-app-enablement/server/service-mgmt) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about services in the network <p>**Note**<br>AdvantEDGE supports all of Service Management API endpoints (see below).