Commit a7c1611f authored by Simon Pastor's avatar Simon Pastor
Browse files

system test passed

parent 948b9898
Loading
Loading
Loading
Loading
+14 −14
Original line number Original line Diff line number Diff line
@@ -209,13 +209,13 @@ func applicationsConfirmReadyPOST(w http.ResponseWriter, r *http.Request) {
	}
	}


	// Validate App Ready params
	// Validate App Ready params
	if confirmation.Indication == nil {
	if confirmation.Indication == "" {
		log.Error("Mandatory Indication not present")
		log.Error("Mandatory Indication not present")
		http.Error(w, "Mandatory Indication not present", http.StatusBadRequest)
		http.Error(w, "Mandatory Indication not present", http.StatusBadRequest)
		return
		return
	}
	}
	switch *confirmation.Indication {
	switch confirmation.Indication {
	case READY:
	case "READY":
	default:
	default:
		log.Error("Mandatory OperationAction value not valid")
		log.Error("Mandatory OperationAction value not valid")
		http.Error(w, "Mandatory OperationAction value not valid", http.StatusBadRequest)
		http.Error(w, "Mandatory OperationAction value not valid", http.StatusBadRequest)
@@ -372,11 +372,11 @@ func applicationsSubscriptionsPOST(w http.ResponseWriter, r *http.Request) {
	nextSubscriptionIdAvailable++
	nextSubscriptionIdAvailable++
	subIdStr := strconv.Itoa(newSubsId)
	subIdStr := strconv.Itoa(newSubsId)


	link := new(Self)
	links := new(AppTerminationNotificationSubscriptionLinks)
	self := new(LinkType)
	self := new(LinkType)
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions/" + subIdStr
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions/" + subIdStr
	link.Self = self
	links.Self = self
	subscription.Links = link
	subscription.Links = links


	//registration
	//registration
	registerAppTermination(&subscription, newSubsId)
	registerAppTermination(&subscription, newSubsId)
@@ -491,21 +491,21 @@ func applicationsSubscriptionsGET(w http.ResponseWriter, r *http.Request) {
		return
		return
	}
	}


	subscriptionLinkList := new(MecAppSuptApiSubscriptionLinkList)
	subscriptionLinkList := new(SubscriptionLinkList)


	link := new(MecAppSuptApiSubscriptionLinkListLinks)
	links := new(SubscriptionLinkListLinks)
	self := new(LinkType)
	self := new(LinkType)
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions"
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions"


	link.Self = self
	links.Self = self
	subscriptionLinkList.Links = link
	subscriptionLinkList.Links = links


	//loop through all different types of subscription
	//loop through all different types of subscription


	//loop through appTerm map
	//loop through appTerm map
	for _, appTermSubscription := range appTerminationNotificationSubscriptionMap {
	for _, appTermSubscription := range appTerminationNotificationSubscriptionMap {
		if appTermSubscription != nil && appTermSubscription.AppInstanceId == appInstanceId {
		if appTermSubscription != nil && appTermSubscription.AppInstanceId == appInstanceId {
			var subscription MecAppSuptApiSubscriptionLinkListSubscription
			var subscription SubscriptionLinkListLinksSubscriptions
			subscription.Href = appTermSubscription.Links.Self.Href
			subscription.Href = appTermSubscription.Links.Self.Href
			//in v2.1.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
			//in v2.1.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
			subscription.Rel = APP_TERMINATION_NOTIFICATION_SUBSCRIPTION_TYPE
			subscription.Rel = APP_TERMINATION_NOTIFICATION_SUBSCRIPTION_TYPE
@@ -609,7 +609,7 @@ func processAppTerminate(appInstanceId string, mep string) {
		linkType := new(LinkType)
		linkType := new(LinkType)
		linkType.Href = sub.Links.Self.Href
		linkType.Href = sub.Links.Self.Href
		links.Subscription = linkType
		links.Subscription = linkType
		confirmTermination := new(LinkTypeConfirmTermination)
		confirmTermination := new(LinkType)
		confirmTermination.Href = hostUrl.String() + basePath + "confirm_termination"
		confirmTermination.Href = hostUrl.String() + basePath + "confirm_termination"
		links.ConfirmTermination = confirmTermination
		links.ConfirmTermination = confirmTermination
		notif.Links = links
		notif.Links = links
+5 −5
Original line number Original line Diff line number Diff line
@@ -675,8 +675,8 @@ func applicationsSubscriptionsGET(w http.ResponseWriter, r *http.Request) {
	}
	}


	// Retrieve subscription list
	// Retrieve subscription list
	var subscriptionLinkList MecServiceMgmtApiSubscriptionLinkList
	var subscriptionLinkList SubscriptionLinkList
	link := new(MecServiceMgmtApiSubscriptionLinkListLinks)
	link := new(SubscriptionLinkListLinks)
	self := new(LinkType)
	self := new(LinkType)
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions"
	self.Href = hostUrl.String() + basePath + "applications/" + appInstanceId + "/subscriptions"
	link.Self = self
	link.Self = self
@@ -1000,7 +1000,7 @@ func populateServiceInfoList(key string, jsonInfo string, sInfoList interface{})


func populateSubscriptionsList(key string, jsonInfo string, data interface{}) error {
func populateSubscriptionsList(key string, jsonInfo string, data interface{}) error {
	// Get query params & userlist from user data
	// Get query params & userlist from user data
	subscriptionLinkList := data.(*MecServiceMgmtApiSubscriptionLinkList)
	subscriptionLinkList := data.(*SubscriptionLinkList)
	if data == nil {
	if data == nil {
		return errors.New("subscriptionLinkList not found")
		return errors.New("subscriptionLinkList not found")
	}
	}
@@ -1013,7 +1013,7 @@ func populateSubscriptionsList(key string, jsonInfo string, data interface{}) er
	}
	}


	// Populate subscription to return
	// Populate subscription to return
	var subscription MecServiceMgmtApiSubscriptionLinkListSubscription
	var subscription SubscriptionLinkListLinksSubscriptions
	subscription.Href = serAvailSubscription.Links.Self.Href
	subscription.Href = serAvailSubscription.Links.Self.Href
	//in v2.1.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
	//in v2.1.1 it should be SubscriptionType, but spec is expecting "rel" as per v1.1.1
	subscription.Rel = SER_AVAILABILITY_NOTIFICATION_SUBSCRIPTION_TYPE
	subscription.Rel = SER_AVAILABILITY_NOTIFICATION_SUBSCRIPTION_TYPE
@@ -1156,7 +1156,7 @@ func checkSerAvailNotification(sInfo *ServiceInfo, mep string, changeType Servic
		serAvailabilityRef.SerName = sInfo.SerName
		serAvailabilityRef.SerName = sInfo.SerName
		serAvailabilityRef.SerInstanceId = sInfo.SerInstanceId
		serAvailabilityRef.SerInstanceId = sInfo.SerInstanceId
		serAvailabilityRef.State = sInfo.State
		serAvailabilityRef.State = sInfo.State
		serAvailabilityRef.ChangeType = &changeType
		serAvailabilityRef.ChangeType = string(changeType)
		serAvailabilityRefList = append(serAvailabilityRefList, serAvailabilityRef)
		serAvailabilityRefList = append(serAvailabilityRefList, serAvailabilityRef)
		notif.ServiceReferences = serAvailabilityRefList
		notif.ServiceReferences = serAvailabilityRefList


+0 −31
Original line number Original line Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Location Service REST API
 *
 * Location Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC013 Location API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/013/02.01.01_60/gs_mec013v020101p.pdf) <p>The API is based on the Open Mobile Alliance's specification RESTful Network API for Zonal Presence <p>[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-loc-serv](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-loc-serv) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about Users (UE) and Zone locations <p>**Details**<br>API details available at _your-AdvantEDGE-ip-address/api_ <p>AdvantEDGE supports a selected subset of Location API endpoints (see below)
 *
 * API version: 2.1.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package client

// Object containing hyperlinks related to the resource.
type AppTerminationNotificationLinks struct {
	Subscription       *LinkType                   `json:"subscription"`
	ConfirmTermination *LinkTypeConfirmTermination `json:"confirmTermination,omitempty"`
}
+0 −30
Original line number Original line Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Location Service REST API
 *
 * Location Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC013 Location API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/013/02.01.01_60/gs_mec013v020101p.pdf) <p>The API is based on the Open Mobile Alliance's specification RESTful Network API for Zonal Presence <p>[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-loc-serv](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-loc-serv) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about Users (UE) and Zone locations <p>**Details**<br>API details available at _your-AdvantEDGE-ip-address/api_ <p>AdvantEDGE supports a selected subset of Location API endpoints (see below)
 *
 * API version: 2.1.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package client

// Link to the task resource where to confirm termination in case the application is ready to be terminated before expiry of the timeout.
type LinkTypeConfirmTermination struct {
	Href string `json:"href,omitempty"`
}
+0 −31
Original line number Original line Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Radio Network Information Service REST API
 *
 * Radio Network Information Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC012 RNI API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/012/02.01.01_60/gs_MEC012v020101p.pdf) <p>[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-rnis](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-rnis) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about radio conditions in the network <p>**Details**<br>API details available at _your-AdvantEDGE-ip-address/api_ <p>AdvantEDGE supports a selected subset of RNI API endpoints (see below) and a subset of subscription types. <p>Supported subscriptions: <p> - CellChangeSubscription <p> - RabEstSubscription <p> - RabRelSubscription <p> - MeasRepUeSubscription <p> - NrMeasRepUeSubscription
 *
 * API version: 2.1.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package client

// Object containing hyperlinks related to the resource.
type AppTerminationNotificationLinks struct {
	Subscription       *LinkType                   `json:"subscription"`
	ConfirmTermination *LinkTypeConfirmTermination `json:"confirmTermination,omitempty"`
}
Loading