Commit a08e257e authored by Ikram Haq's avatar Ikram Haq
Browse files

Implement logic to store the resource url in links struct

parent 2aaeee06
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -4380,7 +4380,12 @@ func handleZoneStatusSubscription(w http.ResponseWriter, requestBody []map[strin
			}
			nextZoneStatusSubscriptionIdAvailable = newSubsId + 2 // Increment by 2 to ensure the next even number
			subsIdStr := strconv.Itoa(newSubsId)
			zoneStatusSub.ResourceURL = hostUrl.String() + basePath + "subscriptions/zones/" + subsIdStr
			zoneStatusSub.Links = &Links{
				Self: &LinkType{
					Href: hostUrl.String() + basePath + "subscriptions/zones/" + subsIdStr,
				},
			}
			// zoneStatusSub.ResourceURL = hostUrl.String() + basePath + "subscriptions/zones/" + subsIdStr
			_ = rc.JSONSetEntry(baseKey+typeZoneStatusSubscription+":"+subsIdStr, ".", convertZoneStatusSubscriptionToJson(&zoneStatusSub))
			registerZoneStatus(zoneStatusSub.ZoneId, zoneStatusSub.UpperNumberOfUsersZoneThreshold, zoneStatusSub.UpperNumberOfUsersAPThreshold,
				zoneStatusSub.OperationStatus, subsIdStr, zoneStatusSub.LowerNumberOfUsersZoneThreshold, zoneStatusSub.LowerNumberOfUsersAPThreshold)
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
package server

type ZoneStatusSubscription struct {
	Links       *Links `json:"_links,omitempty"`
	ResourceURL string `json:"resourceURL,omitempty"`
	// URI exposed by the client on which to receive notifications via HTTP. See note 1.
	CallbackReference *CallbackReference `json:"callbackReference"`