Commit b23d28f8 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

replaced integer enums by an integer

parent af62a3e1
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -615,10 +615,6 @@ components:
      x-etsi-ref: 7.2.3
    AppMobilityServiceLevel:
      description: 'This attribute provides an option for the application instance (server) to communicate with the application client before relocating this application instance to another MEC host. Applicable values are: 1 = APP_MOBILITY_NOT_ALLOWED, 2 = APP_MOBILITY_WITH_CONFIRMATION, 3 = APP_MOBILITY_WITHOUT_CONFIRMATION.'
      enum:
      - 1
      - 2
      - 3
      type: integer
      x-etsi-notes: "APP_MOBILITY_NOT_ALLOWED: the current serving application instance continues to deliver the service to the device. The AMS will inform the MEP to perform the traffic steering to the device when the UE moves cross MEC hosts. \u2212 APP_MOBILITY_WITH_CONFIRMATION: the serving application instance is allowed to change with the confirmation by the application once the device mobility happens. The AMS then will inform the MEP to update the traffic routing to the target application instance and clean up the previous resource allocated to the application instance serving to the device after the serving application instance has been changed. \u2212 APP_MOBILITY_WITHOUT_CONFIRMATION: the serving application instance is allowed to change without confirmation from the application instance when the device mobility happens. The AMS will notify to the MEP to update the traffic routing to the target application instance and clean up the previous resource allocated to the application instance serving to the device after the serving application instance has been changed."
    CommunicationInterface:
@@ -694,10 +690,6 @@ components:
      - filterCriteria
    MobilityStatus:
      description: 'Indicate the status of the UE mobility. Values are: 1 = INTERHOST_MOVEOUT_TRIGGERED, 2 = INTERHOST_MOVEOUT_COMPLETED, 3 = INTERHOST_MOVEOUT_FAILED'
      enum:
      - 1
      - 2
      - 3
      type: integer
    RegistrationInfo:
      type: object
@@ -798,9 +790,6 @@ components:
      x-etsi-ref: 7.3.4
    ContextTransferState:
      description: 'If present, it represents the state of transferring the user context to another application instance. The applicable values are: 0 = NOT_TRANSFERRED, 1= USER_CONTEXT_TRANSEFR_COMPLETED.'
      enum:
      - 0
      - 1
      type: integer
    HostName:
      description: >-
@@ -814,12 +803,6 @@ components:
      properties:
        type:
          description: 'Numeric value (0-255) corresponding to specified type of identifier as following: <p>0 = reserved. <p>1 = UE_IPv4_ADDRESS. <p>2 = UE_IPV6_ADDRESS. <p>3 = NATED_IP_ADDRESS. <p>4 = GTP_TEID.'
          enum:
          - 0
          - 1
          - 2
          - 3
          - 4
          type: integer
          x-etsi-mec-cardinality: '1'
          x-etsi-mec-origin-type: Enum
@@ -914,10 +897,6 @@ components:
          x-etsi-mec-origin-type: AssociateId
        mobilityStatus:
          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.'
          enum:
          - 1
          - 2
          - 3
          type: integer
          x-etsi-mec-cardinality: '1'
        notificationType:
+1 −1
Original line number Diff line number Diff line
@@ -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: 2.1.1
- Build date: 2021-09-15T21:36:29.173-04:00[America/New_York]
- Build date: 2021-10-06T15:28:50.114702-04:00[America/Toronto]


### Running the server
+21 −4
Original line number Diff line number Diff line
@@ -73,6 +73,23 @@ const (
	notifExpiry = "ExpiryNotification"
)

const (
	AppMobilityServiceLevel_APP_MOBILITY_NOT_ALLOWED          = 1
	AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION    = 2
	AppMobilityServiceLevel_APP_MOBILITY_WITHOUT_CONFIRMATION = 3
)

const (
	MobilityStatus_INTERHOST_MOVEOUT_TRIGGERED = 1
	MobilityStatus_INTERHOST_MOVEOUT_COMPLETED = 2
	MobilityStatus_INTERHOST_MOVEOUT_FAILED    = 3
)

const (
	ContextTransferState_NOT_TRANSFERRED                 = 0
	ContextTransferState_USER_CONTEXT_TRANSFER_COMPLETED = 1
)

const MOBILITY_PROCEDURE_SUBSCRIPTION_INT = int32(1)
const MOBILITY_PROCEDURE_SUBSCRIPTION = "MobilityProcedureSubscription"
const MOBILITY_PROCEDURE_NOTIFICATION = "MobilityProcedureNotification"
@@ -1665,8 +1682,8 @@ func appMobilityServicePOST(w http.ResponseWriter, r *http.Request) {
	for _, deviceInfo := range registrationInfo.DeviceInformation {
		fields := make(map[string]interface{})
		fields["associateId"] = deviceInfo.AssociateId.Value
		fields["serviceLevel"] = strconv.Itoa(int(*deviceInfo.AppMobilityServiceLevel))
		fields["contextTransferState"] = strconv.Itoa(int(*deviceInfo.ContextTransferState))
		fields["serviceLevel"] = strconv.Itoa(int(deviceInfo.AppMobilityServiceLevel))
		fields["contextTransferState"] = strconv.Itoa(int(deviceInfo.ContextTransferState))
		fields["mobilityServiceId"] = servIdStr
		fields["appInstanceId"] = ""
		if registrationInfo.ServiceConsumerId.MepId != "" {
@@ -1765,8 +1782,8 @@ func appMobilityServiceByIdPUT(w http.ResponseWriter, r *http.Request) {
	for _, deviceInfo := range registrationInfo.DeviceInformation {
		fields := make(map[string]interface{})
		fields["associateId"] = deviceInfo.AssociateId.Value
		fields["serviceLevel"] = strconv.Itoa(int(*deviceInfo.AppMobilityServiceLevel))
		fields["contextTransferState"] = strconv.Itoa(int(*deviceInfo.ContextTransferState))
		fields["serviceLevel"] = strconv.Itoa(int(deviceInfo.AppMobilityServiceLevel))
		fields["contextTransferState"] = strconv.Itoa(int(deviceInfo.ContextTransferState))
		fields["mobilityServiceId"] = serviceId
		fields["appInstanceId"] = ""
		if registrationInfo.ServiceConsumerId.MepId != "" {
+4 −8
Original line number Diff line number Diff line
@@ -864,9 +864,7 @@ func testServicesPost(t *testing.T) string {
	 * expected response section
	 ******************************/
	expectedAssocId1 := AssociateId{1, "1.1.1.1"}
	appMobilityServiceLevel := AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION
	contextTransferState := ContextTransferState_NOT_TRANSFERRED
	expectedDeviceInfo1 := RegistrationInfoDeviceInformation{&expectedAssocId1, &appMobilityServiceLevel, &contextTransferState}
	expectedDeviceInfo1 := RegistrationInfoDeviceInformation{&expectedAssocId1, AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION, ContextTransferState_NOT_TRANSFERRED}
	expectedDeviceInfo := []RegistrationInfoDeviceInformation{expectedDeviceInfo1}
	expectedRegistrationInfo := RegistrationInfo{strconv.Itoa(nextServiceIdAvailable), expectedDeviceInfo, 0, &RegistrationInfoServiceConsumerId{"myapp", ""}}
	//expectedExpiry := TimeStamp{0, 1998599770}
@@ -927,9 +925,7 @@ func testServicesPut(t *testing.T, serviceId string, expectSuccess bool) string
	 * expected response section
	 ******************************/
	expectedAssocId1 := AssociateId{1, "1.1.1.1"}
	appMobilityServiceLevel := AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION
	contextTransferState := ContextTransferState_NOT_TRANSFERRED
	expectedDeviceInfo1 := RegistrationInfoDeviceInformation{&expectedAssocId1, &appMobilityServiceLevel, &contextTransferState}
	expectedDeviceInfo1 := RegistrationInfoDeviceInformation{&expectedAssocId1, AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION, ContextTransferState_NOT_TRANSFERRED}
	expectedDeviceInfo := []RegistrationInfoDeviceInformation{expectedDeviceInfo1}
	expectedRegistrationInfo := RegistrationInfo{serviceId, expectedDeviceInfo, 0, &RegistrationInfoServiceConsumerId{"myapp", ""}}
	//expectedExpiry := TimeStamp{0, 1998599770}
@@ -1116,7 +1112,7 @@ func testSubscriptionMobilityProcedurePost(t *testing.T) string {
	 ******************************/
	expectedAssocId1 := AssociateId{1, "1.1.1.1"}
	expectedAssocId := []AssociateId{expectedAssocId1}
	expectedFilter := MobilityProcedureSubscriptionFilterCriteria{"myApp", expectedAssocId, []MobilityStatus{MobilityStatus_INTERHOST_MOVEOUT_TRIGGERED}}
	expectedFilter := MobilityProcedureSubscriptionFilterCriteria{"myApp", expectedAssocId, []int32{MobilityStatus_INTERHOST_MOVEOUT_TRIGGERED}}
	expectedCallBackRef := "myCallbakRef"
	expectedLinkType := LinkType{"/" + testScenarioName + "/amsi/v1/subscriptions/" + strconv.Itoa(nextSubscriptionIdAvailable)}
	//expectedExpiry := TimeStamp{0, 1998599770}
@@ -1176,7 +1172,7 @@ func testSubscriptionMobilityProcedurePut(t *testing.T, subscriptionId string, e
	 ******************************/
	expectedAssocId1 := AssociateId{1, "2.2.2.2"}
	expectedAssocId := []AssociateId{expectedAssocId1}
	expectedFilter := MobilityProcedureSubscriptionFilterCriteria{"myApp", expectedAssocId, []MobilityStatus{MobilityStatus_INTERHOST_MOVEOUT_TRIGGERED}}
	expectedFilter := MobilityProcedureSubscriptionFilterCriteria{"myApp", expectedAssocId, []int32{MobilityStatus_INTERHOST_MOVEOUT_TRIGGERED}}
	expectedCallBackRef := "myCallbakRef"
	expectedLinkType := LinkType{"/" + testScenarioName + "/amsi/v1/subscriptions/" + subscriptionId}
	//expectedExpiry := TimeStamp{0, 1998599770}
+0 −34
Original line number 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 Application Mobility API
 *
 * Application Mobility Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC021 Application Mobility API](http://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.01.01_60/gs_MEC021v020101p.pdf) <p>[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-ams](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-ams) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about application mobility in the network <p>**Note**<br>AdvantEDGE supports all of Application Mobility 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 server

// AppMobilityServiceLevel : This attribute provides an option for the application instance (server) to communicate with the application client before relocating this application instance to another MEC host. Applicable values are: 1 = APP_MOBILITY_NOT_ALLOWED, 2 = APP_MOBILITY_WITH_CONFIRMATION, 3 = APP_MOBILITY_WITHOUT_CONFIRMATION.
type AppMobilityServiceLevel int32

// List of AppMobilityServiceLevel
const (
	AppMobilityServiceLevel_APP_MOBILITY_NOT_ALLOWED          AppMobilityServiceLevel = 1
	AppMobilityServiceLevel_APP_MOBILITY_WITH_CONFIRMATION    AppMobilityServiceLevel = 2
	AppMobilityServiceLevel_APP_MOBILITY_WITHOUT_CONFIRMATION AppMobilityServiceLevel = 3
)
Loading