Commit 7fbc85c5 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

update etsi mec sandbox mec 021 AMS back-end as per 3.1.1 AMS document version

parent 04c28b4a
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
openapi: 3.0.0
info:
  title: AdvantEDGE Application Mobility API
  version: '2.2.1'
  version: '3.1.1'
  description: 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.02.01_60/gs_MEC021v020201p.pdf)
    MEC ISG MEC021 Application Mobility API](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/03.01.01_60/gs_mec021v030101p.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
@@ -16,8 +16,8 @@ info:
    name: InterDigital AdvantEDGE Support
    email: AdvantEDGE@InterDigital.com
externalDocs:
  description: ETSI GS MEC 021 Application Mobility Service API, v2.2.1
  url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/02.02.01_60/gs_mec021v020201p.pdf
  description: ETSI GS MEC 021 Application Mobility Service API, v3.1.1
  url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/021/03.01.01_60/gs_mec021v030101p.pdf
servers:
- url: https://localhost/sandboxname/amsi/v1
  variables: {}
@@ -40,30 +40,30 @@ paths:
        explode: true
        schema:
          type: string
      - name: all_fields
      - name: All_fields
        in: query
        description: Include all complex attributes in the response.
        style: form
        explode: true
        schema:
          type: string
      - name: fields
      - name: Fields
        in: query
        description: Complex attributes to be included into the response. See clause 6.18 in ETSI GS MEC 009
        style: form
        explode: true
        schema:
          type: string
      - name: exclude_fields
      - name: Exclude_fields
        in: query
        description: Complex attributes to be excluded from the response.See clause 6.18 in ETSI GS MEC 009
        style: form
        explode: true
        schema:
          type: string
      - name: exclude_default
      - name: Exclude_default
        in: query
        description: Indicates to exclude the following complex attributes from the response  See clause 6.18 in ETSI GS MEC 011 for details.
        description: Indicates to exclude the following complex attributes from the response  See clause 6.18 in ETSI GS MEC 009 for details.
        style: form
        explode: true
        schema:
@@ -133,35 +133,35 @@ paths:
      parameters:
      - name: filter
        in: query
        description: Attribute-based filtering parameters according to ETSI GS MEC 011
        description: Attribute-based filtering parameters, according to ETSI GS MEC 009, use the format (op,attr,value)
        style: form
        explode: true
        schema:
          type: string
      - name: all_fields
      - name: All_fields
        in: query
        description: Include all complex attributes in the response.
        description: Include all complex attributes in the response. e.g., All_Fields.
        style: form
        explode: true
        schema:
          type: string
      - name: fields
      - name: Fields
        in: query
        description: Complex attributes to be included into the response. See clause 6.18 in ETSI GS MEC 011
        description: Complex attributes to be included in the response (see Clause 6.18 in ETSI GS MEC 009), e.g., att or att/subatt.
        style: form
        explode: true
        schema:
          type: string
      - name: exclude_fields
      - name: Exclude_fields
        in: query
        description: Complex attributes to be excluded from the response.See clause 6.18 in ETSI GS MEC 011
        description: Complex attributes to be excluded in the response (see Clause 6.18 in ETSI GS MEC 009), e.g., att or att/subatt.
        style: form
        explode: true
        schema:
          type: string
      - name: exclude_default
      - name: Exclude_default
        in: query
        description: Indicates to exclude the following complex attributes from the response  See clause 6.18 in ETSI GS MEC 011 for details.
        description: Indicates to exclude the following complex attributes from the response  See clause 6.18 in ETSI GS MEC 009 for details.
        style: form
        explode: true
        schema:
+19 −14
Original line number Diff line number Diff line
@@ -1495,7 +1495,7 @@ func appMobilityServiceGET(w http.ResponseWriter, r *http.Request) {
	// Validate query parameters
	u, _ := url.Parse(r.URL.String())
	q := u.Query()
	validParams := []string{"filter", "all_fields", "fields", "exclude_fields", "exclude_default"}
	validParams := []string{"filter", "All_fields", "Fields", "Exclude_fields", "Exclude_default"}
	err := validateQueryParams(q, validParams)
	if err != nil {
		print("Query Parameter error")
@@ -1504,11 +1504,11 @@ func appMobilityServiceGET(w http.ResponseWriter, r *http.Request) {
	}

	// Parse query parameters
	urlFilter := q.Get("Filter")
	urlAllFields := q.Get("all_fields")
	urlfields := q.Get("fields")
	urlExcludeFields := q.Get("exclude_fields")
	urlExcludeDefault := q.Get("exclude_default")
	urlFilter := q.Get("filter")
	urlAllFields := q.Get("All_fields")
	urlfields := q.Get("Fields")
	urlExcludeFields := q.Get("Exclude_fields")
	urlExcludeDefault := q.Get("Exclude_default")
	regInfoList := &RegisterationInfoList{
		Filters: &FilterParameters{
			filter:          urlFilter,
@@ -1562,9 +1562,7 @@ func populateRegInfoList(key string, jsonEntry string, response interface{}) err

		// Filter Paramter
		if data.Filters.filter != "" {

			filterField := data.Filters.filter
			fmt.Printf("Filter Field: %s", filterField)
			// Split filterField into operator, attribute, and value
			operator, attribute, value, _ := parseFilter(filterField)

@@ -1636,6 +1634,11 @@ func populateRegInfoList(key string, jsonEntry string, response interface{}) err

		}

		// Handle Fields Parameter (Include ALL fields)
		if data.Filters.all_fields != "" && data.Filters.all_fields != "All_fields" {
			return nil
		}

		// Handle Fields Parameter
		if data.Filters.fields != "" {
			fields := strings.Split(data.Filters.fields, ",")
@@ -1647,17 +1650,17 @@ func populateRegInfoList(key string, jsonEntry string, response interface{}) err
					filteredRegInfo.AppMobilityServiceId = regInfo.AppMobilityServiceId

				case "serviceConsumerId/appInstanceId":
					if filteredRegInfo.ServiceConsumerId == nil {
						filteredRegInfo.ServiceConsumerId = &RegistrationInfoServiceConsumerId{}
					}
					// if filteredRegInfo.ServiceConsumerId == nil {
					// 	filteredRegInfo.ServiceConsumerId = &RegistrationInfoServiceConsumerId{}
					// }
					if regInfo.ServiceConsumerId.AppInstanceId != "" {
						filteredRegInfo.ServiceConsumerId.AppInstanceId = regInfo.ServiceConsumerId.AppInstanceId
					}

				case "serviceConsumerId/mepId":
					if filteredRegInfo.ServiceConsumerId == nil {
						filteredRegInfo.ServiceConsumerId = &RegistrationInfoServiceConsumerId{}
					}
					// if filteredRegInfo.ServiceConsumerId == nil {
					// 	filteredRegInfo.ServiceConsumerId = &RegistrationInfoServiceConsumerId{}
					// }
					if regInfo.ServiceConsumerId.MepId != "" {
						filteredRegInfo.ServiceConsumerId.MepId = regInfo.ServiceConsumerId.MepId
					}
@@ -1744,6 +1747,8 @@ func populateRegInfoList(key string, jsonEntry string, response interface{}) err
			regInfo = filteredRegInfo
		}

		// Handle Exclude Fields default Parameter (Exclude specified fields)

	}
	// Returning Data
	data.Registrations = append(data.Registrations, regInfo)
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
 *
 * 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.02.01_60/gs_MEC021v020201p.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 a selected subset of Application Mobility API endpoints (see below).
 *
 * API version: 2.2.1
 * API version: 3.1.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
 *
 * 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.02.01_60/gs_MEC021v020201p.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 a selected subset of Application Mobility API endpoints (see below).
 *
 * API version: 2.2.1
 * API version: 3.1.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */
+1 −0
Original line number Diff line number Diff line
package server
Loading