Skip to content

Commit

Permalink
Updates to ETSI APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvigoyal25 committed Oct 17, 2022
1 parent de9180e commit 04a2c3d
Show file tree
Hide file tree
Showing 1,148 changed files with 15,692 additions and 13,029 deletions.
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 0.0.1
- Build date: 2022-09-20T10:11:33.486-04:00
- Build date: 2022-10-11T16:22:41.366-04:00


### Running the server
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_edge_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_subscription_id.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_time_stamp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_ue_state.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
8 changes: 4 additions & 4 deletions examples/demo1/src/demo-server/go/model_user_event_type.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down Expand Up @@ -27,7 +27,7 @@ type UserEventType string

// List of UserEventType
const (
ENTERING UserEventType = "Entering"
TRANSFERRING UserEventType = "Transferring"
EXITING UserEventType = "Exiting"
ENTERING_UserEventType UserEventType = "Entering"
TRANSFERRING_UserEventType UserEventType = "Transferring"
EXITING_UserEventType UserEventType = "Exiting"
)
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_user_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_user_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/demo-server/go/model_zone_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/iperf-proxy/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 0.0.1
- Build date: 2022-09-20T10:11:35.995-04:00
- Build date: 2022-10-11T16:22:43.782-04:00


### Running the server
Expand Down
2 changes: 1 addition & 1 deletion examples/demo1/src/iperf-proxy/go/model_iperf_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 InterDigital Communications, Inc
* Copyright (c) 2022 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.
Expand Down
67 changes: 28 additions & 39 deletions examples/demo3/src/backend/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ components:
example:
mecReady: true
subscriptions:
'SerAvailabilitySubscription:':
SerAvailabilitySubscription:
subId: subId
AmsLinkListSubscription:
subId: subId
Expand Down Expand Up @@ -348,13 +348,13 @@ components:
properties:
AppTerminationSubscription:
$ref: '#/components/schemas/ApplicationInstance_AppTerminationSubscription'
'SerAvailabilitySubscription:':
SerAvailabilitySubscription:
$ref: '#/components/schemas/ApplicationInstance_SerAvailabilitySubscription'
AmsLinkListSubscription:
$ref: '#/components/schemas/ApplicationInstance_AmsLinkListSubscription'
description: List of ams subscription unique to device and their id
example:
'SerAvailabilitySubscription:':
SerAvailabilitySubscription:
subId: subId
AmsLinkListSubscription:
subId: subId
Expand Down Expand Up @@ -489,29 +489,36 @@ components:
href: http://example.com/aeiou
callbackReference: http://example.com/aeiou
MobilityProcedureNotification:
title: MobilityProcedureNotification
required:
- associateId
- links
- mobilityStatus
- notificationType
type: object
properties:
notificationType:
type: string
description: Shall be set to "MobilityProcedureNotification".
timeStamp:
$ref: '#/components/schemas/TimeStamp'
associateId:
minItems: 0
type: array
description: 1 to N identifiers to associate the information for specific
description: 0 to N identifiers to associate the information for specific
UE(s) and flow(s).
items:
$ref: '#/components/schemas/AssociateId'
x-etsi-mec-cardinality: 0..N
x-etsi-mec-origin-type: AssociateId
mobilityStatus:
$ref: '#/components/schemas/MobilityStatus'
type: integer
description: "Indicate the status of the UE mobility. Values are defined\
\ as following: 1 = INTERHOST_MOVEOUT_TRIGGERED. 2 = INTERHOST_MOVEOUT_COMPLETED.\
\ 3 = INTERHOST_MOVEOUT_FAILED. Other values are reserved."
x-etsi-mec-cardinality: "1"
notificationType:
type: string
description: Shall be set to \"MobilityProcedureNotification\".
x-etsi-mec-cardinality: "1"
x-etsi-mec-origin-type: String
targetAppInfo:
$ref: '#/components/schemas/MobilityProcedureNotification_targetAppInfo'
_links:
$ref: '#/components/schemas/LinkType'
timeStamp:
$ref: '#/components/schemas/TimeStamp'
x-etsi-ref: 7.4.2
TimeStamp:
required:
- nanoSeconds
Expand Down Expand Up @@ -545,42 +552,24 @@ components:
$ref: '#/components/schemas/CommunicationInterface'
description: Identifiers to associate the information of target application
instance.
MobilityProcedureNotification__links:
required:
- subscription
type: object
properties:
subscription:
$ref: '#/components/schemas/LinkType'
description: Object containing hyperlinks related to the resource.
CommunicationInterface:
properties:
ipAddresses:
type: string
AssociateId:
title: AssociateId
required:
- type
- value
type: object
properties:
type:
$ref: '#/components/schemas/Type'
type: integer
x-etsi-mec-cardinality: "1"
x-etsi-mec-origin-type: Enum
value:
type: string
description: Value for the identifier.
x-etsi-mec-cardinality: "1"
x-etsi-mec-origin-type: String
example:
type: UE_IPv4_ADDRESS
type: 0
value: value
Type:
title: Type
type: string
description: Numeric value (0-255) corresponding to specified type of identifier
enum:
- UE_IPv4_ADDRESS
- UE_IPV6_ADDRESS
- NATED_IP_ADDRESS
- GTP_TEID
AppTerminationSubscription__links:
required:
- self
Expand Down
4 changes: 2 additions & 2 deletions examples/demo3/src/backend/server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Go API Server for server

This section describes how to use AdvantEdge mec services with a scenario demonstrating use-case 1 - 3
Demo 3 is an edge application that can be used with AdvantEDGE or ETSI MEC Sandbox to demonstrate MEC011 and MEC021 usage

## Overview
This server was generated by the [swagger-codegen]
Expand All @@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 0.0.1
- Build date: 2021-11-24T04:23:06.407744-05:00[America/New_York]
- Build date: 2022-10-11T16:22:45.912749-04:00[America/New_York]


### Running the server
Expand Down
25 changes: 13 additions & 12 deletions examples/demo3/src/backend/server/demo3_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func demo3UpdateAmsDevices(w http.ResponseWriter, r *http.Request) {
}

// Update AMS Resource
var contextTransferState ams.ContextTransferState = ams.NOT_TRANSFERRED
var contextTransferState ams.ContextTransferState = ams.NOT_TRANSFERRED_ContextTransferState
_, err = amsSetDevice(amsResourceId, amsResource, device, contextTransferState)
if err != nil {
log.Error("Could not add device to AMS Resource", err.Error())
Expand Down Expand Up @@ -838,7 +838,7 @@ func amsNotificationCallback(w http.ResponseWriter, r *http.Request) {
}

// Update AMS Resource
_, amsUpdateError := amsSetDevice(amsResourceId, amsResource, amsNotification.AssociateId[0].Value, ams.USER_CONTEXT_TRANSFER_COMPLETED)
_, amsUpdateError := amsSetDevice(amsResourceId, amsResource, amsNotification.AssociateId[0].Value, ams.USER_CONTEXT_TRANSFER_COMPLETED_ContextTransferState)
if amsUpdateError != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "Could not update ams")
Expand Down Expand Up @@ -886,7 +886,7 @@ func stateTransferPOST(w http.ResponseWriter, r *http.Request) {
var targetContextState ApplicationContextState
decoder := json.NewDecoder(r.Body)
err := decoder.Decode(&targetContextState)
counter := strconv.Itoa(targetContextState.Counter)
counter := strconv.Itoa(int(targetContextState.Counter))
if err != nil {
log.Error(err.Error())
appActivityLogs = append(appActivityLogs, "=== Receive device "+targetContextState.Device+" context (state="+counter+") [500]")
Expand All @@ -903,7 +903,7 @@ func stateTransferPOST(w http.ResponseWriter, r *http.Request) {
}

// Update AMS Resource
var contextTransferState ams.ContextTransferState = ams.NOT_TRANSFERRED
var contextTransferState ams.ContextTransferState = ams.NOT_TRANSFERRED_ContextTransferState
_, err = amsSetDevice(amsResourceId, amsResourceBody, targetContextState.Device, contextTransferState)
if err != nil {
log.Error(err.Error())
Expand Down Expand Up @@ -932,7 +932,7 @@ func stateTransferPOST(w http.ResponseWriter, r *http.Request) {
}
addToTrackingDevices(targetContextState.Device)

terminalDeviceState[targetContextState.Device] = targetContextState.Counter
terminalDeviceState[targetContextState.Device] = int(targetContextState.Counter)

appActivityLogs = append(appActivityLogs, "=== Receive device "+targetContextState.Device+" context (state="+counter+") [200]")

Expand All @@ -951,7 +951,7 @@ func updateAmsSubscription(subscriptionId string, device string, inlineSubscript
return inLineSubscriptionResp, nil
}

var t_ ams.ModelType = ams.UE_I_PV4_ADDRESS
var t_ ams.AssociateIdType = ams.UE_I_PV4_ADDRESS_AssociateIdType
associateId := ams.AssociateId{
Type_: &t_,
Value: device,
Expand All @@ -971,7 +971,7 @@ func sendContextTransfer(notifyUrl string, device string, targetId string) error

// Context state transfer
var contextState ApplicationContextState
contextState.Counter = terminalDeviceState[device]
contextState.Counter = int32(terminalDeviceState[device])
contextState.AppId = instanceName
contextState.Mep = mep
contextState.Device = device
Expand All @@ -983,7 +983,7 @@ func sendContextTransfer(notifyUrl string, device string, targetId string) error
log.Error("Failed to marshal context state ", err.Error())
return err
}
counter := strconv.Itoa(contextState.Counter)
counter := strconv.Itoa(int(contextState.Counter))
resp, err := http.Post(notifyUrl, "application/json", bytes.NewBuffer(jsonCounter))
if err != nil {
log.Error(err.Error())
Expand Down Expand Up @@ -1032,10 +1032,10 @@ func amsSetDevice(amsId string, registerationBody ams.RegistrationInfo, device s
}
if !updated {
var associateId ams.AssociateId
var t_ ams.ModelType = ams.UE_I_PV4_ADDRESS
var t_ ams.AssociateIdType = ams.UE_I_PV4_ADDRESS_AssociateIdType
associateId.Type_ = &t_
associateId.Value = device
var appMobilityServiceLevel ams.AppMobilityServiceLevel = ams.WITHOUT_CONFIRMATION
var appMobilityServiceLevel ams.AppMobilityServiceLevel = ams.WITHOUT_CONFIRMATION_AppMobilityServiceLevel
registerationBody.DeviceInformation = append(registerationBody.DeviceInformation, ams.RegistrationInfoDeviceInformation{
AssociateId: &associateId,
AppMobilityServiceLevel: &appMobilityServiceLevel,
Expand Down Expand Up @@ -1080,11 +1080,12 @@ func amsSendSubscription(appInstanceId string, device string, callBackUrl string
var mobilityProcedureSubscription ams.MobilityProcedureSubscription

mobilityProcedureSubscription.CallbackReference = callBackUrl + "/services/callback/amsevent"
mobilityProcedureSubscription.SubscriptionType = "MobilityProcedureSubscription"
subscriptionType := ams.MOBILITY_PROCEDURE_SUBSCRIPTION_SubscriptionType
mobilityProcedureSubscription.SubscriptionType = &subscriptionType

// Default tracking ue set to 10.100.0.3
var associateId ams.AssociateId
var t_ ams.ModelType = ams.UE_I_PV4_ADDRESS
var t_ ams.AssociateIdType = ams.UE_I_PV4_ADDRESS_AssociateIdType
associateId.Type_ = &t_
associateId.Value = device

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package server

type ApplicationContextState struct {
// Integer representing state of device being tracked
Counter int `json:"Counter,omitempty"`
Counter int32 `json:"Counter,omitempty"`
// Application UUID
AppId string `json:"AppId,omitempty"`
// MEC platform name
Expand Down
4 changes: 2 additions & 2 deletions examples/demo3/src/backend/server/model_associate_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package server

type AssociateId struct {
Type_ *ModelType `json:"type"`
Type_ int32 `json:"type,omitempty"`
// Value for the identifier.
Value string `json:"value"`
Value string `json:"value,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
package server

type CommunicationInterface struct {
IpAddresses []CommunicationInterfaceIpAddresses `json:"ipAddresses,omitempty"`
IpAddresses string `json:"ipAddresses,omitempty"`
}
Loading

0 comments on commit 04a2c3d

Please sign in to comment.