diff --git a/charts/meep-app-enablement/values-template.yaml b/charts/meep-app-enablement/values-template.yaml index f279333aca2c3e698c135fe9075067fa34de18e1..3ab14ee01d51ab8a9db9c3a1a871c7f1175d0c9f 100644 --- a/charts/meep-app-enablement/values-template.yaml +++ b/charts/meep-app-enablement/values-template.yaml @@ -49,12 +49,19 @@ ingress: - /{{.SandboxName}}/{{.MepName}}/service-apis - /{{.SandboxName}}/{{.MepName}}/published-apis - /{{.SandboxName}}/{{.MepName}}/capif-events + - /{{.SandboxName}}/{{.MepName}}/eecs-serviceprovisioning + - /{{.SandboxName}}/{{.MepName}}/eees-eecregistration + - /{{.SandboxName}}/{{.MepName}}/eees-easdiscovery + {{- else }} - /{{.SandboxName}}/mec_app_support - /{{.SandboxName}}/mec_service_mgmt - /{{.SandboxName}}/service-apis - /{{.SandboxName}}/published-apis - /{{.SandboxName}}/capif-events + - /{{.SandboxName}}/eecs-serviceprovisioning + - /{{.SandboxName}}/eees-eecregistration + - /{{.SandboxName}}/eees-easdiscovery {{- end }} annotations: kubernetes.io/ingress.class: nginx @@ -66,6 +73,9 @@ ingress: rewrite ^/{{ .SandboxName }}/{{.MepName}}/service-apis(/|$)(.*)$ /service-apis/$2 break; rewrite ^/{{ .SandboxName }}/{{.MepName}}/published-apis(/|$)(.*)$ /published-apis/$2 break; rewrite ^/{{ .SandboxName }}/{{.MepName}}/capif-events(/|$)(.*)$ /capif-events/$2 break; + rewrite ^/{{ .SandboxName }}/{{.MepName}}/eecs-serviceprovisioning(/|$)(.*)$ /eecs-serviceprovisioning/$2 break; + rewrite ^/{{ .SandboxName }}/{{.MepName}}/eees-eecregistration(/|$)(.*)$ /eees-eecregistration/$2 break; + rewrite ^/{{ .SandboxName }}/{{.MepName}}/eees-easdiscovery(/|$)(.*)$ /eees-easdiscovery/$2 break; {{- else }} nginx.ingress.kubernetes.io/configuration-snippet: | rewrite ^/{{ .SandboxName }}/mec_app_support(/|$)(.*)$ /mec_app_support/$2 break; @@ -73,6 +83,9 @@ ingress: rewrite ^/{{ .SandboxName }}/service-apis(/|$)(.*)$ /service-apis/$2 break; rewrite ^/{{ .SandboxName }}/published-apis(/|$)(.*)$ /published-apis/$2 break; rewrite ^/{{ .SandboxName }}/capif-events(/|$)(.*)$ /capif-events/$2 break; + rewrite ^/{{ .SandboxName }}/eecs-serviceprovisioning(/|$)(.*)$ /eecs-serviceprovisioning/$2 break; + rewrite ^/{{ .SandboxName }}/eees-eecregistration(/|$)(.*)$ /eees-eecregistration/$2 break; + rewrite ^/{{ .SandboxName }}/eees-easdiscovery(/|$)(.*)$ /eees-easdiscovery/$2 break; {{- end }} {{- if .AuthEnabled }} nginx.ingress.kubernetes.io/auth-url: https://$http_host/auth/v1/authenticate?svc=meep-app-enablement&sbox={{.SandboxName}}&mep={{.MepName}} diff --git a/go-apps/meep-app-enablement/api/app-support/swagger.yaml b/go-apps/meep-app-enablement/api/app-support/swagger.yaml index fb7bb25dd0d093ab345959e2a8a5e9bc7940332a..a359f5ed5510426771027e1d7916c47dcf9dfdbb 100644 --- a/go-apps/meep-app-enablement/api/app-support/swagger.yaml +++ b/go-apps/meep-app-enablement/api/app-support/swagger.yaml @@ -23,6 +23,7 @@ servers: tags: - name: mec_app_support - name: unsupported + - name: Service Provisioning, EEC Registration, and ECS Discovery - name: callbacks paths: /applications/{appInstanceId}/traffic_rules: @@ -1067,9 +1068,9 @@ paths: - mec_app_support summary: Register the MEC application instance to the MEC platform description: >- - The POST method may be used by the MEC application instance to request its registration to the MEC platform. + The POST method may be used by the MEC application instance to request its registration to the MEC platform. operationId: ApplicationsRegistrations_POST - parameters: [] + parameters: [] requestBody: description: >- The message content in the request contains the profile of the MEC application instance, calling the MEC platform to register the MEC application instance. @@ -1077,7 +1078,96 @@ paths: application/json: schema: $ref: '#/components/schemas/AppInfo' - required: false + example: + appName: "appName" + appProvider: "appProvider1" + appCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + appDId: "TODO" + appInstanceId: "ID1" + endpoint: + uris: + - "mecAppSuptApi/example" + appServiceRequired: + - requestedPermissions: "string" + serCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + serName: "string" + serTransportDependencies: + - labels: + - "string" + serializers: + - "JSON" + transport: + protocol: "string" + security: + oAuth2Info: + grantTypes: + - "OAUTH2_CLIENT_CREDENTIALS" + tokenEndpoint: "/mecSerMgmtApi/security/TokenEndPoint" + type: "REST_HTTP" + version: "string" + version: "string" + appServiceOptional: + - requestedPermissions: "string" + serCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + serName: "string" + serTransportDependencies: + - labels: + - "string" + serializers: + - "JSON" + transport: + protocol: "string" + security: + oAuth2Info: + grantTypes: + - "OAUTH2_CLIENT_CREDENTIALS" + tokenEndpoint: "/mecSerMgmtApi/security/TokenEndPoint" + type: "REST_HTTP" + version: "string" + version: "string" + appFeatureRequired: + - featureName: "string" + version: "string" + appFeatureOptional: + - featureName: "string" + version: "string" + isInsByMec: false + appProfile: + easId: "appName" + endPt: + uris: + - "string" + acIds: + - "string" + provId: "appProvider1" + type: "string" + scheds: + - "string" + svcArea: "string" + svcKpi: "string" + permLvl: + - "string" + easFeats: + - "string" + svcContSupp: + - "string" + appLocs: + - "string" + avlRep: 1577836800 + status: "string" + required: true responses: '201': description: >- @@ -1097,7 +1187,6 @@ paths: '400': description: >- Bad Request. It is used to indicate that incorrect parameters were passed to the request. - headers: {} content: application/problem+json: schema: @@ -1109,7 +1198,6 @@ paths: '401': description: >- Unauthorized. It is used when the client did not submit the appropriate credentials. - headers: {} content: application/problem+json: schema: @@ -1121,15 +1209,13 @@ paths: '403': description: >- Forbidden. The operation is not allowed given the current status of the resource. - headers: {} content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: >- - Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI. - headers: {} + Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI. content: application/problem+json: schema: @@ -1138,8 +1224,7 @@ paths: schema: type: object description: Empty schema - deprecated: false - parameters: [] + deprecated: false /registrations/{appInstanceId}: get: tags: @@ -1222,6 +1307,95 @@ paths: application/json: schema: $ref: '#/components/schemas/AppInfo' + example: + appName: "appName" + appProvider: "appProvider1" + appCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + appDId: "TODO" + appInstanceId: "ID1" + endpoint: + uris: + - "mecAppSuptApi/example" + appServiceRequired: + - requestedPermissions: "string" + serCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + serName: "string" + serTransportDependencies: + - labels: + - "string" + serializers: + - "JSON" + transport: + protocol: "string" + security: + oAuth2Info: + grantTypes: + - "OAUTH2_CLIENT_CREDENTIALS" + tokenEndpoint: "/mecSerMgmtApi/security/TokenEndPoint" + type: "REST_HTTP" + version: "string" + version: "string" + appServiceOptional: + - requestedPermissions: "string" + serCategory: + href: "/example/catalogue1" + id: "id12345" + name: "RNI" + version: "version1" + serName: "string" + serTransportDependencies: + - labels: + - "string" + serializers: + - "JSON" + transport: + protocol: "string" + security: + oAuth2Info: + grantTypes: + - "OAUTH2_CLIENT_CREDENTIALS" + tokenEndpoint: "/mecSerMgmtApi/security/TokenEndPoint" + type: "REST_HTTP" + version: "string" + version: "string" + appFeatureRequired: + - featureName: "string" + version: "string" + appFeatureOptional: + - featureName: "string" + version: "string" + isInsByMec: false + appProfile: + easId: "appName" + endPt: + uris: + - "string" + acIds: + - "string" + provId: "appProvider1" + type: "string" + scheds: + - "string" + svcArea: "string" + svcKpi: "string" + permLvl: + - "string" + easFeats: + - "string" + svcContSupp: + - "string" + appLocs: + - "string" + avlRep: 1577836800 + status: "string" required: true responses: '204': @@ -1340,6 +1514,490 @@ paths: description: Empty schema deprecated: false parameters: [] + + /request: + post: + summary: Request service provisioning information. + operationId: RequestServProv + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + eecId: + type: string + example: "string" + ueId: + type: string + example: "string" + acProfs: + type: array + items: + type: object + properties: + acId: + type: string + example: "string" + acType: + type: string + example: "string" + eecSvcContSupp: + type: array + items: + type: string + enum: + - EEC_INITIATED + - EEC_EXECUTED_VIA_SOURCE_EES + example: ["EEC_INITIATED", "EEC_EXECUTED_VIA_SOURCE_EES"] + locInf: + type: object + properties: + geographicArea: + type: object + properties: + point: + type: object + properties: + point: + type: object + properties: + lon: + type: number + format: float + example: 7.4200 + lat: + type: number + format: float + example: 43.7356 + shape: + type: string + example: "POINT" + required: + - eecId + responses: + '200': + description: > + OK (The requested service provisioning information was returned successfully). + content: + application/json: + schema: + $ref: '#/components/schemas/ECSServProvResp' + "204": + description: Successful response sent when there is no need to provide a + new liveness interval value to the service Instance. + content: {} + "400": + description: "It is used to indicate that incorrect parameters were passed\ + \ to the request. In the returned ProblemDetails structure, the \"detail\"\ + \ attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: The operation is not allowed given the current status of the + resource. More information shall be provided in the "detail" attribute + of the "ProblemDetails" structure. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "It is used when a client provided a URI that cannot be mapped\ + \ to a valid resource URI. In the returned ProblemDetails structure, the\ + \ \"detail\" attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "409": + description: The operation is not allowed due to a conflict with the state + of the resource. The MEC platform shall respond with this code if the + service instance is in "INACTIVE" state. More information shall be provided + in the "detail" attribute of the "ProblemDetails" structure. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "It is used when a condition has failed during conditional\ + \ requests, e.g. when using ETags to avoid write conflicts. In the returned\ + \ ProblemDetails structure, the \"detail\" attribute should convey more\ + \ information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + servers: + - url: https://localhost/sandboxname/eecs-serviceprovisioning/v1 + + /registration: + post: + operationId: CreateEECReg + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + description: Create a new EEC registration at the EES. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + eecId: + type: string + example: "string" + ueId: + type: string + example: "ue-67890" + acProfs: + type: array + items: + type: object + properties: + acId: + type: string + example: "string" + acType: + type: string + example: "string" + expTime: + type: string + format: date-time + example: "2025-01-31T15:04:05Z" + eecSvcContSupp: + type: array + items: + type: string + enum: + - EEC_INITIATED + - SOURCE_EAS_DECIDED + example: ["EEC_INITIATED", "SOURCE_EAS_DECIDED"] + eecCntxId: + type: string + example: "string" + srcEesId: + type: string + example: "mep1" + endPt: + type: object + properties: + uri: + type: string + example: "http://172.30.225.7/sbx2cmq8bn/mep1" + ueMobilityReq: + type: boolean + example: true + easSelReqInd: + type: boolean + example: false + ueType: + type: string + example: "NORMAL_UE" + required: + - eecId + responses: + '201': + description: Created (EEC information is registered successfully at EES). + content: + application/json: + schema: + type: object + properties: + RegistrationID: + type: string + description: Identifier of the EEC registration. + ExpirationTime: + type: string + format: date-time + description: Expiration time of the registration. + EECContextID: + type: string + description: Identifier of the EEC context information available at the EES. + EECContextRelocationStatus: + type: boolean + description: Indicates whether the EEC context retrieval from the source EES was successful. + DiscoveredEASList: + type: array + items: + $ref: '#/components/schemas/EASProfile' + "204": + description: Successful response sent when there is no need to provide a + new liveness interval value to the service Instance. + content: {} + "400": + description: "It is used to indicate that incorrect parameters were passed\ + \ to the request. In the returned ProblemDetails structure, the \"detail\"\ + \ attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: The operation is not allowed given the current status of the + resource. More information shall be provided in the "detail" attribute + of the "ProblemDetails" structure. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "It is used when a client provided a URI that cannot be mapped\ + \ to a valid resource URI. In the returned ProblemDetails structure, the\ + \ \"detail\" attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "409": + description: The operation is not allowed due to a conflict with the state + of the resource. The MEC platform shall respond with this code if the + service instance is in "INACTIVE" state. More information shall be provided + in the "detail" attribute of the "ProblemDetails" structure. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "412": + description: "It is used when a condition has failed during conditional\ + \ requests, e.g. when using ETags to avoid write conflicts. In the returned\ + \ ProblemDetails structure, the \"detail\" attribute should convey more\ + \ information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + servers: + - url: https://localhost/sandboxname/eees-eecregistration/v1 + + /registrations/{registrationId}: + get: + summary: Retrieve EEC Registration Details + operationId: getRegistrationDetails + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + parameters: + - name: registrationId + in: path + description: Identifies an individual EEC registration. + required: true + schema: + type: string + responses: + '200': + description: Successful retrieval of EEC registration details. + content: + application/json: + schema: + type: object + properties: + RegistrationID: + type: string + description: Identifier of the EEC registration. + ExpirationTime: + type: string + format: date-time + description: Expiration time of the registration. + EECContextID: + type: string + description: Identifier of the EEC context information available at the EES. + EECContextRelocationStatus: + type: boolean + description: Indicates whether the EEC context retrieval from the source EES was successful. + DiscoveredEASList: + type: array + items: + $ref: '#/components/schemas/EASProfile' + '404': + description: EEC registration not found. + '400': + description: Invalid registration ID supplied. + '500': + description: Internal server error. + put: + summary: EEC Registration Update Request via PUT + operationId: updateRegistrationPut + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + parameters: + - name: registrationId + in: path + description: Identifies an individual EEC registration. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + acProfs: + type: array + items: + $ref: '#/components/schemas/ACProfile' + description: Profiles of ACs for which the EEC provides edge enabling services. + expTime: + $ref: '#/components/schemas/DateTime' + ueMobilityReq: + type: boolean + description: > + Set to true to indicate that UE Mobility support is required. + Set to false to indicate that UE mobility support is not required. + The default value when omitted is false. + responses: + "200": + description: Successful registration update response via PUT + content: + application/json: + schema: + type: object + properties: + expirationTime: + type: string + format: date-time + description: Expiration time of the registration. + unfulfilledACInfo: + type: array + description: List of unfulfilled AC information. + items: + type: object + properties: + acid: + type: string + description: Application Identifier. + reason: + type: string + description: Reason indicating the cause (e.g., EAS not available). + "204": + description: Successful response sent when there is no need to provide a + new liveness interval value to the service Instance. + content: {} + "400": + description: "It is used to indicate that incorrect parameters were passed\ + \ to the request. In the returned ProblemDetails structure, the \"detail\"\ + \ attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "403": + description: The operation is not allowed given the current status of the + resource. More information shall be provided in the "detail" attribute + of the "ProblemDetails" structure. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + "404": + description: "It is used when a client provided a URI that cannot be mapped\ + \ to a valid resource URI. In the returned ProblemDetails structure, the\ + \ \"detail\" attribute should convey more information about the error." + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + + delete: + operationId: DeleteIndEECReg + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + description: Remove an existing EEC registration at EES. + parameters: + - name: registrationId + in: path + description: Identifies an individual EEC registration. + required: true + schema: + type: string + responses: + '204': + description: > + No Content (An individual EEC registration resource deleted successfully). + servers: + - url: https://localhost/sandboxname/eees-eecregistration/v1 + + /eas-profiles/request-discovery: + post: + description: > + Provides EAS information requested by the service consumer (i.e. EEC, EAS or EES). + operationId: GetEASDiscInfo + tags: + - Service Provisioning, EEC Registration, and ECS Discovery + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + requestorId: + type: object + properties: + eesId: + type: string + example: "string" + easId: + type: string + example: "string" + eecId: + type: string + example: "string" + oneOf: + - required: ["eesId"] + - required: ["easId"] + - required: ["eecId"] + ueId: + type: string + example: "string" + easDiscoveryFilter: + type: object + properties: + acChars: + type: array + items: + type: object + properties: + acProf: + type: object + properties: + acId: + type: string + example: "string" + acType: + type: string + example: "string" + eecSvcContinuity: + type: array + items: + type: string + example: ["EEC_INITIATED", "string"] + locInf: + type: object + description: "Location information. Define properties as required." + example: {} + predictExpTime: + type: string + format: date-time + example: "2025-02-04T09:49:01.348Z" + required: + - requestorId + responses: + '200': + description: > + OK (The requested EAS discovery information was returned successfully). + content: + application/json: + schema: + $ref: '#/components/schemas/EasDiscoveryResp' + + servers: + - url: https://localhost/sandboxname/eees-easdiscovery/v1 /timing/timing_caps: get: tags: @@ -1446,6 +2104,685 @@ paths: parameters: [] components: schemas: + EasDiscoveryResp: + description: EAS discovery response. + type: object + properties: + discoveredEas: + type: array + items: + $ref: '#/components/schemas/DiscoveredEas' + description: List of EAS discovery information. + required: + - discoveredEas + DiscoveredEas: + description: Represents an EAS discovery information. + type: object + properties: + eas: + $ref: '#/components/schemas/EASProfile' + eesEndPt: + $ref: '#/components/schemas/EndPoint' + lifeTime: + $ref: '#/components/schemas/DateTime' + required: + - eas + EasDiscoveryReq: + description: EAS discovery request information. + type: object + properties: + requestorId: + $ref: '#/components/schemas/RequestorId' + ueId: + $ref: '#/components/schemas/Gpsi' + easDiscoveryFilter: + $ref: '#/components/schemas/EasDiscoveryFilter' + eecSvcContinuity: + type: array + items: + $ref: '#/components/schemas/ACRScenario' + description: > + Indicates if the EEC supports service continuity or not, also indicates which ACR + scenarios are supported by the EEC. + eesSvcContinuity: + type: array + items: + $ref: '#/components/schemas/ACRScenario' + description: > + Indicates if the EES supports service continuity or not, also indicates which ACR + scenarios are supported by the EES. + easSvcContinuity: + type: array + items: + $ref: '#/components/schemas/ACRScenario' + description: > + Indicates if the EAS supports service continuity or not, also indicates which ACR + scenarios are supported by the EAS. + locInf: + $ref: '#/components/schemas/LocationInfo' + easSelSupInd: + type: boolean + description: > + Indicates if the EEC requires the EAS selection support from the EES (e.g., for + constrained device). The default value false indicates the EAS selection is not + required from the EES. + suppFeat: + $ref: '#/components/schemas/SupportedFeatures' + easIntTrigSup: + type: boolean + description: > + Indicates to the EES whether the EAS instantiation triggering should be performed for + the current request. The default value false indicates the EAS instantiation triggering + should not be performed. The true value indicate the EAS instantiation triggering should + be performed. + predictExpTime: + $ref: '#/components/schemas/DateTime' + required: + - requestorId + + EasDiscoveryFilter: + description: Represents the EAS characteristics. + type: object + properties: + acChars: + type: array + items: + $ref: '#/components/schemas/ACCharacteristics' + minItems: 1 + description: AC description for which an EAS is needed. + ACCharacteristics: + description: Represents EAS dynamic information changes filter. + type: object + properties: + acProf: + $ref: '#/components/schemas/ACProfile' + required: + - acProf + RequestorId: + description: Represents identifier of the requestor. + type: object + properties: + eesId: + type: string + description: The identifier of the EES (e.g. S-EES). + easId: + type: string + description: The application identifier of the EAS (e.g. S-EAS), e.g. FQDN, URI. + eecId: + type: string + description: The identifier of the EEC. + oneOf: + - required: [eesId] + - required: [easId] + - required: [eecId] + + EASProfile: + type: object + required: + - easId + - endPt + - acIds + - scheds + - permLvl + - easFeats + - svcContSupp + - appLocs + properties: + easId: + description: The identifier of the EAS + type: string + example: + appName + endPt: + $ref: '#/components/schemas/EndPoint' + acIds: + type: array + items: + type: string + minItems: 1 + description: Identities of the Application Clients that can be served by the EAS + provId: + type: string + description: Identifier of the ASP that provides the EAS. + example: + appProvider1 + type: + description: The category or type of EAS. + type: string + scheds: + type: array + items: + type: string + minItems: 1 + description: The availability schedule of the EAS. + svcArea: + type: string + description: >- + The list of geographical and topological areas that the EAS serves. ACs in the UE that are outside the area will not be served. + svcKpi: + type: string + description: Service characteristics provided by the EAS. + permLvl: + type: array + items: + type: string + minItems: 1 + description: level of service permissions supported by the EAS. + easFeats: + type: array + items: + type: string + minItems: 1 + description: Service features supported by the EAS. + svcContSupp: + type: array + items: + type: string + minItems: 1 + description: The ACR scenarios supported by the EAS for service continuity. + appLocs: + type: array + items: + type: string + minItems: 1 + description: >- + List of DNAI(s) and the N6 traffic information associated with the EAS. + avlRep: + type: integer + description: >- + The period indicating to the EES, how often the EES needs to check the EAS's availability after a successful registration. + example: + 1577836800 + status: + type: string + description: 'EAS status information. ' + + EECRegistration: + description: Describes the parameters to perform EEC Registration related operations. + type: object + properties: + eecId: + type: string + description: Represents a unique identifier of the EEC. + ueId: + $ref: '#/components/schemas/Gpsi' + acProfs: + type: array + items: + $ref: '#/components/schemas/ACProfile' + description: Profiles of ACs for which the EEC provides edge enabling services. + expTime: + $ref: '#/components/schemas/DateTime' + eecSvcContSupp: + type: array + items: + $ref: '#/components/schemas/ACRScenario' + description: Profiles of ACs for which the EEC provides edge enabling services. + eecCntxId: + type: string + description: Identifier of the EEC context obtained from a previous registration. + srcEesId: + type: string + description: Identifier of the EES that provided EEC context ID. + endPt: + $ref: '#/components/schemas/EndPoint' + ueMobilityReq: + type: boolean + description: > + Set to true to indicate that UE Mobility support is required. + Set to false to indicate that UE mobility support is not required. + The default value when omitted is false. + easSelReqInd: + type: boolean + description: > + Set to true to indicate the EES support for EAS selection. + Set to false to indicate the EES shall not select the EAS. + The default value when omitted is false. + ueType: + $ref: '#/components/schemas/DeviceType' + required: + - eecId + DeviceType: + anyOf: + - type: string + enum: + - CONSTRAINED_UE + - NORMAL_UE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration and is not used to encode + content defined in the present version of this API. + description: > + Represents the UE type. + Possible values are: + - CONSTRAINED_UE: Indicates UE is constrained with resources like power, processor etc. + - NORMAL_UE: Indicates UE is not constrained with resources. + ECSServProvReq: + description: ECS service provisioning request information. + type: object + properties: + eecId: + type: string + description: Represents a unique identifier of the EEC. + ueId: + $ref: '#/components/schemas/Gpsi' + acProfs: + type: array + items: + $ref: '#/components/schemas/ACProfile' + description: Information about services the EEC wants to connect to. + appInfo: + type: array + items: + $ref: '#/components/schemas/ApplicationInfo' + minItems: 1 + description: Information about the list of services the EEC wants to connect. + eecSvcContSupp: + type: array + items: + $ref: '#/components/schemas/ACRScenario' + description: > + Indicates if the EEC supports service continuity or not, also indicates which + ACR scenarios are supported by the EEC. + locInf: + $ref: '#/components/schemas/LocationInfo' + ecspIds: + type: array + items: + type: string + minItems: 1 + description: Indicates to the ECS which EES providers are preferred by the EEC. + suppFeat: + $ref: '#/components/schemas/SupportedFeatures' + required: + - eecId + + ECSServProvResp: + description: ECS service provisioning response information. + type: object + properties: + ednCnfgInfo: + type: array + items: + $ref: '#/components/schemas/EDNConfigInfo' + minItems: 1 + description: List of EDN configuration information. + required: + - ednCnfgInfo + + SupportedFeatures: + type: string + pattern: '^[A-Fa-f0-9]*$' + description: > + A string used to indicate the features supported by an API that is used as defined in clause + 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in + hexadecimal representation Each character in the string shall take a value of "0" to "9", + "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in + table 5.2.2-3. The most significant character representing the highest-numbered features + shall appear first in the string, and the character representing features 1 to 4 + shall appear last in the string. The list of features and their numbering (starting with 1) + are defined separately for each API. If the string contains a lower number of characters + than there are defined features for an API, all features that would be represented by + characters that are not present in the string are not supported. + + LocationInfo: + description: Represents the user location information. + type: object + properties: + geographicArea: + $ref: '#/components/schemas/GeographicArea' + + GeographicArea: + description: Geographic area specified by different shape. + anyOf: + - $ref: '#/components/schemas/Point' + Point: + description: Ellipsoid Point. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + GeographicalCoordinates: + description: Geographical coordinates. + type: object + required: + - lon + - lat + properties: + lon: + type: number + format: double + minimum: -180 + maximum: 180 + lat: + type: number + format: double + minimum: -90 + maximum: 90 + GADShape: + description: Common base type for GAD shapes. + type: object + required: + - shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + SupportedGADShapes: + description: Indicates supported GAD shapes. + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + - DISTANCE_DIRECTION + - RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE + - RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID + - type: string + + Gpsi: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + description: > + String identifying a Gpsi shall contain either an External Id or an MSISDN. + It shall be formatted as follows -External Identifier= "extid-'extid', where 'extid' + shall be formatted according to clause 19.7.2 of 3GPP TS 23.003 that describes an + External Identifier. + + + ACProfile: + description: AC information indicating required services and service characteristics. + type: object + properties: + acId: + type: string + description: Identity of the AC. + acType: + type: string + description: The category or type of AC. + prefEcsps: + type: array + items: + type: string + description: Indicates to the ECS which ECSPs are preferred for the AC. + simInactTime: + $ref: '#/components/schemas/DurationSec' + eass: + type: array + items: + $ref: '#/components/schemas/EasDetail' + minItems: 1 + description: List of EAS information. + # easBundleInfos: + # type: array + # items: + # $ref: 'TS29558_Eees_EASRegistration.yaml#/components/schemas/EASBundleInfo' + # minItems: 1 + # description: > + # List of EAS bundles to which the EAS (identified via the "easId" attribute) belongs. + required: + - acId + + EasDetail: + description: EAS details. + type: object + properties: + easId: + type: string + description: Application identifier of the EAS. + required: + - easId + + DurationSec: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds. + + + ApplicationInfo: + description: Represents the services the EEC wants to connect. + type: object + properties: + acProf: + $ref: '#/components/schemas/ACProfile' + appGroupProfile: + $ref: '#/components/schemas/AppGroupProfile' + required: + - acProf + + ACRScenario: + anyOf: + - type: string + enum: + - EEC_INITIATED + - EEC_EXECUTED_VIA_SOURCE_EES + - EEC_EXECUTED_VIA_TARGET_EES + - SOURCE_EAS_DECIDED + - SOURCE_EES_EXECUTED + - EEL_MANAGED_ACR + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Represents the ACR scenarios supported by EES. + Possible values are: + - EEC_INITIATED: Represents the EEC initiated ACR scenario. + - EEC_EXECUTED_VIA_SOURCE_EES: Represents the EEC ACR scenario executed via the S-EES. + - EEC_EXECUTED_VIA_TARGET_EES: Represents the EEC ACR scenario executed via the T-EES. + - SOURCE_EAS_DECIDED: Represents the EEC ACR scenario where the S-EAS decides to perform + ACR. + - SOURCE_EES_EXECUTED: Represents the EEC ACR scenario where S-EES executes the ACR. + - EEL_MANAGED_ACR: Represents the EEC ACR scenario where the ACR is managed by the + Edge Enabler Layer. + AppGroupProfile: + description: Represents the application group profile for common EAS. + type: object + properties: + appGrpId: + type: string + description: Represents the application group that uniquely identifies + the group of UEs using the same application. + easId: + type: string + description: Represents the application identifier of the EAS. + required: + - appGrpId + - easId + + EDNConfigInfo: + description: Represents the EDN configuration information. + type: object + properties: + ednConInfo: + $ref: '#/components/schemas/EDNConInfo' + eess: + type: array + items: + $ref: '#/components/schemas/EESInfo' + minItems: 1 + description: Contains the list of EESs of the EDN. + lifeTime: + $ref: '#/components/schemas/DateTime' + required: + - ednConInfo + - eess + + + EDNConInfo: + description: Represents an EDN connection information. + type: object + properties: + dnn: + $ref: '#/components/schemas/Dnn' + # snssai: + # $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + # ednTopoSrvArea: + # $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + + Dnn: + type: string + description: > + String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; + it shall contain either a DNN Network Identifier, or a full DNN with both the Network + Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 and 9.1.2. + It shall be coded as string in which the labels are separated by dots + (e.g. "Label1.Label2.Label3"). + + DateTime: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI. + + + EESInfo: + description: Represents EES information. + type: object + properties: + eesId: + type: string + description: Identity of the EES. + endPt: + $ref: '#/components/schemas/EndPoint' + easIds: + type: array + items: + type: string + description: > + Application identities of the Edge Application Servers registered + with the EES. + eecRegConf: + type: boolean + description: > + Indicates whether the EEC is required to register on the EES to use edge services + or not. + required: + - eesId + - eecRegConf + Fqdn: + description: Fully Qualified Domain Name + type: string + pattern: '^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$' + minLength: 4 + maxLength: 253 + + Ipv6Addr: + type: string + description: > + string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. + The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + Uri: + type: string + description: string providing an URI formatted according to IETF RFC 3986. + Ipv4Addr: + type: string + description: > + string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in + IETF RFC 1166. + EndPoint: + type: object + description: The end point information to reach EAS. + properties: + fqdn: + $ref: '#/components/schemas/Fqdn' + ipv4Addrs: + type: array + items: + $ref: '#/components/schemas/Ipv4Addr' + minItems: 1 + description: IPv4 addresses of the edge server. + ipv6Addrs: + type: array + items: + $ref: '#/components/schemas/Ipv6Addr' + minItems: 1 + description: IPv6 addresses of the edge server. + uri: + $ref: '#/components/schemas/Uri' + oneOf: + - required: [uri] + - required: [fqdn] + - required: [ipv4Addrs] + - required: [ipv6Addrs] + + InvalidParam: + description: > + Represents the description of invalid parameters, for a request rejected due to invalid + parameters. + type: object + properties: + param: + type: string + description: Attribute's name encoded as a JSON Pointer, or header's name. + reason: + type: string + description: A human-readable reason, e.g. "must be a positive integer". + required: + - param + + # EASBundleDetail: + # description: Represents details of EAS Bundle. + # type: object + # properties: + # easId: + # type: string + # description: > + # Application identity of the Edge Application Servers registered with the EES. + # easBundleInfos: + # type: array + # items: + # $ref: 'TS29558_Eees_EASRegistration.yaml#/components/schemas/EASBundleInfo' + # minItems: 1 + # description: List of EAS bundles to which the EAS belongs. + # required: + # - easId + # - easBundleInfos + EesAuthMethod: + anyOf: + - type: string + enum: + - TLS_CLIENT_SERVER_CERTIFICATE + - TLS_WITH_AKMA + - TLS_WITH_GBA + - SERVER_SIDE_CERTIFICATE_BASED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration and is not used to encode + content defined in the present version of this API. + description: | + Represents the Authentication methods supported by EES. + Possible values are: + - TLS_CLIENT_SERVER_CERTIFICATE: Represents TLS with client server certificate + authentication. + - TLS_WITH_AKMA: Represents TLS with AKMA authentication. + - TLS_WITH_GBA: Represents TLS with GBA authentication. + - SERVER_SIDE_CERTIFICATE_BASED: Represents server side certification only. + AppReadyConfirmation: title: AppReadyConfirmation required: diff --git a/go-apps/meep-app-enablement/server/app-support/api_mec_app_support.go b/go-apps/meep-app-enablement/server/app-support/api_mec_app_support.go index 1480ebf7bbe74fbbdfda29ec27b0b2272720953c..ee3afe97181a986c67a77893d42a6fff0d1a87e0 100644 --- a/go-apps/meep-app-enablement/server/app-support/api_mec_app_support.go +++ b/go-apps/meep-app-enablement/server/app-support/api_mec_app_support.go @@ -59,6 +59,29 @@ func TimingCurrentTimeGET(w http.ResponseWriter, r *http.Request) { timingCurrentTimeGET(w, r) } +func GetEASDiscInfo(w http.ResponseWriter, r *http.Request) { + getEASDiscInfo(w, r) +} + +func RequestServProv(w http.ResponseWriter, r *http.Request) { + requestServProv(w, r) +} + +func DeleteIndEECReg(w http.ResponseWriter, r *http.Request) { + deleteIndEECReg(w, r) +} + +func CreateEECReg(w http.ResponseWriter, r *http.Request) { + createEECReg(w, r) +} + +func UpdateRegistrationPut(w http.ResponseWriter, r *http.Request) { + updateRegistrationPut(w, r) +} +func GetRegistration(w http.ResponseWriter, r *http.Request) { + getRegistration(w, r) +} + func AppRegistrationPOST(w http.ResponseWriter, r *http.Request) { appRegistrationPOST(w, r) } diff --git a/go-apps/meep-app-enablement/server/app-support/app-support.go b/go-apps/meep-app-enablement/server/app-support/app-support.go index e4f2ca46dab4a6b022b2e830efc536c35ee433de..6b047a5bf8a1d8eb82fd6d320e8b5fb4a9b203cb 100644 --- a/go-apps/meep-app-enablement/server/app-support/app-support.go +++ b/go-apps/meep-app-enablement/server/app-support/app-support.go @@ -24,6 +24,7 @@ import ( "net/url" "reflect" "strconv" + "strings" "sync" "time" @@ -34,6 +35,7 @@ import ( mq "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mq" redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis" subs "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions" + "github.com/google/uuid" "github.com/gorilla/mux" ) @@ -127,7 +129,12 @@ func Init(sandbox string, mep string, host *url.URL, msgQueue *mq.MsgQueue, redi return err } log.Info("Connected to Application Store") - + // Populate ECS Configuration + err = setupECSConfiguration() + if err != nil { + log.Error("Failed to set up ECS configuration: ", err) + return err + } // Create Subscription Manager subMgrCfg := &subs.SubscriptionMgrCfg{ Module: moduleName, @@ -647,6 +654,739 @@ func timingCurrentTimeGET(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, string(jsonResponse)) } +// setupECSConfiguration stores the mandatory ECS configuration in Redis. +// It uses the hostUrl as the ECS address and returns an error if any step fails. +func setupECSConfiguration() error { + // Create a map containing the mandatory ECS configuration + ecsConfig := map[string]interface{}{ + "ECSAddress": hostUrl.String(), // Use the MEC Sandbox URL as the ECS Address + } + + // Convert the ECS configuration to JSON + ecsConfigJson, err := json.Marshal(ecsConfig) + if err != nil { + log.Error("setupECSConfiguration: failed to marshal ECS configuration", "error", err.Error()) + return fmt.Errorf("failed to marshal ECS configuration: %v", err) + } + + // Convert JSON bytes to a string for storage + ecsConfigJsonStr := string(ecsConfigJson) + + // Define the Redis key and store the JSON configuration in Redis + ecsKey := baseKey + "ecs:config" + err = rc.JSONSetEntry(ecsKey, ".", ecsConfigJsonStr) + if err != nil { + log.Error("setupECSConfiguration: failed to set ECS configuration in Redis", "error", err.Error()) + return fmt.Errorf("failed to set ECS configuration in Redis: %v", err) + } + + log.Info("setupECSConfiguration: ECS configuration stored successfully in Redis", "key", ecsKey) + return nil +} + +// getECSConfig retrieves the ECS configuration from Redis and returns it as a map. +// An error is returned if the configuration is missing or cannot be unmarshaled. +func getECSConfig() (map[string]interface{}, error) { + // Define the Redis key for the ECS configuration + ecsKey := baseKey + "ecs:config" + ecsConfigJson, err := rc.JSONGetEntry(ecsKey, ".") + if err != nil { + log.Error("getECSConfig: failed to get ECS configuration from Redis", "error", err.Error()) + return nil, fmt.Errorf("failed to get ECS configuration: %v", err) + } + + // Unmarshal the JSON configuration into a map + var ecsConfig map[string]interface{} + err = json.Unmarshal([]byte(ecsConfigJson), &ecsConfig) + if err != nil { + log.Error("getECSConfig: failed to unmarshal ECS configuration", "error", err.Error()) + return nil, fmt.Errorf("failed to unmarshal ECS configuration: %v", err) + } + + log.Info("getECSConfig: successfully retrieved ECS configuration from Redis", "key", ecsKey) + return ecsConfig, nil +} + +// getRegistration retrieves the EEC registration details for a given RegistrationId. +// It extracts the registrationId from the request URL, looks up the corresponding entry in Redis, +// and sends a JSON response with the registration information. +func getRegistration(w http.ResponseWriter, r *http.Request) { + log.Info("getRegistration: Get EEC Registration by RegistrationId") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Extract the registrationId from the URL variables + vars := mux.Vars(r) + registrationId := vars["registrationId"] + keyName := baseKey + "app:" + registrationId + + // Retrieve the registration information from Redis + eecPrevReg, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + errMsg := "getRegistration: eecRegistration not found for the provided RegistrationId" + log.Error(errMsg, "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, errMsg, http.StatusNotFound) + return + } + if eecPrevReg == "" { + log.Error("getRegistration: RegistrationId not found in Redis", "registrationId", registrationId) + errHandlerProblemDetails(w, "Registration not found", http.StatusNotFound) + return + } + + // Convert the previously stored registration information to JSON format for the response + sInfoJson := convertEecPrevRegReqInfoToJson(eecPrevReg) + jsonResponse, err := json.Marshal(sInfoJson) + if err != nil { + log.Error("getRegistration: failed to marshal the response", "error", err.Error()) + errHandlerProblemDetails(w, "Internal server error", http.StatusInternalServerError) + return + } + + // Send the JSON response with a 200 OK status + w.WriteHeader(http.StatusOK) + w.Write(jsonResponse) + log.Info("getRegistration: successfully retrieved registration", "registrationId", registrationId) +} + +// updateRegistrationPut updates an existing EEC registration based on the RegistrationId provided in the URL. +// It decodes the update request, validates AcId fields, and updates the stored registration data in Redis. +func updateRegistrationPut(w http.ResponseWriter, r *http.Request) { + log.Info("updateRegistrationPut: Update EEC Registration by RegistrationId") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Extract registrationId from URL + vars := mux.Vars(r) + registrationId := vars["registrationId"] + + // Decode the update request body into ecsRegUpdateReq + var ecsRegUpdateReq RegistrationsRegistrationIdBody + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&ecsRegUpdateReq); err != nil { + log.Error("updateRegistrationPut: failed to decode the request body", "error", err.Error()) + errHandlerProblemDetails(w, "Invalid request format", http.StatusBadRequest) + return + } + + keyName := baseKey + "app:" + registrationId + + // Retrieve the current registration entry from Redis + eecPrevReg, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + errMsg := "updateRegistrationPut: eecRegistration not found for the provided RegistrationId" + log.Error(errMsg, "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, errMsg, http.StatusNotFound) + return + } + if eecPrevReg == "" { + log.Error("updateRegistrationPut: RegistrationId not found in Redis", "registrationId", registrationId) + errHandlerProblemDetails(w, "Registration not found", http.StatusNotFound) + return + } + + // Convert the current registration info to a modifiable JSON structure + sInfoJson := convertEecPrevRegReqInfoToJson(eecPrevReg) + + // Helper function to check if an AcId is valid + isValidAcId := func(acId string) bool { + return acId != "" && acId != "string" + } + + // Validate that at least one valid AcId is provided in the update request + hasAcId := false + for _, acProf := range ecsRegUpdateReq.AcProfs { + if isValidAcId(acProf.AcId) { + hasAcId = true + break + } + } + + // Process and validate each valid AcId in the update request + if hasAcId { + for _, acProf := range ecsRegUpdateReq.AcProfs { + if isValidAcId(acProf.AcId) { + appId := acProf.AcId + log.Debug("updateRegistrationPut: processing AcId", "appId", appId) + appInfo, err := getAppInfo(appId) + if err != nil { + log.Error("updateRegistrationPut: getAppInfo failed", "appId", appId, "error", err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error("updateRegistrationPut: validateAppInfo error", "appId", appId, "error", err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + } + } + } + + // Update the registration JSON with new AcProfs, ExpTime, and UeMobilityReq values + sInfoJson.AcProfs = ecsRegUpdateReq.AcProfs + sInfoJson.ExpTime = ecsRegUpdateReq.ExpTime + sInfoJson.UeMobilityReq = ecsRegUpdateReq.UeMobilityReq + + // Convert the updated registration structure back to JSON for storage + sInfoJson_ := convertEecRegReqInfoToJson(sInfoJson) + err = rc.JSONSetEntry(keyName, ".", sInfoJson_) + if err != nil { + log.Error("updateRegistrationPut: failed to set JSON entry in Redis DB", "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, "Failed to set JSON entry in Redis DB", http.StatusInternalServerError) + return + } + + // Prepare and send a response indicating a successful update + response := InlineResponse201{ + ExpirationTime: time.Now(), + } + jsonResponse, err := json.Marshal(response) + if err != nil { + log.Error("updateRegistrationPut: failed to marshal the response", "error", err.Error()) + errHandlerProblemDetails(w, "Internal server error", http.StatusInternalServerError) + return + } + + w.WriteHeader(http.StatusOK) + w.Write(jsonResponse) + log.Info("updateRegistrationPut: registration updated successfully", "registrationId", registrationId) +} + +// createEECReg creates a new EEC registration. +// It validates the incoming request, verifies that the request is stored in Redis, +// validates AcId fields, and finally stores the new registration while returning the registration details. +func createEECReg(w http.ResponseWriter, r *http.Request) { + log.Info("createEECReg: Request to create EEC Registration") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + mutex.Lock() + defer mutex.Unlock() + + // Check if the request body is provided + if r.Body == nil { + err := errors.New("createEECReg: request body is missing") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Decode the request body into an EecRegistration structure + var ecsRegReq EecRegistration + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&ecsRegReq); err != nil { + log.Error("createEECReg: failed to decode the request body", "error", err.Error()) + errHandlerProblemDetails(w, "Invalid request format", http.StatusBadRequest) + return + } + + // Validate that a unique EecId is provided + if ecsRegReq.EecId == "" || ecsRegReq.EecId == "string" { + log.Error("createEECReg: invalid request - unique EecId missing or default value provided") + errHandlerProblemDetails(w, "Please enter the unique EecId", http.StatusBadRequest) + return + } + + // Verify that the registration request is already stored in Redis + key := baseKey + "app:" + ecsRegReq.EecId + sInfoJson1, err := rc.JSONGetEntry(key, ".") + if err != nil { + log.Error("createEECReg: failed to get JSON entry from Redis DB", "error", err.Error()) + errHandlerProblemDetails(w, "Failed to get JSON entry from Redis DB", http.StatusInternalServerError) + return + } + if sInfoJson1 == "" { + log.Error("createEECReg: registration request is not stored in Redis", "EecId", ecsRegReq.EecId) + errHandlerProblemDetails(w, "Request is not stored in Redis DB", http.StatusInternalServerError) + return + } + + // Helper function to check if an AcId is valid + isValidAcId := func(acId string) bool { + return acId != "" && acId != "string" + } + + // Ensure that at least one valid AcId is provided in the registration request + hasAcId := false + for _, acProf := range ecsRegReq.AcProfs { + if isValidAcId(acProf.AcId) { + hasAcId = true + break + } + } + + // Validate each valid AcId by retrieving and validating associated application info + if hasAcId { + for _, acProf := range ecsRegReq.AcProfs { + if isValidAcId(acProf.AcId) { + appId := acProf.AcId + log.Debug("createEECReg: processing AcId", "appId", appId) + appInfo, err := getAppInfo(appId) + if err != nil { + log.Error("createEECReg: getAppInfo failed", "appId", appId, "error", err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error("createEECReg: validateAppInfo error", "appId", appId, "error", err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + } + } + } + + // Dynamically retrieve platform details to verify the registration endpoint and MEC platform ID + ednConfig, err := getDynamicPlatformDetails(basePath) + if err != nil { + log.Error("createEECReg: failed to get EDN config information", "error", err.Error()) + errHandlerProblemDetails(w, "Failed to get the EDN config information", http.StatusBadRequest) + return + } + + // Validate that the registration endpoint and source EES ID match the expected EDN config values + if ecsRegReq.EndPt == nil || ecsRegReq.EndPt.Uri != ednConfig.Eess[0].EndPt.Uri { + log.Error("createEECReg: endpoint mismatch - EEC registration endpoint does not match EDN config endpoint", + "provided", ecsRegReq.EndPt, "expected", ednConfig.Eess[0].EndPt) + errHandlerProblemDetails(w, "Endpoint mismatch: EEC registration endpoint does not match EDN config endpoint", http.StatusBadRequest) + return + } + if ecsRegReq.EndPt == nil || ecsRegReq.SrcEesId != ednConfig.Eess[0].EesId { + log.Error("createEECReg: endpoint mismatch - SrcEesId does not match EDN config MEC Platform ID", + "provided", ecsRegReq.SrcEesId, "expected", ednConfig.Eess[0].EesId) + errHandlerProblemDetails(w, "Endpoint mismatch: SrcEesId does not match EDN config MEC Platform ID", http.StatusBadRequest) + return + } + + // Generate a new unique registrationId for the new registration + registrationId := uuid.New().String() + sInfoJson := convertEecRegReqInfoToJson(&ecsRegReq) + key = baseKey + "app:" + registrationId + err = rc.JSONSetEntry(key, ".", sInfoJson) + if err != nil { + log.Error("createEECReg: failed to set JSON entry in Redis DB", "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, "Failed to set JSON entry in Redis DB", http.StatusInternalServerError) + return + } + + // Prepare the response with registration details + response := InlineResponse201{ + RegistrationID: registrationId, + ExpirationTime: time.Now(), + EECContextID: "example-context-id", // Replace with actual context ID if available + EECContextRelocationStatus: true, + DiscoveredEASList: []EasProfile{}, // Populate with actual EasProfile values if needed + } + + jsonResponse, err := json.Marshal(response) + if err != nil { + log.Error("createEECReg: failed to marshal the response", "error", err.Error()) + errHandlerProblemDetails(w, "Internal server error", http.StatusInternalServerError) + return + } + + // Send the successful creation response + w.WriteHeader(http.StatusOK) + w.Write(jsonResponse) + log.Info("createEECReg: registration created successfully", "registrationId", registrationId) +} + +// deleteIndEECReg deletes an individual EEC registration identified by RegistrationId. +// It removes the corresponding entry from Redis and returns a 204 No Content response on success. +func deleteIndEECReg(w http.ResponseWriter, r *http.Request) { + log.Info("deleteIndEECReg: Delete EEC Registration by RegistrationId") + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Extract registrationId from URL + vars := mux.Vars(r) + registrationId := vars["registrationId"] + keyName := baseKey + "app:" + registrationId + + // Check if the registration exists in Redis + _, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + errMsg := "deleteIndEECReg: eecRegistration not found for the provided RegistrationId" + log.Error(errMsg, "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, errMsg, http.StatusNotFound) + return + } + + // Delete the registration entry from Redis + err = rc.JSONDelEntry(keyName, ".") + if err != nil { + log.Error("deleteIndEECReg: failed to delete JSON entry from Redis DB", "registrationId", registrationId, "error", err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + log.Info("deleteIndEECReg: registration deleted successfully", "registrationId", registrationId) + // Send a 204 No Content response on successful deletion + w.WriteHeader(http.StatusNoContent) +} + +// requestServProv handles requests for service provisioning. It validates the request payload, +// ensures proper synchronization, checks required fields, and finally stores the request in Redis +// before sending the platform configuration as a response. +func requestServProv(w http.ResponseWriter, r *http.Request) { + log.Info("requestServProv: Received request to provide service") + + // Set response header to JSON + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Ensure thread safety when accessing shared resources + mutex.Lock() + defer mutex.Unlock() + + // Check if the request body is present + if r.Body == nil { + err := errors.New("requestServProv: request body is missing") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Decode the incoming JSON request into an EcsServProvReq structure + var ecsServReq EcsServProvReq + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&ecsServReq); err != nil { + log.Error("requestServProv: failed to decode request body", "error", err.Error()) + errHandlerProblemDetails(w, "Invalid request format", http.StatusBadRequest) + return + } + + // Validate that the EecId is provided and is not a placeholder value + if ecsServReq.EecId == "" || ecsServReq.EecId == "string" { + log.Error("requestServProv: invalid request - unique EecId missing or default value provided") + errHandlerProblemDetails(w, "Please enter the unique EecId", http.StatusBadRequest) + return + } + + // Helper function to check if a provided AcId is valid (i.e. non-empty and not the default "string") + isValidAcId := func(acId string) bool { + return acId != "" && acId != "string" + } + + // Verify that either a valid AcId is provided within AcProfs or LocationInfo is present. + hasAcId := false + for _, acProf := range ecsServReq.AcProfs { + if isValidAcId(acProf.AcId) { + hasAcId = true + break + } + } + if !hasAcId && ecsServReq.LocInf == nil { + log.Error("requestServProv: invalid request - both AcId and LocationInfo are missing") + errHandlerProblemDetails(w, "Either a valid AcId or LocationInfo must be provided", http.StatusBadRequest) + return + } + + // Process each valid AcId in the AcProfs slice + if hasAcId { + for _, acProf := range ecsServReq.AcProfs { + if isValidAcId(acProf.AcId) { + appId := acProf.AcId + log.Debug("requestServProv: processing AcId", "appId", appId) + // Retrieve application info for the given appId + appInfo, err := getAppInfo(appId) + if err != nil { + log.Error("requestServProv: getAppInfo failed", "appId", appId, "error", err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusNotFound) + return + } + + // Validate the retrieved appInfo; if invalid, send an appropriate response. + code, problemDetails, err := validateAppInfo(appInfo) + if err != nil { + log.Error("requestServProv: validateAppInfo error", "appId", appId, "error", err.Error()) + if problemDetails != "" { + w.WriteHeader(code) + fmt.Fprint(w, problemDetails) + } else { + errHandlerProblemDetails(w, err.Error(), code) + } + return + } + } + } + } + + // Process LocationInfo if provided + if ecsServReq.LocInf != nil { + lat := ecsServReq.LocInf.GeographicArea.Point.Point.Lat + lon := ecsServReq.LocInf.GeographicArea.Point.Point.Lon + log.Info("requestServProv: received coordinates", "latitude", lat, "longitude", lon) + + // Validate the geographic coordinates to ensure they are within acceptable boundaries. + if !isValidCoordinates(lat, lon) { + log.Error("requestServProv: invalid location - MEC platform not found for provided coordinates", + "latitude", lat, "longitude", lon) + errHandlerProblemDetails(w, "MEC platform not found for this location", http.StatusNotFound) + return + } + } + + // Convert the ECS service provisioning request info into JSON format for storage. + sInfoJson := convertEcsServProvReqInfoToJson(&ecsServReq) + key := baseKey + "app:" + ecsServReq.EecId + + // Store the request in Redis DB. + if err := rc.JSONSetEntry(key, ".", sInfoJson); err != nil { + log.Error("requestServProv: failed to set JSON entry in Redis DB", "error", err.Error()) + errHandlerProblemDetails(w, "Failed to set JSON entry in Redis DB", http.StatusInternalServerError) + return + } + + // Verify that the entry was successfully stored by retrieving it. + sInfoJson1, err := rc.JSONGetEntry(key, ".") + if err != nil { + log.Error("requestServProv: failed to get JSON entry from Redis DB", "error", err.Error()) + errHandlerProblemDetails(w, "Failed to get JSON entry from Redis DB", http.StatusInternalServerError) + return + } + if sInfoJson1 == "" { + log.Error("requestServProv: request not stored in Redis DB", "key", key) + errHandlerProblemDetails(w, "Request is not stored in Redis DB", http.StatusInternalServerError) + return + } + + // Dynamically retrieve platform configuration details using the basePath. + ednConfig, err := getDynamicPlatformDetails(basePath) + if err != nil { + log.Error("requestServProv: failed to get dynamic platform details", "error", err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Marshal the platform configuration to JSON for the response. + jsonResponse, err := json.Marshal(ednConfig) + if err != nil { + log.Error("requestServProv: failed to marshal response", "error", err.Error()) + errHandlerProblemDetails(w, "Internal server error", http.StatusInternalServerError) + return + } + + // Send the successful response with HTTP 200 OK. + w.WriteHeader(http.StatusOK) + w.Write(jsonResponse) + log.Info("requestServProv: successfully processed service provisioning request", "EecId", ecsServReq.EecId) +} + +// getDynamicPlatformDetails extracts platform configuration details dynamically based on the provided basePath. +// It returns an EdnConfigInfo structure containing the list of EES (Edge Services) configurations or an error if any occurs. +func getDynamicPlatformDetails(basePath string) (*EdnConfigInfo, error) { + platformDetails, err := getPlatformDetailsFromBasePath(basePath) + if err != nil { + log.Error("getDynamicPlatformDetails: error retrieving platform details from basePath", "error", err) + return nil, err + } + + // Build EES information from the retrieved platform details. + eesInfo := EesInfo{ + EesId: platformDetails.EesId, + EndPt: platformDetails.EndPt, + } + + return &EdnConfigInfo{ + Eess: []EesInfo{eesInfo}, + }, nil +} + +// isValidCoordinates checks whether the given latitude and longitude fall within the expected geographic boundaries, +// allowing a small tolerance for minor discrepancies. +func isValidCoordinates(lat, lon float64) bool { + const tolerance = 0.0001 + return lat >= (43.7244-tolerance) && lat <= (43.7515+tolerance) && + lon >= (7.4090-tolerance) && lon <= (7.4390+tolerance) +} + +// getPlatformDetailsFromBasePath parses the basePath to extract the platform identifier and constructs the corresponding URL. +// It returns an EesInfo structure containing the platform's EES identifier and endpoint or an error if the parsing fails. +func getPlatformDetailsFromBasePath(basePath string) (*EesInfo, error) { + // Locate the "/mep" segment in the path. This marks the beginning of the platform-specific portion. + mepIndex := strings.Index(basePath, "/mep") + if mepIndex == -1 { + err := errors.New("getPlatformDetailsFromBasePath: invalid base path, '/mep' not found") + log.Error(err.Error()) + return nil, err + } + + // The namespace is the part of the basePath before "/mep". + namespace := basePath[:mepIndex] + // Extract the platform-specific segment after "/mep". + platformPart := basePath[mepIndex+1:] + nextSlashIndex := strings.Index(platformPart, "/") + var platformIdentifier string + if nextSlashIndex != -1 { + platformIdentifier = platformPart[:nextSlashIndex] + } else { + platformIdentifier = platformPart + } + + // Construct the full URL for the MEC platform by combining hostUrl with the namespace and platform identifier. + mecPlatformUrl := strings.TrimSuffix(hostUrl.String(), "/") + "/" + + strings.TrimPrefix(namespace, "/") + "/" + platformIdentifier + + log.Debug("getPlatformDetailsFromBasePath: constructed MEC platform URL", "url", mecPlatformUrl) + + return &EesInfo{ + EesId: platformIdentifier, + EndPt: &EndPoint{ + Uri: mecPlatformUrl, + }, + }, nil +} + +// getEASDiscInfo handles HTTP requests to retrieve EAS (Edge Application Service) discovery information. +// It validates the request, retrieves application configuration from the datastore, and returns a JSON response. +func getEASDiscInfo(w http.ResponseWriter, r *http.Request) { + log.Debug("getEASDiscInfo: request received", "method", r.Method, "url", r.URL) + + // Set the response content type to JSON. + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + + // Decode the incoming JSON request into an EasDiscoveryReq structure. + var discReq EasDiscoveryReq + if err := json.NewDecoder(r.Body).Decode(&discReq); err != nil { + log.Error("getEASDiscInfo: error decoding request body", "error", err) + errHandlerProblemDetails(w, "Invalid request body.", http.StatusBadRequest) + return + } + log.Info("getEASDiscInfo: decoded request info", "discReq", discReq) + + // Immediately reject requests that include an unsupported EasId. + if discReq.RequestorId.EasId != "" { + log.Error("getEASDiscInfo: unsupported EasId provided", "EasId", discReq.RequestorId.EasId) + errHandlerProblemDetails(w, "EasId is not supported in this implementation", http.StatusBadRequest) + return + } + + // Validate that exactly one of EecId or EesId is provided in the request. + idCount := 0 + if discReq.RequestorId.EecId != "" { + idCount++ + } + if discReq.RequestorId.EesId != "" { + idCount++ + } + if idCount != 1 { + log.Error("getEASDiscInfo: request validation failed - exactly one identifier required", "EecId", discReq.RequestorId.EecId, "EesId", discReq.RequestorId.EesId) + errHandlerProblemDetails(w, "Exactly one of eecId or eesId must be provided", http.StatusBadRequest) + return + } + + // Process EecId if provided. + if discReq.RequestorId.EecId != "" { + key := baseKey + "app:" + discReq.RequestorId.EecId + sInfoJson1, err := rc.JSONGetEntry(key, ".") + if err != nil { + log.Error("getEASDiscInfo: invalid EecId", "EecId", discReq.RequestorId.EecId, "error", err) + errHandlerProblemDetails(w, "Invalid EecId", http.StatusBadRequest) + return + } + if sInfoJson1 == "" { + log.Error("getEASDiscInfo: no data found for provided EecId", "EecId", discReq.RequestorId.EecId) + errHandlerProblemDetails(w, "No data found for EecId", http.StatusNotFound) + return + } + } else { + // Validate the provided EesId against the dynamically generated platform configuration. + ednConfig, err := getDynamicPlatformDetails(basePath) + if err != nil { + log.Error("getEASDiscInfo: error retrieving dynamic platform details", "error", err) + errHandlerProblemDetails(w, "Platform configuration error: "+err.Error(), http.StatusInternalServerError) + return + } + + if len(ednConfig.Eess) == 0 || ednConfig.Eess[0].EesId == "" { + log.Error("getEASDiscInfo: missing EES configuration in server settings") + errHandlerProblemDetails(w, "Server configuration error", http.StatusInternalServerError) + return + } + + expectedEesId := ednConfig.Eess[0].EesId + if discReq.RequestorId.EesId != expectedEesId { + log.Error("getEASDiscInfo: provided EesId does not match expected configuration", "providedEesId", discReq.RequestorId.EesId, "expectedEesId", expectedEesId) + errHandlerProblemDetails(w, "Invalid EesId", http.StatusBadRequest) + return + } + } + + // Retrieve the appInstanceId from the first AcCharacteristics entry if present. + var appInstanceId string + if discReq.EasDiscoveryFilter != nil && len(discReq.EasDiscoveryFilter.AcChars) > 0 { + acChar := discReq.EasDiscoveryFilter.AcChars[0] + if acChar.AcProf != nil { + appInstanceId = acChar.AcProf.AcId + } + } + + // Ensure that appInstanceId is present in the request. + if appInstanceId == "" { + err := errors.New("getEASDiscInfo: acId not found in the request") + log.Error(err.Error()) + errHandlerProblemDetails(w, err.Error(), http.StatusBadRequest) + return + } + + // Construct the datastore key for retrieving app information. + keyName := baseKey + "appInfo:" + appInstanceId + log.Info("getEASDiscInfo: retrieving app information", "keyName", keyName) + jsonAppInfo, err := rc.JSONGetEntry(keyName, ".") + if err != nil { + errMsg := "appInfo not found for the provided appInstanceId" + log.Error("getEASDiscInfo:", errMsg, "appInstanceId", appInstanceId, "error", err) + errHandlerProblemDetails(w, errMsg, http.StatusNotFound) + return + } + + // Unmarshal the retrieved JSON data into the AppInfo structure. + var appInfo AppInfo + if err := json.Unmarshal([]byte(jsonAppInfo), &appInfo); err != nil { + log.Error("getEASDiscInfo: error unmarshaling appInfo", "error", err) + errHandlerProblemDetails(w, "Internal server error.", http.StatusInternalServerError) + return + } + + // Map the AppInfo data to the EASProfile response format. + easProfile := EasProfile{ + EasId: appInfo.AppName, + EndPt: appInfo.Endpoint, + ProvId: appInfo.AppProvider, + Type_: appInfo.AppCategory, + Scheds: appInfo.Scheds, + SvcArea: appInfo.SvcArea, + SvcKpi: appInfo.SvcKpi, + PermLvl: appInfo.PermLvl, + AcIds: []string{appInfo.AppInstanceId}, + } + + // Build the full discovery response with the mapped EAS profile. + resp := EasDiscoveryResp{ + DiscoveredEas: []DiscoveredEas{ + { + Eas: &easProfile, + }, + }, + } + + // Convert the response to JSON and send it with an HTTP 200 OK status. + jsonResponse := convertEasDiscoveryRespToJson(&resp) + w.WriteHeader(http.StatusOK) + log.Info("getEASDiscInfo: successfully processed request", "appInstanceId", appInstanceId) + fmt.Fprint(w, jsonResponse) +} + /* * appRegistrationPOST handles the registration of applications. * It decodes the request body into an AppInfo struct, validates mandatory parameters, retrieves app instance information, validates the app info, and stores it in Redis. @@ -686,34 +1426,35 @@ func appRegistrationPOST(w http.ResponseWriter, r *http.Request) { errHandlerProblemDetails(w, "Endpoint is required when IsInsByMec is FALSE.", http.StatusBadRequest) return } + if appInfo.IsInsByMec { + // Process appProfile if provided + if appInfo.AppProfile != nil { + // Validate appProvider and other fields mapped to EASProfile + if appInfo.AppProvider != appInfo.AppProfile.ProvId { + log.Error("Mismatch between appProvider in AppInfo and provId in appProfile") + errHandlerProblemDetails(w, "appProvider and provId must match.", http.StatusBadRequest) + return + } - // Process appProfile if provided - if appInfo.AppProfile != nil { - // Validate appProvider and other fields mapped to EASProfile - if appInfo.AppProvider != appInfo.AppProfile.ProvId { - log.Error("Mismatch between appProvider in AppInfo and provId in appProfile") - errHandlerProblemDetails(w, "appProvider and provId must match.", http.StatusBadRequest) - return - } - - if !reflect.DeepEqual(getEndpointUris(appInfo.Endpoint), getProfileEndpointUris(appInfo.AppProfile.EndPt)) { - log.Error("Mismatch between endpoint in AppInfo and endPt in appProfile") - errHandlerProblemDetails(w, "Endpoint and endPt must match.", http.StatusBadRequest) - return - } + if !reflect.DeepEqual(getEndpointUris(appInfo.Endpoint), getProfileEndpointUris(appInfo.AppProfile.EndPt)) { + log.Error("Mismatch between endpoint in AppInfo and endPt in appProfile") + errHandlerProblemDetails(w, "Endpoint and endPt must match.", http.StatusBadRequest) + return + } - if appInfo.AppProfile.EasId == "" { - log.Error("Missing mandatory parameter: easId") - errHandlerProblemDetails(w, "Mandatory attribute easId is missing.", http.StatusBadRequest) - return - } + if appInfo.AppProfile.EasId == "" { + log.Error("Missing mandatory parameter: easId") + errHandlerProblemDetails(w, "Mandatory attribute easId is missing.", http.StatusBadRequest) + return + } - if appInfo.AppName != appInfo.AppProfile.EasId { - log.Error("Mismatch between AppName in AppInfo and EasId in appProfile") - errHandlerProblemDetails(w, "AppName and EasId must match.", http.StatusBadRequest) - return + if appInfo.AppName != appInfo.AppProfile.EasId { + log.Error("Mismatch between AppName in AppInfo and EasId in appProfile") + errHandlerProblemDetails(w, "AppName and EasId must match.", http.StatusBadRequest) + return + } + // Additional checks for attributes such as scheds, svcArea, etc., as required. } - // Additional checks for attributes such as scheds, svcArea, etc., as required. } // Retrieve App instance information diff --git a/go-apps/meep-app-enablement/server/app-support/convert.go b/go-apps/meep-app-enablement/server/app-support/convert.go index c352c580c3cb16e714dca61bf9b7d0bc9867fe3a..072da21a4ecde40d1f8b34d0c68507690fdc384a 100644 --- a/go-apps/meep-app-enablement/server/app-support/convert.go +++ b/go-apps/meep-app-enablement/server/app-support/convert.go @@ -77,3 +77,42 @@ func convertAppInfoToJson(obj *AppInfo) string { return string(jsonInfo) } + +func convertEcsServProvReqInfoToJson(obj *EcsServProvReq) string { + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertEecRegReqInfoToJson(obj *EecRegistration) string { + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + return string(jsonInfo) +} + +func convertEecPrevRegReqInfoToJson(jsonInfo string) *EecRegistration { + var obj EecRegistration + err := json.Unmarshal([]byte(jsonInfo), &obj) + if err != nil { + log.Error(err.Error()) + return nil + } + return &obj +} + +func convertEasDiscoveryRespToJson(obj *EasDiscoveryResp) string { + + jsonInfo, err := json.Marshal(*obj) + if err != nil { + log.Error(err.Error()) + return "" + } + + return string(jsonInfo) +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_ac_characteristics.go b/go-apps/meep-app-enablement/server/app-support/model_ac_characteristics.go new file mode 100644 index 0000000000000000000000000000000000000000..27d4b86dc528c6fcb73c3aef1a7f1f0047b4082c --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_ac_characteristics.go @@ -0,0 +1,15 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents EAS dynamic information changes filter. +type AcCharacteristics struct { + AcProf *AcProfile `json:"acProf"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_ac_profile.go b/go-apps/meep-app-enablement/server/app-support/model_ac_profile.go new file mode 100644 index 0000000000000000000000000000000000000000..6a960070ea247d4645a534235c744b21aaf24584 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_ac_profile.go @@ -0,0 +1,24 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// AC information indicating required services and service characteristics. +type AcProfile struct { + // Identity of the AC. + AcId string `json:"acId"` + // The category or type of AC. + AcType string `json:"acType,omitempty"` + // Indicates to the ECS which ECSPs are preferred for the AC. + PrefEcsps []string `json:"prefEcsps,omitempty"` + + SimInactTime int32 `json:"simInactTime,omitempty"` + // List of EAS information. + Eass []EasDetail `json:"eass,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_acr_scenario.go b/go-apps/meep-app-enablement/server/app-support/model_acr_scenario.go new file mode 100644 index 0000000000000000000000000000000000000000..c6a8bb65fc1a5d6bdcdefb46a97cdc1424d4d7c6 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_acr_scenario.go @@ -0,0 +1,23 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the ACR scenarios supported by EES. Possible values are: - EEC_INITIATED: Represents the EEC initiated ACR scenario. - EEC_EXECUTED_VIA_SOURCE_EES: Represents the EEC ACR scenario executed via the S-EES. - EEC_EXECUTED_VIA_TARGET_EES: Represents the EEC ACR scenario executed via the T-EES. - SOURCE_EAS_DECIDED: Represents the EEC ACR scenario where the S-EAS decides to perform ACR. - SOURCE_EES_EXECUTED: Represents the EEC ACR scenario where S-EES executes the ACR. - EEL_MANAGED_ACR: Represents the EEC ACR scenario where the ACR is managed by the Edge Enabler Layer. +type AcrScenario string + +// Enum values for ACRScenarioEnum. +const ( + EEC_INITIATED AcrScenario = "EEC_INITIATED" + EEC_EXECUTED_VIA_SOURCE_EES AcrScenario = "EEC_EXECUTED_VIA_SOURCE_EES" + EEC_EXECUTED_VIA_TARGET_EES AcrScenario = "EEC_EXECUTED_VIA_TARGET_EES" + SOURCE_EAS_DECIDED AcrScenario = "SOURCE_EAS_DECIDED" + SOURCE_EES_EXECUTED AcrScenario = "SOURCE_EES_EXECUTED" + EEL_MANAGED_ACR AcrScenario = "EEL_MANAGED_ACR" +) diff --git a/go-apps/meep-app-enablement/server/app-support/model_app_group_profile.go b/go-apps/meep-app-enablement/server/app-support/model_app_group_profile.go new file mode 100644 index 0000000000000000000000000000000000000000..2a4efd0e6947cf6bd4b5851dddd488db69130ff8 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_app_group_profile.go @@ -0,0 +1,18 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the application group profile for common EAS. +type AppGroupProfile struct { + // Represents the application group that uniquely identifies the group of UEs using the same application. + AppGrpId string `json:"appGrpId"` + // Represents the application identifier of the EAS. + EasId string `json:"easId"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_app_info.go b/go-apps/meep-app-enablement/server/app-support/model_app_info.go index 836049ee3078989924b44d1a36c3e28d83a2b30e..958aa082ced964cce2ca771b34941eece62a300b 100644 --- a/go-apps/meep-app-enablement/server/app-support/model_app_info.go +++ b/go-apps/meep-app-enablement/server/app-support/model_app_info.go @@ -46,7 +46,11 @@ type AppInfo struct { // Describes features a MEC application may use if available. FeatureDependency is defined in ETSI GS MEC 010-2 [4]. It shall not be provided if an AppD is available. AppFeatureOptional []FeatureDependency `json:"appFeatureOptional,omitempty"` // Indicate whether the application instance is instantiated by the MEC Management. Default to FALSE if absent. - IsInsByMec bool `json:"isInsByMec,omitempty"` - + IsInsByMec bool `json:"isInsByMec,omitempty"` + Scheds []string `json:"scheds"` + SvcArea string `json:"svcArea,omitempty"` AppProfile *AppProfile `json:"appProfile,omitempty"` + // Service characteristics provided by the EAS. + SvcKpi string `json:"svcKpi,omitempty"` + PermLvl []string `json:"permLvl"` } diff --git a/go-apps/meep-app-enablement/server/app-support/model_application_info.go b/go-apps/meep-app-enablement/server/app-support/model_application_info.go new file mode 100644 index 0000000000000000000000000000000000000000..1962b4b725e5cd57eb470fd9652f8e9b943320ef --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_application_info.go @@ -0,0 +1,17 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the services the EEC wants to connect. +type ApplicationInfo struct { + AcProf *AcProfile `json:"acProf"` + + AppGroupProfile *AppGroupProfile `json:"appGroupProfile,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_device_type.go b/go-apps/meep-app-enablement/server/app-support/model_device_type.go new file mode 100644 index 0000000000000000000000000000000000000000..24a47c7712a44bdb0a7f6a347484441a18399952 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_device_type.go @@ -0,0 +1,18 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the UE type. Possible values are: - CONSTRAINED_UE: Indicates UE is constrained with resources like power, processor etc. - NORMAL_UE: Indicates UE is not constrained with resources. +type DeviceType string + +const ( + ConstrainedUE = "CONSTRAINED_UE" + NormalUE = "NORMAL_UE" +) diff --git a/go-apps/meep-app-enablement/server/app-support/model_discovered_eas.go b/go-apps/meep-app-enablement/server/app-support/model_discovered_eas.go new file mode 100644 index 0000000000000000000000000000000000000000..97141c3661f7bd71c6207499428c9b356cdc4ca3 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_discovered_eas.go @@ -0,0 +1,23 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +// Represents an EAS discovery information. +type DiscoveredEas struct { + Eas *EasProfile `json:"eas"` + + EesEndPt *EndPoint `json:"eesEndPt,omitempty"` + + LifeTime *time.Time `json:"lifeTime,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eas_detail.go b/go-apps/meep-app-enablement/server/app-support/model_eas_detail.go new file mode 100644 index 0000000000000000000000000000000000000000..f93b04308455c47e4c107364641440e48fe6400c --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eas_detail.go @@ -0,0 +1,16 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// EAS details. +type EasDetail struct { + // Application identifier of the EAS. + EasId string `json:"easId"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_filter.go b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_filter.go new file mode 100644 index 0000000000000000000000000000000000000000..6c27737cfa0a335406a0a3b30a41c23add87efc9 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_filter.go @@ -0,0 +1,16 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the EAS characteristics. +type EasDiscoveryFilter struct { + // AC description for which an EAS is needed. + AcChars []AcCharacteristics `json:"acChars,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_req.go b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_req.go new file mode 100644 index 0000000000000000000000000000000000000000..4d6af9722d60a0ae0afd989632450921a9e47e15 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_req.go @@ -0,0 +1,39 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +// EAS discovery request information. +type EasDiscoveryReq struct { + RequestorId *RequestorId `json:"requestorId"` + + UeId string `json:"ueId,omitempty"` + + EasDiscoveryFilter *EasDiscoveryFilter `json:"easDiscoveryFilter,omitempty"` + // Indicates if the EEC supports service continuity or not, also indicates which ACR scenarios are supported by the EEC. + EecSvcContinuity []AcrScenario `json:"eecSvcContinuity,omitempty"` + // Indicates if the EES supports service continuity or not, also indicates which ACR scenarios are supported by the EES. + EesSvcContinuity []AcrScenario `json:"eesSvcContinuity,omitempty"` + // Indicates if the EAS supports service continuity or not, also indicates which ACR scenarios are supported by the EAS. + EasSvcContinuity []AcrScenario `json:"easSvcContinuity,omitempty"` + + LocInf *LocationInfo `json:"locInf,omitempty"` + // Indicates if the EEC requires the EAS selection support from the EES (e.g., for constrained device). The default value false indicates the EAS selection is not required from the EES. + EasSelSupInd bool `json:"easSelSupInd,omitempty"` + + SuppFeat string `json:"suppFeat,omitempty"` + // Indicates to the EES whether the EAS instantiation triggering should be performed for the current request. The default value false indicates the EAS instantiation triggering should not be performed. The true value indicate the EAS instantiation triggering should be performed. + EasIntTrigSup bool `json:"easIntTrigSup,omitempty"` + + PredictExpTime *time.Time `json:"predictExpTime,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_resp.go b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_resp.go new file mode 100644 index 0000000000000000000000000000000000000000..6c6a76a8806cab50e976b06f8a460e6a0e30674d --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eas_discovery_resp.go @@ -0,0 +1,16 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// EAS discovery response. +type EasDiscoveryResp struct { + // List of EAS discovery information. + DiscoveredEas []DiscoveredEas `json:"discoveredEas"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eas_profile.go b/go-apps/meep-app-enablement/server/app-support/model_eas_profile.go new file mode 100644 index 0000000000000000000000000000000000000000..c26789af56b6f371bd27c976235707b0c4c9ba06 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eas_profile.go @@ -0,0 +1,41 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type EasProfile struct { + // The identifier of the EAS + EasId string `json:"easId"` + + EndPt *OneOfAppInfoEndpoint `json:"endPt"` + // Identities of the Application Clients that can be served by the EAS + AcIds []string `json:"acIds"` + // Identifier of the ASP that provides the EAS. + ProvId string `json:"provId,omitempty"` + // The category or type of EAS. + Type_ *CategoryRef `json:"type,omitempty"` + // The availability schedule of the EAS. + Scheds []string `json:"scheds"` + // The list of geographical and topological areas that the EAS serves. ACs in the UE that are outside the area will not be served. + SvcArea string `json:"svcArea,omitempty"` + // Service characteristics provided by the EAS. + SvcKpi string `json:"svcKpi,omitempty"` + // level of service permissions supported by the EAS. + PermLvl []string `json:"permLvl"` + // Service features supported by the EAS. + EasFeats []string `json:"easFeats"` + // The ACR scenarios supported by the EAS for service continuity. + SvcContSupp []string `json:"svcContSupp"` + // List of DNAI(s) and the N6 traffic information associated with the EAS. + AppLocs []string `json:"appLocs"` + // The period indicating to the EES, how often the EES needs to check the EAS's availability after a successful registration. + AvlRep int32 `json:"avlRep,omitempty"` + // EAS status information. + Status string `json:"status,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_ecs_serv_prov_req.go b/go-apps/meep-app-enablement/server/app-support/model_ecs_serv_prov_req.go new file mode 100644 index 0000000000000000000000000000000000000000..8afeff3ada39a00f25575a46ed5a3c53a9b4350a --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_ecs_serv_prov_req.go @@ -0,0 +1,30 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// ECS service provisioning request information. +type EcsServProvReq struct { + // Represents a unique identifier of the EEC. + EecId string `json:"eecId"` + + UeId string `json:"ueId,omitempty"` + // Information about services the EEC wants to connect to. + AcProfs []AcProfile `json:"acProfs,omitempty"` + // Information about the list of services the EEC wants to connect. + AppInfo []ApplicationInfo `json:"appInfo,omitempty"` + // Indicates if the EEC supports service continuity or not, also indicates which ACR scenarios are supported by the EEC. + EecSvcContSupp []AcrScenario `json:"eecSvcContSupp,omitempty"` + + LocInf *LocationInfo `json:"locInf,omitempty"` + // Indicates to the ECS which EES providers are preferred by the EEC. + EcspIds []string `json:"ecspIds,omitempty"` + + SuppFeat string `json:"suppFeat,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_edn_con_info.go b/go-apps/meep-app-enablement/server/app-support/model_edn_con_info.go new file mode 100644 index 0000000000000000000000000000000000000000..8abe61ed016ec67536cdd82e08955b9b2912ac74 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_edn_con_info.go @@ -0,0 +1,15 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents an EDN connection information. +type EdnConInfo struct { + Dnn string `json:"dnn,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_edn_config_info.go b/go-apps/meep-app-enablement/server/app-support/model_edn_config_info.go new file mode 100644 index 0000000000000000000000000000000000000000..8f10cf3114bb93ef2bb0394988ee7d07efecabfb --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_edn_config_info.go @@ -0,0 +1,23 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +// Represents the EDN configuration information. +type EdnConfigInfo struct { + EdnConInfo *EdnConInfo `json:"ednConInfo"` + // Contains the list of EESs of the EDN. + Eess []EesInfo `json:"eess"` + + LifeTime *time.Time `json:"lifeTime,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_eec_registration.go b/go-apps/meep-app-enablement/server/app-support/model_eec_registration.go new file mode 100644 index 0000000000000000000000000000000000000000..8b610d3cac9842961d420ef246d66afcf162f03f --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_eec_registration.go @@ -0,0 +1,40 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +// Describes the parameters to perform EEC Registration related operations. +type EecRegistration struct { + // Represents a unique identifier of the EEC. + EecId string `json:"eecId"` + + UeId string `json:"ueId,omitempty"` + // Profiles of ACs for which the EEC provides edge enabling services. + AcProfs []AcProfile `json:"acProfs,omitempty"` + + ExpTime *time.Time `json:"expTime,omitempty"` + // Profiles of ACs for which the EEC provides edge enabling services. + EecSvcContSupp []AcrScenario `json:"eecSvcContSupp,omitempty"` + // Identifier of the EEC context obtained from a previous registration. + EecCntxId string `json:"eecCntxId,omitempty"` + // Identifier of the EES that provided EEC context ID. + SrcEesId string `json:"srcEesId,omitempty"` + + EndPt *EndPoint `json:"endPt,omitempty"` + // Set to true to indicate that UE Mobility support is required. Set to false to indicate that UE mobility support is not required. The default value when omitted is false. + UeMobilityReq bool `json:"ueMobilityReq,omitempty"` + // Set to true to indicate the EES support for EAS selection. Set to false to indicate the EES shall not select the EAS. The default value when omitted is false. + EasSelReqInd bool `json:"easSelReqInd,omitempty"` + + UeType *DeviceType `json:"ueType,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_ees_info.go b/go-apps/meep-app-enablement/server/app-support/model_ees_info.go new file mode 100644 index 0000000000000000000000000000000000000000..1fadd0541d791d1a383d58af07b283df656a9b09 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_ees_info.go @@ -0,0 +1,22 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents EES information. +type EesInfo struct { + // Identity of the EES. + EesId string `json:"eesId"` + + EndPt *EndPoint `json:"endPt,omitempty"` + // Application identities of the Edge Application Servers registered with the EES. + EasIds []string `json:"easIds,omitempty"` + // Indicates whether the EEC is required to register on the EES to use edge services or not. + EecRegConf bool `json:"eecRegConf"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_end_point.go b/go-apps/meep-app-enablement/server/app-support/model_end_point.go new file mode 100644 index 0000000000000000000000000000000000000000..c871e1f9e0f209d34d3caf387994f6f807831dbc --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_end_point.go @@ -0,0 +1,21 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// The end point information to reach EAS. +type EndPoint struct { + Fqdn string `json:"fqdn,omitempty"` + // IPv4 addresses of the edge server. + Ipv4Addrs []string `json:"ipv4Addrs,omitempty"` + // IPv6 addresses of the edge server. + Ipv6Addrs []string `json:"ipv6Addrs,omitempty"` + + Uri string `json:"uri,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_geographic_area.go b/go-apps/meep-app-enablement/server/app-support/model_geographic_area.go new file mode 100644 index 0000000000000000000000000000000000000000..1ca1b111be06b25e39eb4cc8f95f21a8437918e4 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_geographic_area.go @@ -0,0 +1,15 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Geographic area specified by different shape. +type GeographicArea struct { + Point *Point `json:"point,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_geographical_coordinates.go b/go-apps/meep-app-enablement/server/app-support/model_geographical_coordinates.go new file mode 100644 index 0000000000000000000000000000000000000000..2916c05e1cfef85706dd8af1b172c033400e9c75 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_geographical_coordinates.go @@ -0,0 +1,17 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Geographical coordinates. +type GeographicalCoordinates struct { + Lon float64 `json:"lon"` + + Lat float64 `json:"lat"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_inline_response_201.go b/go-apps/meep-app-enablement/server/app-support/model_inline_response_201.go new file mode 100644 index 0000000000000000000000000000000000000000..c8beccfa2209cceeb237ace88003810a1ef7c901 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_inline_response_201.go @@ -0,0 +1,27 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +type InlineResponse201 struct { + // Identifier of the EEC registration. + RegistrationID string `json:"RegistrationID,omitempty"` + // Expiration time of the registration. + ExpirationTime time.Time `json:"ExpirationTime,omitempty"` + // Identifier of the EEC context information available at the EES. + EECContextID string `json:"EECContextID,omitempty"` + // Indicates whether the EEC context retrieval from the source EES was successful. + EECContextRelocationStatus bool `json:"EECContextRelocationStatus,omitempty"` + + DiscoveredEASList []EasProfile `json:"DiscoveredEASList,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_location_info.go b/go-apps/meep-app-enablement/server/app-support/model_location_info.go new file mode 100644 index 0000000000000000000000000000000000000000..43b39d40a96402ca29daa10d3786b4deae4ac636 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_location_info.go @@ -0,0 +1,15 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents the user location information. +type LocationInfo struct { + GeographicArea *GeographicArea `json:"geographicArea,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_point.go b/go-apps/meep-app-enablement/server/app-support/model_point.go new file mode 100644 index 0000000000000000000000000000000000000000..8883debf93f39f21703f8947e472e55f6ca599fb --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_point.go @@ -0,0 +1,17 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Ellipsoid Point. +type Point struct { + Point *GeographicalCoordinates `json:"point"` + + Shape *SupportedGadShapes `json:"shape"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_registrations_registration_id_body.go b/go-apps/meep-app-enablement/server/app-support/model_registrations_registration_id_body.go new file mode 100644 index 0000000000000000000000000000000000000000..b19f20de67f9399f89f82622d2174a950dfe0cbd --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_registrations_registration_id_body.go @@ -0,0 +1,23 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +import ( + "time" +) + +type RegistrationsRegistrationIdBody struct { + // Profiles of ACs for which the EEC provides edge enabling services. + AcProfs []AcProfile `json:"acProfs,omitempty"` + + ExpTime *time.Time `json:"expTime,omitempty"` + // Set to true to indicate that UE Mobility support is required. Set to false to indicate that UE mobility support is not required. The default value when omitted is false. + UeMobilityReq bool `json:"ueMobilityReq,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_requestor_id.go b/go-apps/meep-app-enablement/server/app-support/model_requestor_id.go new file mode 100644 index 0000000000000000000000000000000000000000..e20f925d2836e7a2ccf5707cb93f024ecff8d27c --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_requestor_id.go @@ -0,0 +1,20 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Represents identifier of the requestor. +type RequestorId struct { + // The identifier of the EES (e.g. S-EES). + EesId string `json:"eesId,omitempty"` + // The application identifier of the EAS (e.g. S-EAS), e.g. FQDN, URI. + EasId string `json:"easId,omitempty"` + // The identifier of the EEC. + EecId string `json:"eecId,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/app-support/model_supported_gad_shapes.go b/go-apps/meep-app-enablement/server/app-support/model_supported_gad_shapes.go new file mode 100644 index 0000000000000000000000000000000000000000..109dc363032054bd62c86f2cdcf6b365c69fec41 --- /dev/null +++ b/go-apps/meep-app-enablement/server/app-support/model_supported_gad_shapes.go @@ -0,0 +1,29 @@ +/* + * MEC Service Management API + * + * The ETSI MEC ISG MEC011 MEC Service Management API described using OpenAPI + * + * API version: 3.1.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// Indicates supported GAD shapes. +type SupportedGadShapes string + +// Enum values for SupportedGADShapes. +const ( + POINT SupportedGadShapes = "POINT" + POINT_UNCERTAINTY_CIRCLE SupportedGadShapes = "POINT_UNCERTAINTY_CIRCLE" + POINT_UNCERTAINTY_ELLIPSE SupportedGadShapes = "POINT_UNCERTAINTY_ELLIPSE" + POLYGON SupportedGadShapes = "POLYGON" + POINT_ALTITUDE SupportedGadShapes = "POINT_ALTITUDE" + POINT_ALTITUDE_UNCERTAINTY SupportedGadShapes = "POINT_ALTITUDE_UNCERTAINTY" + ELLIPSOID_ARC SupportedGadShapes = "ELLIPSOID_ARC" + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE SupportedGadShapes = "LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE" + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID SupportedGadShapes = "LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID" + DISTANCE_DIRECTION SupportedGadShapes = "DISTANCE_DIRECTION" + RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE SupportedGadShapes = "RELATIVE_2D_LOCATION_UNCERTAINTY_ELLIPSE" + RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID SupportedGadShapes = "RELATIVE_3D_LOCATION_UNCERTAINTY_ELLIPSOID" +) diff --git a/go-apps/meep-app-enablement/server/routers.go b/go-apps/meep-app-enablement/server/routers.go index 1ad8f96b930446f4da7f46b1126c995e0ab2596b..8a59112dc81ef6b4b521bc1ed39ad3deb3dab4ef 100644 --- a/go-apps/meep-app-enablement/server/routers.go +++ b/go-apps/meep-app-enablement/server/routers.go @@ -182,6 +182,13 @@ var routes = Routes{ appSupport.TimingCapsGET, }, + Route{ + "GetEASDiscInfo", + strings.ToUpper("Post"), + "/eees-easdiscovery/v1/eas-profiles/request-discovery", + appSupport.GetEASDiscInfo, + }, + Route{ "TimingCurrentTimeGET", strings.ToUpper("Get"), @@ -322,6 +329,41 @@ var routes = Routes{ svcMgmt.TransportsGET, }, + Route{ + "RequestServProv", + strings.ToUpper("Post"), + "/eecs-serviceprovisioning/v1/request", + appSupport.RequestServProv, + }, + + Route{ + "DeleteEECReg", + strings.ToUpper("Delete"), + "/eees-eecregistration/v1/registration/{registrationId}", + appSupport.DeleteIndEECReg, + }, + + Route{ + "UpdateRegistrationPut", + strings.ToUpper("Put"), + "/eees-eecregistration/v1/registration/{registrationId}", + appSupport.UpdateRegistrationPut, + }, + + Route{ + "GetRegistration", + strings.ToUpper("Get"), + "/eees-eecregistration/v1/registration/{registrationId}", + appSupport.GetRegistration, + }, + + Route{ + "CreateEECReg", + strings.ToUpper("Post"), + "/eees-eecregistration/v1/registration", + appSupport.CreateEECReg, + }, + Route{ "Index", "GET",