diff --git a/MEC013/SRV/UELOCSUB/PlatUeLocationSubscription.robot b/MEC013/SRV/UELOCSUB/PlatUeLocationSubscription.robot index ec1cbaeec855b0c7064577048ae2e365f0eb2472..32f9d0f488541b3447c69c7e685af4704e50b114 100644 --- a/MEC013/SRV/UELOCSUB/PlatUeLocationSubscription.robot +++ b/MEC013/SRV/UELOCSUB/PlatUeLocationSubscription.robot @@ -8,98 +8,257 @@ Resource ../../../pics.txt Resource environment/variables.txt Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem - +Library String +Library libraries/Server.py Default Tags TC_MEC_SRV_UELOCSUB -*** Variables *** -${response} - *** Test Cases *** - -TC_MEC_MEC013_SRV_UELOCSUB_001_OK +TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01 [Documentation] - ... Check that the IUT acknowledges the UE location change subscription request - ... when commanded by a MEC Application and notifies it when the location changes + ... Check that the IUT acknowledges the subscription by a MEC Application to notifications user location event ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.4 - ... OpenAPI https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/UserTrackingSubscription - + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.5.3.4 + ... [Tags] PIC_MEC_PLAT PIC_SERVICES - Create new subscription UserTrackingSubscription + Create a subscription UserLocationEventSubscription + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} Check HTTP Response Status Code Is 201 - Check HTTP Response Body Json Schema Is UserTrackingSubscription - # TODO fix related TP - # Check Result Contains ${response['body']['userTrackingSubscription']} clientCorrelator ${USERTRACKSUB_CLIENT_ID} - Should Be Equal As Strings ${response['body']['userTrackingSubscription']['callbackReference']} ${USERTRACK_NOTIF_CALLBACK_URI} - Should Be Equal As Strings ${response['body']['userTrackingSubscription']['address']} ${USERTRACK_IP_ADDRESS} - - # TODO how to send this? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test? - # // MEC 013, clause 7.3.4.3 - # the IUT entity sends a vPOST containing - # Uri set to CALLBACK_URL - # body containing - # zonalPresenceNotification containing - # clientCorrelator set to CLIENT_ID, - # address set to IP_ADDRESS - # ; - # ; - # ; - # to the MEC_APP entity - -TC_MEC_MEC013_SRV_UELOCSUB_001_BR + Check HTTP Response Body Json Schema Is UserLocationEventSubscription + Get value entry from JSON file UserLocationEventSubscription subscriptionType + ${CLIENT_CORR} Get value entry from JSON file UserLocationEventSubscription clientCorrelator + ${CALLBACK_REF} Get value entry from JSON file UserLocationEventSubscription callbackReference + ${ADDRESS} Get value entry from JSON file UserLocationEventSubscription address + Should be Equal ${response['body']['subscriptionType']} UserLocationEventSubscription + Should be Equal ${response['body']['clientCorrelator']} ${CLIENT_CORR} + Should be Equal ${response['body']['callbackReference']} ${CALLBACK_REF} + Should be Equal ${response['body']['address']} ${ADDRESS} + Spawn Notification Server UserLocationEventNotification + Validate Json UserLocationEventNotification.schema.json ${payload_notification} + [TearDown] Remove a subscription ${SUB_ID} + + + +TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02 [Documentation] - ... Check that the IUT responds with an error when - ... a request with incorrect parameters is sent by a MEC Application + ... Check that the IUT acknowledges the subscription by a MEC Application to notifications user location periodic ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.4 + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.5 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.5 + ... ETSI GS MEC 013 3.1.1 Clause 7.5.3.4 + ... + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a subscription UserLocationPeriodicSubscription + Check HTTP Response Status Code Is 201 + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + Check HTTP Response Body Json Schema Is UserLocationPeriodicSubscription + Get value entry from JSON file UserLocationPeriodicSubscription subscriptionType + ${CLIENT_CORR} Get value entry from JSON file UserLocationPeriodicSubscription clientCorrelator + ${CALLBACK_REF} Get value entry from JSON file UserLocationPeriodicSubscription callbackReference + ${ADDRESS} Get value entry from JSON file UserLocationPeriodicSubscription address + ${PER_EVENT_INFO} Get value entry from JSON file UserLocationPeriodicSubscription periodicEventInfo + Should be Equal ${response['body']['subscriptionType']} UserLocationPeriodicSubscription + Should be Equal ${response['body']['clientCorrelator']} ${CLIENT_CORR} + Should be Equal ${response['body']['callbackReference']} ${CALLBACK_REF} + Should be Equal ${response['body']['address']} ${ADDRESS} + Should be Equal ${response['body']['periodicEventInfo']} ${PER_EVENT_INFO} + Spawn Notification Server UserLocationPeriodicNotification + Validate Json UserLocationPeriodicNotification.schema.json ${payload_notification} + [TearDown] Remove a subscription ${SUB_ID} + +TC_MEC_MEC013_SRV_UELOCSUB_001_BR_01 + [Documentation] + ... Check that the IUT responds with an error + ... when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.5.3.4 [Tags] PIC_MEC_PLAT PIC_SERVICES - Create new subscription UserTrackingSubscriptionError + Create a subscription UserLocationEventSubscriptionBR Check HTTP Response Status Code Is 400 +TC_MEC_MEC013_SRV_UELOCSUB_001_BR_02 + [Documentation] + ... Check that the IUT responds with an error + ... when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.5 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.5 + ... ETSI GS MEC 013 3.1.1 Clause 7.5.3.4 + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a subscription UserLocationPeriodicSubscriptionBR + Check HTTP Response Status Code Is 400 + TC_MEC_MEC013_SRV_UELOCSUB_002_OK [Documentation] - ... Check that the IUT acknowledges the cancellation of UE location change notifications + ... Check that the IUT acknowledges the cancellation of UE information change notifications ... when commanded by a MEC Application - ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.6 - + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 5.3.6 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.5 [Tags] PIC_MEC_PLAT PIC_SERVICES - Remove subscription ${SUBSCRIPTION_ID} + [Setup] Create a subscription UserLocationEventSubscription + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + Remove a subscription ${SUB_ID} Check HTTP Response Status Code Is 204 TC_MEC_MEC013_SRV_UELOCSUB_002_NF [Documentation] - ... Check that the IUT responds with an error when - ... a request for an unknown URI is sent by a MEC Application - ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.6 - + ... Check that the IUT responds with an error + ... when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 5.3.6 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.5 [Tags] PIC_MEC_PLAT PIC_SERVICES - Remove subscription ${NON_EXISTENT_SUBSCRIPTION_ID} + [Setup] Remove a subscription ${NON_EXISTENT_SUBSCRIPTION_ID} + Remove a subscription ${NON_EXISTENT_SUBSCRIPTION_ID} Check HTTP Response Status Code Is 404 + + + +TC_MEC_MEC013_SRV_UELOCSUB_003_OK_01 + [Documentation] + ... Check that the IUT acknowledges a request + ... to modify an existing subscription by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.2 + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create a subscription UserLocationEventSubscription + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + Update a subscription ${SUB_ID} UserLocationEventSubscriptionUpdate + ${CLIENT_CORR} Get value entry from JSON file UserLocationEventSubscriptionUpdate clientCorrelator + ${CALLBACK_REF} Get value entry from JSON file UserLocationEventSubscriptionUpdate callbackReference + ${ADDRESS} Get value entry from JSON file UserLocationEventSubscriptionUpdate address + Should be Equal ${response['body']['subscriptionType']} UserLocationEventSubscription + Should be Equal ${response['body']['clientCorrelator']} ${CLIENT_CORR} + Should be Equal ${response['body']['callbackReference']} ${CALLBACK_REF} + Should be Equal ${response['body']['address']} ${ADDRESS} + Check HTTP Response Status Code Is 200 + [TearDown] Remove a subscription ${SUB_ID} + + +TC_MEC_MEC013_SRV_UELOCSUB_003_OK_02 + [Documentation] + ... Check that the IUT acknowledges a request to modify an existing subscription by a MEC Application + ... ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.2 + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create a subscription UserLocationPeriodicSubscription + + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + + Update a subscription ${SUB_ID} UserLocationPeriodicSubscriptionUpdate + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is UserLocationPeriodicSubscription + ${CLIENT_CORR} Get value entry from JSON file UserLocationPeriodicSubscriptionUpdate clientCorrelator + ${CALLBACK_REF} Get value entry from JSON file UserLocationPeriodicSubscriptionUpdate callbackReference + ${ADDRESS} Get value entry from JSON file UserLocationPeriodicSubscriptionUpdate address + ${PER_EVENT_INFO} Get value entry from JSON file UserLocationPeriodicSubscriptionUpdate periodicEventInfo + Should be Equal ${response['body']['subscriptionType']} UserLocationPeriodicSubscription + Should be Equal ${response['body']['clientCorrelator']} ${CLIENT_CORR} + Should be Equal ${response['body']['callbackReference']} ${CALLBACK_REF} + Should be Equal ${response['body']['address']} ${ADDRESS} + Should be Equal ${response['body']['periodicEventInfo']} ${PER_EVENT_INFO} + [TearDown] Remove a subscription ${SUB_ID} + +TC_MEC_MEC013_SRV_UELOCSUB_003_BR_02 + [Documentation] + ... Check that the IUT responds with an error when received an inconsistent request + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.2 + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create a subscription UserLocationPeriodicSubscription + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + Update a subscription ${SUB_ID} UserLocationEventSubscriptionUpdateBR + Check HTTP Response Status Code Is 400 + [TearDown] Remove a subscription ${SUB_ID} + + +TC_MEC_MEC013_SRV_UELOCSUB_003_NF + [Documentation] + ... Check that the IUT acknowledges a request to modify a not existing subscription by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 6.3.4 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.4 + ... ETSI GS MEC 013 3.1.1 Clause 7.6.3.2 + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Remove a subscription ${NON_EXISTENT_SUBSCRIPTION_ID} + Update a subscription ${NON_EXISTENT_SUBSCRIPTION_ID} UserLocationEventSubscriptionUpdate + Check HTTP Response Status Code Is 404 + *** Keywords *** -Create new subscription +Create a subscription [Arguments] ${content} Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/userTracking ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users ${body} ${output}= Output response Set Suite Variable ${response} ${output} -Remove subscription - [Arguments] ${subscriptionId} + +Update a subscription + [Arguments] ${subscription_id} ${content} Set Headers {"Accept":"application/json"} Set Headers {"Authorization":"${TOKEN}"} - Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/userTracking/${subscriptionId} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users/${subscription_id} ${body} ${output}= Output response Set Suite Variable ${response} ${output} + + +Retrieve a subscription + [Arguments] ${subscription_id} + Set Headers {"Accept":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users/${subscription_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Remove a subscription + [Arguments] ${subscription_id} + Set Headers {"Accept":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Set Headers {"Authorization":"${TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users/${subscription_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + + + + +Spawn Notification Server + [Arguments] ${payload_notification} + ${output} Spawn Web Server ${NOTIFICATION_SERVER_IP} ${NOTIFICATION_SERVER_PORT} ${NOTIFICATION_SERVER_TIMEOUT} ${NOTIFICATION_SERVER_HTTP_METHOD} ${NOTIFICATION_SERVER_URI} ${payload_notification} + ${length} = Get Length ${output} + Set Suite Variable ${payload_notification} ${output} + Run Keyword If ${length} == 0 Skip + + \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/environment/variables.txt b/MEC013/SRV/UELOCSUB/environment/variables.txt index 3881d380f213d60cd743505c509ae7c6d6794fc1..9ba08ce20b37b1e5e6c4581adda8c944d299db7f 100644 --- a/MEC013/SRV/UELOCSUB/environment/variables.txt +++ b/MEC013/SRV/UELOCSUB/environment/variables.txt @@ -1,13 +1,13 @@ *** Variables *** # Generic variables ${SCHEMA} http -${HOST} 10.192.2.172 +${HOST} 127.0.0.1 ${PORT} 8081 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l ${apiRoot} ${apiName} location -${apiVersion} v2 +${apiVersion} v3 # Specific variables ${USERTRACKSUB_CLIENT_ID} 0123 @@ -15,4 +15,12 @@ ${USERTRACK_NOTIF_CALLBACK_URI} {"notifyURL": "http://clientApp.example.com ${USERTRACK_IP_ADDRESS} acr:10.0.0.1 ${SUBSCRIPTION_ID} e0deee2b-6e50-4f33-ab09-8bf0585025d3 -${NON_EXISTENT_SUBSCRIPTION_ID} NON_EXISTENT_SUBSCRIPTION_ID \ No newline at end of file +${NON_EXISTENT_SUBSCRIPTION_ID} NON_EXISTENT_SUBSCRIPTION_ID + + +##Notification Server variables +${NOTIFICATION_SERVER_IP} 127.0.0.1 +${NOTIFICATION_SERVER_PORT} 8888 +${NOTIFICATION_SERVER_HTTP_METHOD} POST +${NOTIFICATION_SERVER_URI} /callback_url +${NOTIFICATION_SERVER_TIMEOUT} 5 diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationEventNotification.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..cab199eb3d6ebcc32de4ab23f824fa044b73ca91 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventNotification.json @@ -0,0 +1,16 @@ +{ + "notificationType": "UserLocationEventNotification", + "timestamp": { + "seconds": 1673507343, + "nanoseconds": 0 + }, + "address": "acr:10.0.0.1", + "userLocationEvent": "ENTERING_AREA_EVENT", + "zoneId": "zone01", + "accessPointId": "001010000000000000000000000000001", + "_links": { + "subscription": { + "href": "http://meAppServer.example.com/location/v3/subscriptions/user/subscription123" + } + } + } \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscription.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscription.json new file mode 100644 index 0000000000000000000000000000000000000000..48ccf95ac4c23f0989051bff3322382b7cc66623 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscription.json @@ -0,0 +1,6 @@ +{ + "subscriptionType": "UserLocationEventSubscription", + "clientCorrelator":"someCorrelator", + "address": "acr:10.0.0.1", + "callbackReference": "http://10.3.0.0.8:8888" +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionBR.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionBR.json new file mode 100644 index 0000000000000000000000000000000000000000..78d04600f1b03e73d15a580cbab8a860276f453b --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionBR.json @@ -0,0 +1,5 @@ +{ + "subscriptionType": "UserLocationEventSubscription", + "clientCorrelator":"someCorrelator", + "address": "acr:10.0.0.1" +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdate.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdate.json new file mode 100644 index 0000000000000000000000000000000000000000..d19ee4ec4a38271e9e3102f2ea49efd6b5d23829 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdate.json @@ -0,0 +1,6 @@ +{ + "subscriptionType": "UserLocationEventSubscription", + "clientCorrelator":"someCorrelator", + "address": "acr:10.0.0.1", + "callbackReference": "http://10.3.0.0.9:8888" +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdateBR.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdateBR.json new file mode 100644 index 0000000000000000000000000000000000000000..78d04600f1b03e73d15a580cbab8a860276f453b --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationEventSubscriptionUpdateBR.json @@ -0,0 +1,5 @@ +{ + "subscriptionType": "UserLocationEventSubscription", + "clientCorrelator":"someCorrelator", + "address": "acr:10.0.0.1" +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicNotification.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..bc3f854607c918d382c3875b2c92163d650d2d5e --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicNotification.json @@ -0,0 +1,18 @@ +{ + "notificationType": "UserLocationPeriodicNotification", + "result": "SUCCESS", + "locationInfo": { + "latitude": [ + 50.5 + ], + "longitude": [ + 47.5 + ], + "shape": 1 + }, + "_links": { + "self": { + "href": "http://someip.com/subscriptions/users/subscriptionPeriodicId" + } + } +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscription.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscription.json new file mode 100644 index 0000000000000000000000000000000000000000..5c7389f109aa3748743a490876280e31c5594231 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscription.json @@ -0,0 +1,10 @@ +{ + "subscriptionType": "UserLocationPeriodicSubscription", + "callbackReference": "http://10.3.0.0.8:8888", + "clientCorrelator":"clientCorrelatorInfo", + "address": "acr:10.0.4.3", + "periodicEventInfo": { + "reportingAmount": 10, + "reportingInterval": 5 + } +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionBR.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionBR.json new file mode 100644 index 0000000000000000000000000000000000000000..ca6c250d3a1e28f6afd38be3eaed88c5322d99dc --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionBR.json @@ -0,0 +1,9 @@ +{ + "subscriptionType": "UserLocationPeriodicSubscription", + "clientCorrelator":"clientCorrelatorInfo", + "address": "acr:10.0.4.3", + "periodicEventInfo": { + "reportingAmount": 10, + "reportingInterval": 5 + } +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionUpdate.json b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionUpdate.json new file mode 100644 index 0000000000000000000000000000000000000000..9fb7ef4f63d2d0a5c22dd3cbf9b599a018b6e8e1 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/jsons/UserLocationPeriodicSubscriptionUpdate.json @@ -0,0 +1,10 @@ +{ + "subscriptionType": "UserLocationPeriodicSubscription", + "callbackReference": "http://10.3.0.0.10:8888", + "clientCorrelator":"clientCorrelatorInfo", + "address": "acr:10.0.4.3", + "periodicEventInfo": { + "reportingAmount": 10, + "reportingInterval": 5 + } +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscription.json b/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscription.json deleted file mode 100644 index a5eb08d5b9953ce4fb10863c26852929255c3186..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscription.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "userTrackingSubscription": { - "clientCorrelator": "0123", - "callbackReference": { - "notifyURL": "http://clientApp.example.com/location_notifications/123456" - }, - "address": "acr:10.0.0.1", - "userEventCriteria": "Transferring" - } -} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscriptionError.json b/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscriptionError.json deleted file mode 100644 index d2f947087cc9f5df7266ad7c3bc8967fd30b73cc..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UELOCSUB/jsons/UserTrackingSubscriptionError.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "userTrackingSubscription": { - "client": "0123", - "callbackReference": { - "notifyURL": "http://clientApp.example.com/location_notifications/123456" - }, - "address": "acr:10.0.0.1", - "userEventCriteria": "Transferring" - } -} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/libraries/Server.py b/MEC013/SRV/UELOCSUB/libraries/Server.py new file mode 100644 index 0000000000000000000000000000000000000000..e4e229887100950e4be32352ff71678089d20380 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/libraries/Server.py @@ -0,0 +1,149 @@ +#!/usr/bin/python3 + +from http.server import BaseHTTPRequestHandler, HTTPServer +import json, os +import logging + +# Library version +__version__ = '0.0.1' + +def import_notification_json(subscription_type): + notification_type = subscription_type.split("Subscription")[0] + file_path = "./jsons/"+notification_type+".json" + logging.info(file_path) + logging.info(os.listdir()) + try: + with open(file_path, 'r') as json_file: + # Load the JSON data + data = json.load(json_file) + logging.info(data) + return data + except FileNotFoundError: + logging.error(f"Error: File not found at {file_path}") + + +class Server ( object ): + + ROBOT_LIBRARY_VERSION = '0.0.1' + + def spawn_web_server (self, host="127.0.0.1", port=8080, timeout=15, method="POST", endpoint="/callback_url", resp_body=None): + + class GET_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_GET(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + class POST_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + self.req_body = None + + + def do_POST(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + + #if self.path == self.endpoint: + # self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + #else: + # self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + content_len = int(self.headers.get('Content-Length')) + post_body = self.rfile.read(content_len) + self.req_body=post_body + + def get_req_body(self): + return self.req_body + + def get_resp_body(self): + return self.resp_body + + + class PUT_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_PUT(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + class DELETE_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_DELETE(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + if method == "GET": + self.handler = GET_Server(endpoint, resp_body) + elif method == "POST": + self.handler = POST_Server(endpoint, resp_body) + elif method == "PUT": + self.handler = PUT_Server(endpoint, resp_body) + elif method == "DELETE": + self.handler = DELETE_Server(endpoint, resp_body) + else: + logging.info("Error, unknown endpoint") + exit(1) + + self.app = HTTPServer((host, int(port)), self.handler) + self.app.timeout = int(timeout) + + + self.app.handle_request() + self.app.server_close() + logging.info(self.handler.get_resp_body()) + ## If a notification is received, then is returned. Otherwise an empty dictionary. + if(self.handler.get_req_body()!=None): + return json.loads(self.handler.get_req_body().decode("windows-1252")) + + ##OLD mechanism commented: if no response is received, then read the Notification JSON file and return it. + + #notification_json= import_notification_json(self.handler.get_resp_body()) + #return notification_json + return {} + diff --git a/MEC013/SRV/UELOCSUB/schemas/UserLocationEventNotification.schema.json b/MEC013/SRV/UELOCSUB/schemas/UserLocationEventNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..0bc9e09f37a66239a12ae82da8b23820425a5179 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/schemas/UserLocationEventNotification.schema.json @@ -0,0 +1,559 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "subscription": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + } + }, + "required": [ + "subscription" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "accessPointId": { + "description": "The identity of the access point.\nFor the events of \"ENTERING_AREA_EVENT\", it indicates the access point that the user is currently within. \nFor the event of \"LEAVING_AREA_EVENT\", it indicates the access point that the user used to be within.\nSee note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI).", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + }, + "civicInfo": { + "description": "Indicates a Civic address", + "type": "object", + "required": [ + "country" + ], + "properties": { + "country": { + "description": "The two-letter ISO 3166 country code in capital ASCII letters, e.g., DE or US", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "String" + }, + "A1": { + "description": "National subdivisions (state, canton, region, province, prefecture)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A2": { + "description": "County, parish, gun (JP), district (IN)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A3": { + "description": "City, township, shi (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A4": { + "description": "City division, borough, city district, ward, chou (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A5": { + "description": "Neighbourhood, block", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A6": { + "description": "Group of streets below the neighbourhood level", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRD": { + "description": "Leading street direction", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POD": { + "description": "Trailing street suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "STS": { + "description": "Street suffix or type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNO": { + "description": "House number", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNS": { + "description": "House number suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LMK": { + "description": "Landmark or vanity address", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LOC": { + "description": "Additional location information", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "NAM": { + "description": "Name (residence and office occupant)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PC": { + "description": "Postal/zip code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "BLD": { + "description": "Building (structure)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "UNIT": { + "description": "Unit (apartment, suite)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "FLR": { + "description": "Floor", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ROOM": { + "description": "Room", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PLC": { + "description": "Place-type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PCN": { + "description": "Postal community name", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POBOX": { + "description": "Post office box (P.O. box)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ADDCODE": { + "description": "Additional code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "SEAT": { + "description": "Seat (desk, cubicle, workstation)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RD": { + "description": "Primary road or street", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSEC": { + "description": "Road clause", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDBR": { + "description": "Road branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSUBBR": { + "description": "Road sub-branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRM": { + "description": "Road pre-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POM": { + "description": "Road post-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "usageRules": { + "description": "When present, this IE shall carry the value of \"usagerules\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "method": { + "description": "When present, this IE shall contain the method token, carried by the \"method\" Element of the PIDLLO XML document.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "providedBy": { + "description": "When present, this IE shall carry the value of \"provided-by\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + } + }, + "locationInfo": { + "properties": { + "accuracy": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracyAltitude": { + "description": "Altitude accuracy/uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracySemiMinor": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "confidence": { + "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "includedAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "innerRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "offsetAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "orientationMajorAxis": { + "description": "Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "shape": { + "description": "Shape information, as detailed in [14], associated with the reported location coordinate: 1 = Ellipsoid_Arc 2 = ellipsoid_Point 3 = ellipsoid_Point_Altitude 4 = ellipsoid_Point_Altitude_Uncert_Ellipsoid 5 = ellipsoid_Point_Uncert_Circle 6 = ellipsoid_Point_Uncert_Ellipse 7 = polygon", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "uncertaintyRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocity": { + "description": "Structure with attributes relating to the target entity’s velocity, as defined in [14].", + "properties": { + "bearing": { + "description": "Bearing, expressed in the range 0° to 360°, as defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "horizontalSpeed": { + "description": "Horizontal speed, expressed in km/h and defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "uncertainty": { + "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocityType": { + "description": "Velocity information, as detailed in [14], associated with the reported location coordinate: 1 = Horizontal 2 = Horizontal_Vertical 3 = Horizontal_Uncert 4 = Horizontal_Vertical_Uncert", + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "verticalSpeed": { + "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Int" + }, + "verticalUncertainty": { + "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "required": [ + "velocityType", + "bearing", + "horizontalSpeed" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "latitude", + "longitude", + "shape" + ], + "type": "object", + "x-etsi-ref": "6.5.3" + }, + "notificationType": { + "description": "Shall be set to \"UserLocationEventNotification\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "relativeLocationInfo": { + "properties": { + "X": { + "description": "Indicates the value (in the unit of meters) on x-axis of the relative location in the Cartesian system. Positive value represents easting from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Y": { + "description": "Indicates the value (in the unit of meters) on y-axis of the relative location in the Cartesian system. Positive value represents northing from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Z": { + "description": "Indicates the value (in the unit of meters) on z-axis of the relative location in the Cartesian system for a 3DPoint. Positive value represents height above origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "mapInfo": { + "properties": { + "ancillaryMapInfo": { + "description": "Ancillary map information may be used to convert coordinates between different coordinate systems.", + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Not_specified" + }, + "mapId": { + "description": "Indicates the ID of the map. ", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "origin": { + "description": "Indicates the location of the map origin in the local Cartesian coordinate system.", + "properties": { + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + } + }, + "required": [ + "latitude", + "longitude" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure(inlined)" + } + }, + "required": [ + "mapId" + ], + "type": "object", + "x-etsi-ref": "6.2.4" + } + }, + "required": [ + "mapInfo", + "X", + "Y" + ], + "type": "object", + "x-etsi-ref": "6.2.3" + }, + "timeStamp": { + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-ref": "6.5.2" + }, + "userLocationEvent": { + "description": "This type represents specified event types for UE location report.", + "enum": [ + "ENTERING_AREA_EVENT", + "LEAVING_AREA_EVENT" + ], + "type": "string" + }, + "zoneId": { + "description": "The identity of the zone. \nFor the events of \"ENTERING_AREA_EVENT\", it is the zone that the user is currently within. \nFor the event of \"LEAVING_AREA_EVENT\", it is the zone that the user used to be within.\nSee note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + }, + "required": [ + "notificationType", + "userLocationEvent", + "_links" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAs specified in [17], clause 6.1.6.2.14.\nNOTE 2:\tAs specified in [5], clause 5.2.2.7.\nNOTE 3:\tAt least one of these attributes shall be present only when reportingLocationReq is set to TRUE in the UserLocationEventSubscription.", + "x-etsi-ref": "6.4.4" +} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/schemas/UserLocationEventSubscription.schema.json b/MEC013/SRV/UELOCSUB/schemas/UserLocationEventSubscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..6d8178775c84423e775bc4cb5d7f3ef5cf94ba7c --- /dev/null +++ b/MEC013/SRV/UELOCSUB/schemas/UserLocationEventSubscription.schema.json @@ -0,0 +1,165 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "self": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + } + }, + "required": [ + "self" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI) to monitor.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + }, + "callbackReference": { + "description": "URI exposed by the client on which to receive notifications via HTTP. See note 1.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + }, + "clientCorrelator": { + "description": "A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server. See note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "expiryDeadline": { + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-ref": "6.5.2" + }, + "locationEventCriteria": { + "description": "List of user event values to generate notifications for (these apply to address specified). ", + "items": { + "description": "This type represents specified event types for UE location report.", + "enum": [ + "ENTERING_AREA_EVENT", + "LEAVING_AREA_EVENT" + ], + "type": "string" + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "Array(LocationEventType)" + }, + "requestTestNotification": { + "description": "Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI, as specified in ETSI GS MEC 009 [4], clause 6.12a.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "subscriptionType": { + "description": "Shall be set to \"UserLocationEventSubscription\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "userEventPara": { + "properties": { + "accessPointList": { + "description": "One or more access points forming a monitoring area that could be any shape. See note 1.", + "items": { + "type": "string" + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "Array(String)" + }, + "occurrenceInfo": { + "description": "The enumeration OccurrenceInfo indicates whether event reporting is one time.", + "enum": [ + "ONE_TIME_EVENT", + "MULTIPLE_TIME_EVENT" + ], + "type": "string" + }, + "reportingLocationReq": { + "description": "This IE shall be set to true if a location estimate is required for each event report.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "boolean" + }, + "zoneId": { + "description": "Identifier of zone (e.g. zone001) to monitor. See note 1.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + }, + "type": "object", + "x-etsi-notes": "NOTE 1:\tOnly one of accessPointList and zoneId may be present.\nNOTE 2:\tAs specified in [17], clause 6.1.6.3.16.", + "x-etsi-ref": "6.5.5" + }, + "websockNotifConfig": { + "properties": { + "requestWebsocketUri": { + "description": "Set to true by the service consumer to indicate that Websocket delivery is requested.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "websocketUri": { + "description": "Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "type": "object", + "x-etsi-ref": "6.5.4" + } + }, + "required": [ + "subscriptionType", + "address" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAt least one of callbackReference and websockNotifConfig shall be provided by the service consumer. If both are provided, it is up to location server to select an alternative and return only that alternative in the response, as specified in ETSI GS MEC 009 [4], clause 6.12a.\nNOTE 2:\tThis allows the client to recover from communication failures during resource creation and therefore avoids duplicate subscription creation in such situations. In case the element is present, the server shall not alter its value, and shall provide it as part of the representation of this resource. In case the element is not present, the server shall not generate it.", + "x-etsi-ref": "6.3.4" + } \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicNotification.schema.json b/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..0894d2ae90c15971f592bf6e0bee3fc94c201bd2 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicNotification.schema.json @@ -0,0 +1,565 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "self": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + } + }, + "required": [ + "self" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "accessPointId": { + "description": "The identity of the access point that the user is currently within. \nSee note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI).", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + }, + "civicInfo": { + "description": "Indicates a Civic address", + "type": "object", + "required": [ + "country" + ], + "properties": { + "country": { + "description": "The two-letter ISO 3166 country code in capital ASCII letters, e.g., DE or US", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "String" + }, + "A1": { + "description": "National subdivisions (state, canton, region, province, prefecture)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A2": { + "description": "County, parish, gun (JP), district (IN)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A3": { + "description": "City, township, shi (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A4": { + "description": "City division, borough, city district, ward, chou (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A5": { + "description": "Neighbourhood, block", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A6": { + "description": "Group of streets below the neighbourhood level", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRD": { + "description": "Leading street direction", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POD": { + "description": "Trailing street suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "STS": { + "description": "Street suffix or type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNO": { + "description": "House number", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNS": { + "description": "House number suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LMK": { + "description": "Landmark or vanity address", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LOC": { + "description": "Additional location information", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "NAM": { + "description": "Name (residence and office occupant)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PC": { + "description": "Postal/zip code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "BLD": { + "description": "Building (structure)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "UNIT": { + "description": "Unit (apartment, suite)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "FLR": { + "description": "Floor", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ROOM": { + "description": "Room", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PLC": { + "description": "Place-type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PCN": { + "description": "Postal community name", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POBOX": { + "description": "Post office box (P.O. box)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ADDCODE": { + "description": "Additional code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "SEAT": { + "description": "Seat (desk, cubicle, workstation)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RD": { + "description": "Primary road or street", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSEC": { + "description": "Road clause", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDBR": { + "description": "Road branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSUBBR": { + "description": "Road sub-branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRM": { + "description": "Road pre-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POM": { + "description": "Road post-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "usageRules": { + "description": "When present, this IE shall carry the value of \"usagerules\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "method": { + "description": "When present, this IE shall contain the method token, carried by the \"method\" Element of the PIDLLO XML document.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "providedBy": { + "description": "When present, this IE shall carry the value of \"provided-by\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + } + }, + "isFinalNotification": { + "description": "Shall be set to true if it is a final notification.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "locationInfo": { + "properties": { + "accuracy": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracyAltitude": { + "description": "Altitude accuracy/uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracySemiMinor": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "confidence": { + "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "includedAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "innerRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "offsetAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "orientationMajorAxis": { + "description": "Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "shape": { + "description": "Shape information, as detailed in [14], associated with the reported location coordinate: 1 = Ellipsoid_Arc 2 = ellipsoid_Point 3 = ellipsoid_Point_Altitude 4 = ellipsoid_Point_Altitude_Uncert_Ellipsoid 5 = ellipsoid_Point_Uncert_Circle 6 = ellipsoid_Point_Uncert_Ellipse 7 = polygon", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "uncertaintyRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocity": { + "description": "Structure with attributes relating to the target entity’s velocity, as defined in [14].", + "properties": { + "bearing": { + "description": "Bearing, expressed in the range 0° to 360°, as defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "horizontalSpeed": { + "description": "Horizontal speed, expressed in km/h and defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "uncertainty": { + "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocityType": { + "description": "Velocity information, as detailed in [14], associated with the reported location coordinate: 1 = Horizontal 2 = Horizontal_Vertical 3 = Horizontal_Uncert 4 = Horizontal_Vertical_Uncert", + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "verticalSpeed": { + "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Int" + }, + "verticalUncertainty": { + "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "required": [ + "velocityType", + "bearing", + "horizontalSpeed" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "latitude", + "longitude", + "shape" + ], + "type": "object", + "x-etsi-ref": "6.5.3" + }, + "notificationType": { + "description": "Shall be set to \"UserLocationPeriodicNotification\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "relativeLocationInfo": { + "properties": { + "X": { + "description": "Indicates the value (in the unit of meters) on x-axis of the relative location in the Cartesian system. Positive value represents easting from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Y": { + "description": "Indicates the value (in the unit of meters) on y-axis of the relative location in the Cartesian system. Positive value represents northing from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Z": { + "description": "Indicates the value (in the unit of meters) on z-axis of the relative location in the Cartesian system for a 3DPoint. Positive value represents height above origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "mapInfo": { + "properties": { + "ancillaryMapInfo": { + "description": "Ancillary map information may be used to convert coordinates between different coordinate systems.", + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Not_specified" + }, + "mapId": { + "description": "Indicates the ID of the map. ", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "origin": { + "description": "Indicates the location of the map origin in the local Cartesian coordinate system.", + "properties": { + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + } + }, + "required": [ + "latitude", + "longitude" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure(inlined)" + } + }, + "required": [ + "mapId" + ], + "type": "object", + "x-etsi-ref": "6.2.4" + } + }, + "required": [ + "mapInfo", + "X", + "Y" + ], + "type": "object", + "x-etsi-ref": "6.2.3" + }, + "result": { + "description": "This enumeration represents the result of a localization associated with a notification", + "enum": [ + "SUCCESS", + "ABNORMAL" + ], + "type": "string" + }, + "timeStamp": { + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-ref": "6.5.2" + }, + "zoneId": { + "description": "The identity of the zone that the user is currently within. \nSee note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + }, + "required": [ + "notificationType", + "result", + "_links" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAs specified in [17], clause 6.1.6.2.14.\nNOTE 2:\tAs specified in [5], clause 5.2.2.7.\nNOTE 3:\tIf the result is SUCCESS, at least one of locationInfo, civicInfo and relativeLocationInfo shall be present.", + "x-etsi-ref": "6.4.5" + } \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicSubscription.schema.json b/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicSubscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..0ef52447178f83dda8b271442dcecd310e2b69a5 --- /dev/null +++ b/MEC013/SRV/UELOCSUB/schemas/UserLocationPeriodicSubscription.schema.json @@ -0,0 +1,136 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "self": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + } + }, + "required": [ + "self" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI) to monitor.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + }, + "callbackReference": { + "description": "URI exposed by the client on which to receive notifications via HTTP. See note 1.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + }, + "clientCorrelator": { + "description": "A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server. See note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "expiryDeadline": { + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-ref": "6.5.2" + }, + "periodicEventInfo": { + "description": "NOTE: reportingAmount x reportingInterval shall not exceed 8639999 (99 days, 23 hours, 59 minutes and 59 seconds) for compatibility with OMA MLP and RLP.", + "type": "object", + "required": [ + "reportingAmount", + "reportingInterval" + ], + "properties": { + "reportingAmount": { + "description": "Number of event reports", + "type": "number", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "ReportingAmount" + }, + "reportingInterval": { + "description": "Interval of event reports", + "type": "number", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "reportingInterval" + } + } + }, + "requestTestNotification": { + "description": "Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI, as specified in ETSI GS MEC 009 [4], clause 6.12a.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "subscriptionType": { + "description": "Shall be set to \"UserLocationPeriodicSubscription\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "websockNotifConfig": { + "properties": { + "requestWebsocketUri": { + "description": "Set to true by the service consumer to indicate that Websocket delivery is requested.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "websocketUri": { + "description": "Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "type": "object", + "x-etsi-ref": "6.5.4" + } + }, + "required": [ + "subscriptionType", + "address", + "periodicEventInfo" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAt least one of callbackReference and websockNotifConfig shall be provided by the service consumer. If both are provided, it is up to location server to select an alternative and return only that alternative in the response, as specified in ETSI GS MEC 009 [4], clause 6.12a.\nNOTE 2:\tThis allows the client to recover from communication failures during resource creation and therefore avoids duplicate subscription creation in such situations. In case the element is present, the server shall not alter its value, and shall provide it as part of the representation of this resource. In case the element is not present, the server shall not generate it.\nNOTE 3:\tAs specified in [17], clause 6.1.6.2.24.", + "x-etsi-ref": "6.3.5" + } \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.json b/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.json deleted file mode 100644 index 6e2231ad77d0114857519e598510413bffd73660..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "object", - "properties": { - "userTrackingSubscription": { - "description": "A type containing user tracking subscription.", - "properties": { - "address": { - "description": "Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI) to monitor", - "type": "string", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "anyURI" - }, - "callbackReference": { - "properties": { - "callbackData": { - "description": "Data the application can register with the server when subscribing to notifications, and that are passed back unchanged in each of the related notifications. These data can be used by the application in the processing of the notification, e.g. for correlation purposes.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "string" - }, - "notificationFormat": { - "enum": [ - "XML", - "JSON" - ], - "type": "string" - }, - "notifyURL": { - "description": "Notify Callback URL", - "type": "string", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "anyURI" - } - }, - "required": [ - "notifyURL" - ], - "type": "object" - }, - "clientCorrelator": { - "description": "A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "string" - }, - "resourceURL": { - "description": "Self referring URL", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "anyURI" - }, - "userEventCriteria": { - "description": "List of user event values to generate notifications for (these apply to address specified). If this element is missing, a notification is requested to be generated for any change in user event.", - "items": { - "enum": [ - "Entering", - "Leaving", - "Transferring" - ], - "type": "string" - }, - "type": "array", - "x-etsi-mec-cardinality": "0..N", - "x-etsi-mec-origin-type": "UserEventType" - } - }, - "required": [ - "callbackReference", - "address" - ], - "type": "object" - } - } -} \ No newline at end of file diff --git a/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.v1.1.1.json b/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.v1.1.1.json deleted file mode 100644 index c7e590d6f5398879d4daabba75e3a530263db8b3..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UELOCSUB/schemas/UserTrackingSubscription.schema.v1.1.1.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://example.com/object1575044080.json", - "title": "Root", - "type": "object", - "required": [ - "userTrackingSubscription" - ], - "properties": { - "userTrackingSubscription": { - "$id": "#root/userTrackingSubscription", - "title": "Usertrackingsubscription", - "type": "object", - "required": [ - "clientCorrelator", - "callbackReference", - "address", - "userEventCriteria" - ], - "properties": { - "clientCorrelator": { - "$id": "#root/userTrackingSubscription/clientCorrelator", - "title": "Clientcorrelator", - "type": "string", - "default": "", - "examples": [ - "0123" - ], - "pattern": "^.*$" - }, - "callbackReference": { - "$id": "#root/userTrackingSubscription/callbackReference", - "title": "Callbackreference", - "type": "object", - "required": [ - "notifyURL" - ], - "properties": { - "notifyURL": { - "$id": "#root/userTrackingSubscription/callbackReference/notifyURL", - "title": "Notifyurl", - "type": "string", - "default": "", - "examples": [ - "http://clientApp.example.com/location_notifications/123456" - ], - "pattern": "^.*$" - } - } - } -, - "address": { - "$id": "#root/userTrackingSubscription/address", - "title": "Address", - "type": "string", - "default": "", - "examples": [ - "acr:10.0.0.1" - ], - "pattern": "^.*$" - }, - "userEventCriteria": { - "$id": "#root/userTrackingSubscription/userEventCriteria", - "title": "Usereventcriteria", - "type": "string", - "default": "", - "examples": [ - "Transferring" - ], - "pattern": "^.*$" - } - } - } - - } -}