diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index 18d0dbbbc6c11073b18fbaafc6d66b8a59986e55..b92f5265d0962b76a24f38d1e498b4cb2345a50e 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -47,11 +47,15 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy std::string str = it->second.substr(idx_begin + 1, idx_end - idx_begin); // ..and create the decoding buffer TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - - if (it->second.find("{\"userInfo\"") != std::string::npos) { - LocationAPI__TypesAndValues::UserInfo user_info; + + if (it->second.find("\"userInfo\"") != std::string::npos) { + LocationAPI__TypesAndValues::UserInfo user_info; user_info.decode(LocationAPI__TypesAndValues::UserInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userInfo() = user_info; + } else if (it->second.find("\"ueIdentityTagInfo\"") != std::string::npos) { + UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; + ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.ueIdentityTagInfo() = ue_identity_tag_info; } else { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; diff --git a/docker/Dockerfile b/docker/Dockerfile index 353da083e130940d677c105962e9ba11d346b028..41920684ae4e00912c0eb8e7146abe592222ee34 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,11 +1,11 @@ FROM ubuntu:18.04 -MAINTAINER ETSI STF 549 +MAINTAINER ETSI STF 569 -LABEL description="STF549 Docker Image" +LABEL description="STF569 Docker Image" ENV TERM=xterm -ENV HOSTNAME docker-titan-STF549 +ENV HOSTNAME docker-titan-STF569 RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common -y \ @@ -66,7 +66,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get autoclean \ && rm -rf /var/lib/apt/lists/* -RUN echo "docker-titan-STF549" > /etc/hostname \ +RUN echo "docker-titan-STF569" > /etc/hostname \ && echo "root:etsi" | chpasswd RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \ @@ -76,7 +76,7 @@ RUN useradd --create-home --shell /bin/bash --user-group etsi --groups sudo \ RUN cd /home/etsi \ && echo "" >> /home/etsi/.bashrc \ && echo "export HOME=/home/etsi" >> /home/etsi/.bashrc \ - && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_emcom/lib:$LD_LIBRARY_PATH" >> /home/etsi/.bashrc \ + && echo "export LD_LIBRARY_PATH=/home/etsi/dev/etsi_mec/lib:$LD_LIBRARY_PATH" >> /home/etsi/.bashrc \ && echo "export PATH=/home/etsi/bin:$PATH" >> /home/etsi/.bashrc \ && echo "cd /home/etsi" >> /home/etsi/.bashrc \ && echo ". ./devenv.bash" >> /home/etsi/.bashrc \ @@ -87,10 +87,10 @@ RUN cd /home/etsi \ # Seems that COPY does not work as expected, to be investaged #==> Fallback to more secured solution -#COPY [^.]* /home/etsi/dev/STF549_Ng112/ +#COPY [^.]* /home/etsi/dev/STF569_Mec/ #COPY home home/etsi -RUN git clone https://forge.etsi.org/gitlab/emergency-communications/NG112.git /home/etsi/dev/STF549_Ng112 -RUN chown -R etsi /home/etsi/dev/STF549_Ng112/ && cd /home/etsi/dev/STF549_Ng112 +RUN git clone https://forge.etsi.org/gitlab/garciay/MEC.git /home/etsi/dev/STF569_Mec +RUN chown -R etsi /home/etsi/dev/STF569_Mec/ && cd /home/etsi/dev/STF569_Mec USER etsi @@ -105,27 +105,27 @@ RUN cd /home/etsi/frameworks \ && wget -q 'http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/oxygen/2/eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \ && tar -zxvf ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \ && rm -f ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \ - && cd /home/etsi/dev/STF549_Ng112 \ - && cd /home/etsi/dev/STF549_Ng112/ttcn \ + && cd /home/etsi/dev/STF569_Mec \ + && cd /home/etsi/dev/STF569_Mec/ttcn \ && git clone https://forge.etsi.org/gitlab/LIBS/LibSip.git ./LibSip \ && git clone https://forge.etsi.org/gitlab/LIBS/LibIms.git ./LibIms \ && git clone https://forge.etsi.org/gitlab/LIBS/LibCommon.git ./LibCommon \ && git clone -bSTF525 https://forge.etsi.org/gitlab/LIBS/LibIts ./LibIts \ - && cd /home/etsi/dev/STF549_Ng112/ttcn/LibIts \ + && cd /home/etsi/dev/STF569_Mec/ttcn/LibIts \ && rm -fr asn1 t3q xsd \ && cd ttcn && rm -fr BTP CALM CAM Common DCC DENM GeoNetworking Ipv6OverGeoNetworking IVIM MapemSpatem Pki Security SremSsem V2G \ - && cd /home/etsi/dev/STF549_Ng112/scripts \ + && cd /home/etsi/dev/STF569_Mec/scripts \ && chmod 775 *.bash devenv.bash.* \ && cd /home/etsi \ - && ln -sf /home/etsi/dev/STF549_Ng112/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash \ + && ln -sf /home/etsi/dev/STF569_Mec/scripts/devenv.bash.ubuntu /home/etsi/devenv.bash \ && ls -ltr /home/etsi \ && export HOME=/home/etsi \ && . /home/etsi/devenv.bash \ - && cd /home/etsi/dev/STF549_Ng112/scripts \ + && cd /home/etsi/dev/STF569_Mec/scripts \ && ./build_titan.bash \ && . /home/etsi/devenv.bash \ - && ./update_emcom_project.bash \ - && cd /home/etsi/dev/etsi_emcom/src/AtsNg112/objs \ - && ../bin/ng112_generate_makefile.bash + && ./update_mec_project.bash \ + && cd /home/etsi/dev/etsi_mec/src/AtsMec/objs \ + && ../bin/mec_generate_makefile.bash # That's all Floks diff --git a/etc/AtsMec/AtsMec_LocationAPI.cfg b/etc/AtsMec/AtsMec_LocationAPI.cfg index 3f7a71bc434c9e176317931fbb9fd06dfce8f3ec..3e38761e633a70c5e91fde79405e45fe86263897 100644 --- a/etc/AtsMec/AtsMec_LocationAPI.cfg +++ b/etc/AtsMec/AtsMec_LocationAPI.cfg @@ -9,7 +9,7 @@ LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.0.5" -LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json;charset=utf-8" +LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibMec_Pics.PICS_ME_APP_IUT := true diff --git a/scripts/mec_generate_makefile.bash b/scripts/mec_generate_makefile.bash index a889025bcdc77e5142048491d331ee2af58c3d0b..959df8f276b98d53426c4afa32998f72c1895b6a 100755 --- a/scripts/mec_generate_makefile.bash +++ b/scripts/mec_generate_makefile.bash @@ -52,7 +52,7 @@ find .. -type f -name "*.bak" -exec rm {} \; find .. -type f -name "*.log" -exec rm {} \; # Build JSON files if any and put them in objs directory -REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI" +REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI LibMec/UEidentityAPI" for i in ${REFERENCES} do # TTCN code @@ -166,7 +166,7 @@ else fi LDFLAGS_DEBUG_MODE='s/LDFLAGS = /LDFLAGS = -g -pthread -fPIC -fstack-check -fstack-protector -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g' fi -ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_MEC)/include -I$(PATH_DEV_MEC)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibMec/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' +ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_MEC)/include -I$(PATH_DEV_MEC)/framework/include -I../include -I../../LibMec/Common/include -I../../LibMec/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl -L\$\(HOME_FRAMEWORKS\)\/osip\/src\/osipparser2\/\.libs -losipparser2/g' sed --in-place "${CXXFLAGS_DEBUG_MODE}" ./Makefile sed --in-place "${LDFLAGS_DEBUG_MODE}" ./Makefile diff --git a/scripts/merge_mec_project.bash b/scripts/merge_mec_project.bash index a82229c26dcd10baea32066e1d131e26601d9d36..eaf020b3a877675a8f98b4409db0c01c0ce3ae28 100755 --- a/scripts/merge_mec_project.bash +++ b/scripts/merge_mec_project.bash @@ -158,7 +158,7 @@ done echo 'Update TTCN-3 files' TTCN_3_ORG_PATH=${SRC_MEC_PATH}/ttcn TTCN_3_DST_PATH=${PATH_DEV_MEC}/src -TTCN_3_ATS_LIST='AtsNg112 LibMec LibMec/LocationAPI LibCommon LibHttp' +TTCN_3_ATS_LIST='AtsNg112 LibMec LibMec/LocationAPI LibMec/UEidentityAPI LibHttp LibCommon' for i in ${TTCN_3_ATS_LIST} do # TTCN-3 files diff --git a/scripts/testcodec_generate_makefile.bash b/scripts/testcodec_generate_makefile.bash index c7dd25409e1f504155c609a988c36c5c7b083642..36d0e42b0eda0d5045926d88480db79af2eee555 100755 --- a/scripts/testcodec_generate_makefile.bash +++ b/scripts/testcodec_generate_makefile.bash @@ -165,7 +165,7 @@ else fi LDFLAGS_DEBUG_MODE='s/LDFLAGS = /LDFLAGS = -g -pthread -fPIC -fstack-check -fstack-protector -fsanitize=address -fno-omit-frame-pointer -fsanitize=leak -fsanitize=address -fno-omit-frame-pointer/g' fi -ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_MEC)/include -I$(PATH_DEV_MEC)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibNg112/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' +ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_MEC)/include -I$(PATH_DEV_MEC)/framework/include -I../include -I../../LibMec/Common/include -I../../LibMec/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.' ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl -L\$\(HOME_FRAMEWORKS\)\/osip\/src\/osipparser2\/\.libs -losipparser2/g' sed --in-place "${CXXFLAGS_DEBUG_MODE}" ./Makefile sed --in-place "${LDFLAGS_DEBUG_MODE}" ./Makefile diff --git a/scripts/update_mec_project.bash b/scripts/update_mec_project.bash index b9ac364748f91520aaadd8e5f055f72ba9547b35..02335e541566aed50d6dfca248c282fbc8e10759 100755 --- a/scripts/update_mec_project.bash +++ b/scripts/update_mec_project.bash @@ -125,7 +125,7 @@ do done # Update libraries & CC files -TTCN_3_LIB_LIST='LibMec LibMec/LocationAPI LibHttp LibCommon' +TTCN_3_LIB_LIST='LibMec LibMec/LocationAPI LibMec/UEidentityAPI LibHttp LibCommon' for i in ${TTCN_3_LIB_LIST} do if [ ! -d ${TTCN_3_DST_PATH}/$i ] @@ -142,8 +142,10 @@ do then cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json - cp ${CC_SRC_PATH}/include/$i/*.hh ${TTCN_3_DST_PATH}/$i/include - cp ${CC_SRC_PATH}/src/$i/*.cc ${TTCN_3_DST_PATH}/$i/src + elif [ "$i" == "LibMec/UEidentityAPI" ] + then + cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn + cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json elif [ "$i" == "LibHttp" ] then cp ${TTCN_3_ORG_PATH}/LibIts/ttcn/Http/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn diff --git a/ttcn/AtsMec/AtsMec_TestControl.ttcn b/ttcn/AtsMec/AtsMec_TestControl.ttcn index 83ebceef69131381395062551a8866d2a4086fde..d05b778f6e1ec6323754b2692132486f23de7f5a 100644 --- a/ttcn/AtsMec/AtsMec_TestControl.ttcn +++ b/ttcn/AtsMec/AtsMec_TestControl.ttcn @@ -2,12 +2,15 @@ module AtsMec_TestControl { // LibMec_LocationAPI import from LocationAPI_Pics all; + // LibMec_UEidentityAPI + import from UEidentityAPI_Pics all; // LibMec import from LibMec_Pics all; // AtsMec import from AtsMec_LocationAPI_TestCases all; + import from AtsMec_UEidentityAPI_TestCases all; control { @@ -15,6 +18,9 @@ module AtsMec_TestControl { if (PICS_LOCATION_API_SUPPORTED) { execute(TC_MEC_PLAT_MP1_LOC_BV_001()); } + if (PICS_UE_IDENTITY_API_SUPPORTED) { + execute(TC_MEC_PLAT_MP1_UETAG_BV_001()); + } } } diff --git a/ttcn/AtsMec/AtsMec_UEidentityAPI.ttcn b/ttcn/AtsMec/AtsMec_UEidentityAPI.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a6d9bb52639f9cd7eba979236d2900b45b307c4 --- /dev/null +++ b/ttcn/AtsMec/AtsMec_UEidentityAPI.ttcn @@ -0,0 +1,98 @@ +/** + * @author ETSI / STF569 + * @version $URL:$ + * $ID:$ + * @desc This module provides the MEC test cases. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10) + */ +module AtsMec_UEidentityAPI_TestCases { + + // Libcommon + import from LibCommon_Time all; + import from LibCommon_VerdictControl all; + import from LibCommon_Sync all; + + // LibHttp + import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_Functions all; + import from LibItsHttp_Templates all; + import from LibItsHttp_JsonTemplates all; + import from LibItsHttp_TestSystem all; + + // LibMec_UEidentityAPI + import from UEidentityAPI_TypesAndValues all; + import from UEidentityAPI_Templates all; + import from UEidentityAPI_Pics all; + import from UEidentityAPI_Pixits all; + + // LibMec + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + group me_app_role { + + /** + * @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 + */ + testcase TC_MEC_PLAT_MP1_UETAG_BV_001() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_ME_APP_IUT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_ME_APP_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + PICS_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_ue_identity_tag_info( + mw_ue_identity_tag_info( + ? + )))))) -> value v_response { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_001 + + } // End of group me_app_role + +} // End of module AtsMec_TestCases diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Pics.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Pics.ttcn index da5448bba63ce05e4c9223595539fa30b977ca6a..7888074680e7776f2e4b04191af3253aae89e41a 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Pics.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Pics.ttcn @@ -1,5 +1,8 @@ module LocationAPI_Pics { + /** + * @desc Does the IUT support LocationAPI? + */ modulepar boolean PICS_LOCATION_API_SUPPORTED := true; } // End of module LocationAPI_Pics diff --git a/ttcn/LibMec/UEidentityAPI/json/UEidentityAPI.json b/ttcn/LibMec/UEidentityAPI/json/UEidentityAPI.json new file mode 100644 index 0000000000000000000000000000000000000000..bbdc08bb4b17189a21c1cc646428443cb819a2dc --- /dev/null +++ b/ttcn/LibMec/UEidentityAPI/json/UEidentityAPI.json @@ -0,0 +1,309 @@ +{ + "swagger": "2.0", + "info": { + "description": "The ETSI MEC ISG MEC014 UE Identity API described using OpenAPI", + "version": "1.1.1", + "title": "UE Identity API", + "license": { + "name": "ETSI Forge copyright notice", + "url": "https://forge.etsi.org/etsi-forge-copyright-notice.txt" + } + }, + "externalDocs": { + "description": "ETSI GS MEC014 UE Identity API, V1.1.1", + "url": "http://www.etsi.org/deliver/etsi_gs/MEC/001_099/014/01.01.01_60/gs_mec014v010101p.pdf" + }, + "host": "127.0.0.1:8081", + "basePath": "/ui/v1", + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "OauthSecurity": [ + "all" + ] + } + ], + "securityDefinitions": { + "OauthSecurity": { + "type": "oauth2", + "flow": "application", + "tokenUrl": "https://oauth.exampleAPI/token", + "scopes": { + "all": "Single oauth2 scope for API" + } + } + }, + "parameters": { + "Body.UeIdentityTagInfo": { + "name": "UeIdentityTagInfo", + "in": "body", + "description": "'The updated \"state\" for each included UE Identity tag is included in the entity body of the request'", + "required": true, + "schema": { + "$ref": "#/definitions/UeIdentityTagInfo" + } + }, + "Path.AppInstanceId": { + "name": "appInstanceId", + "in": "path", + "description": "Represents a mobile edge application instance", + "required": true, + "type": "string" + }, + "Query.UeIdentityTag": { + "name": "ueIdentityTag", + "in": "query", + "description": "Represents a UE", + "required": true, + "type": "array", + "items": { + "type": "string" + } + } + }, + "paths": { + "/{appInstanceId}/ue_identity_tag_info": { + "parameters": [ + { + "$ref": "#/parameters/Path.AppInstanceId" + } + ], + "get": { + "description": "Retrieves information about a specific UeIdentityTagInfo resource", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/Query.UeIdentityTag" + } + ], + "responses": { + "200": { + "description": "It is used to indicate nonspecific success. The response body contains a representation of the UeIdentityTagInfo resource.", + "schema": { + "required": [ + "UeIdentityTagInfo" + ], + "properties": { + "UeIdentityTagInfo": { + "$ref": "#/definitions/UeIdentityTagInfo" + } + } + } + }, + "400": { + "description": "Incorrect parameters were passed in the request.In the returned ProblemDetails structure, the \"detail\" attribute should convey more information about the error.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + }, + "403": { + "description": "The operation is not allowed given the current status of the resource. More information should be provided in the \"detail\" attribute of the \"ProblemDetails\" structure.", + "schema": { + "required": [ + "ProblemDetails" + ], + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + }, + "404": { + "description": "The client provided a URI that cannot be mapped to a valid resource URL. In the returned ProblemDetails structure, the \"detail\" attribute should convey more information about the error.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + } + } + }, + "put": { + "description": "Register/De-register the information about specific a UeIdentityTagInfo resource", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/Body.UeIdentityTagInfo" + } + ], + "responses": { + "200": { + "description": "It is used to indicate success. The response body contains a representation of the UeIdentityTagInfo resource", + "schema": { + "required": [ + "UeIdentityTagInfo" + ], + "properties": { + "UeIdentityTagInfo": { + "$ref": "#/definitions/UeIdentityTagInfo" + } + } + } + }, + "400": { + "description": "Incorrect parameters were passed in the request.In the returned ProblemDetails structure, the \"detail\" attribute should convey more information about the error.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + }, + "401": { + "description": "An erroneous or missing bearer token. More information should be provided in the \"detail\" attribute of the \"ProblemDetails\" structure.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + }, + "403": { + "description": "The operation is not allowed given the current status of the resource. More information should be provided in the \"detail\" attribute of the \"ProblemDetails\" structure.", + "schema": { + "required": [ + "ProblemDetails" + ], + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + }, + "404": { + "description": "The client provided a URI that cannot be mapped to a valid resource URL. In the returned ProblemDetails structure, the \"detail\" attribute should convey more information about the error.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/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.", + "schema": { + "properties": { + "ProblemDetails": { + "$ref": "#/definitions/ProblemDetails" + } + } + } + } + } + } + } + }, + "definitions": { + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Problem.type" + }, + "title": { + "$ref": "#/definitions/Problem.title" + }, + "status": { + "$ref": "#/definitions/Problem.status" + }, + "detail": { + "$ref": "#/definitions/Problem.detail" + }, + "instance": { + "$ref": "#/definitions/Problem.instance" + } + } + }, + "Problem.type": { + "type": "string", + "format": "uri", + "description": "A URI reference according to IETF RFC 3986 that identifies the problem type" + }, + "Problem.title": { + "type": "string", + "description": "A short, human-readable summary of the problem type" + }, + "Problem.status": { + "type": "integer", + "format": "uint32", + "description": "The HTTP status code for this occurrence of the problem" + }, + "Problem.detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem" + }, + "Problem.instance": { + "type": "string", + "format": "uri", + "description": "A URI reference that identifies the specific occurrence of the problem" + }, + "UeIdentityTagInfo": { + "description": "information of UE identity tag used in UE Identity feature", + "type": "object", + "required": [ + "ueIdentityTags" + ], + "properties": { + "ueIdentityTags": { + "$ref": "#/definitions/UeIdentityTags" + } + } + }, + "UeIdentityTags": { + "description": "1 to N tags presented by a ME Application instance to a ME Platform", + "type": "array", + "items": { + "required": [ + "ueIdentityTag", + "state" + ], + "properties": { + "ueIdentityTag": { + "$ref": "#/definitions/UeIdentityTag" + }, + "state": { + "$ref": "#/definitions/State" + } + } + } + }, + "UeIdentityTag": { + "description": "Specific tag presented by a ME Application instance to a ME Platform", + "type": "string", + "example": "UeTagA" + }, + "State": { + "description": "Status of the resource ueIdentityTagInfo", + "type": "string", + "enum": [ + "UNREGISTERED", + "REGISTERED" + ], + "example": "REGISTERED" + } + } +} diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pics.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pics.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1dd2b1c05297cf527961dd0892bd23bcd1ce1f9e --- /dev/null +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pics.ttcn @@ -0,0 +1,5 @@ +module UEidentityAPI_Pics { + + modulepar boolean PICS_UE_IDENTITY_API_SUPPORTED := true; + +} // End of module UEidentityAPI_Pics diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..753c8ac98fc7785c75b3d362a630b46fd47e7f09 --- /dev/null +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn @@ -0,0 +1,13 @@ +module UEidentityAPI_Pixits { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + // LibMec/UEidentityAPI + import from UEidentityAPI_TypesAndValues all; + + modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01"; + + modulepar universal charstring PX_UE_IDENTITY_TAG := "ueIdentityTag"; + +} // End of module UEidentityAPI_Pixits diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..342c6a338fd1b5a4dd0146977d04159d1ebd7f20 --- /dev/null +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn @@ -0,0 +1,65 @@ +module UEidentityAPI_Templates { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + // LibMec/UEidentityAPI + import from UEidentityAPI_TypesAndValues all; + + template (value) ProblemDetails m_problem_details( + in universal charstring p_type, + in universal charstring p_title, + in UInt32 p_status, + in universal charstring p_detail, + in universal charstring p_instance + ) := { + type_ := p_type, + title := p_title, + status := p_status, + detail := p_detail, + instance := p_instance + } // End of template m_problem_details + + template (present) ProblemDetails mw_problem_details( + template (present) universal charstring p_type := ?, + template (present) universal charstring p_title := ?, + template (present) UInt32 p_status := ?, + template (present) universal charstring p_detail := ?, + template (present) universal charstring p_instance := ? + ) := { + type_ := p_type, + title := p_title, + status := p_status, + detail := p_detail, + instance := p_instance + } // End of template mw_problem_details + + template (value) UeIdentityTagInfo m_ue_identity_tag_info( + in template (value) UeIdentityTags p_ueIdentityTags + ) := { + ueIdentityTags := p_ueIdentityTags + } // End of template m_ue_identity_tag_info + + template (present) UeIdentityTagInfo mw_ue_identity_tag_info( + template (present) UeIdentityTags p_ueIdentityTags := ? + ) := { + ueIdentityTags := p_ueIdentityTags + } // End of template mw_ue_identity_tag_info + + template (value) UeIdentityTagItem m_ue_identity_tag_item( + in template (value) UeIdentityTag p_ueIdentityTag, + in State p_state + ) := { + ueIdentityTag := p_ueIdentityTag, + state := p_state + } // End of template m_ue_identity_tag_item + + template (present) UeIdentityTagItem mw_ue_identity_tag_item( + template (present) UeIdentityTag p_ueIdentityTag := ?, + template (present) State p_state := ? + ) := { + ueIdentityTag := p_ueIdentityTag, + state := p_state + } // End of template mw_ue_identity_tag_item + +} // End of module UEidentityAPI_Templates diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f98e27baaaad2b5306543cf97d6393fc5bc8cbc7 --- /dev/null +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn @@ -0,0 +1,62 @@ +module UEidentityAPI_TypesAndValues { + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + /** + * @desc + * @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type + * @member title A short, human-readable summary of the problem type + * @member status The HTTP status code for this occurrence of the problem + * @member detail A human-readable explanation specific to this occurrence of the problem + * @member instance A URI reference that identifies the specific occurrence of the problem + */ + type record ProblemDetails { + universal charstring type_, + universal charstring title, + UInt32 status, + universal charstring detail, + universal charstring instance + } with { + variant (type_) "name as 'type'"; + } + + /** + * @desc Information of UE identity tag used in UE Identity feature + * @member ueIdentityTags 1 to N tags presented by a ME Application instance to a ME Platform + */ + type record UeIdentityTagInfo { + UeIdentityTags ueIdentityTags + } + + /** + * @desc Specific tag presented by a ME Application instance to a ME Platform + */ + type universal charstring UeIdentityTag; + + /** + * @desc Status of the resource ueIdentityTagInfo + */ + type enumerated State { + e_unregistered, + e_registered + } + + /** + * @desc ME Application instance to a ME Platform + * @member ueIdentityTag Specific tag presented by a ME Application instance to a ME Platform + * @member state Status of the resource ueIdentityTagInfo + */ + type record UeIdentityTagItem { + universal charstring ueIdentityTag, + State state + } + + /** + * @desc 1 to N tags presented by a ME Application instance to a ME Platform + */ + type record of UeIdentityTagItem UeIdentityTags; + +} with { + encode "JSON" +} // End of module UEidentityAPI_TypesAndValues diff --git a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn index 65975905e8517f71225e22ddf18a94d439446608..a8dcff6e8ccc0e080f8d81d1cb22795985576f4a 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn @@ -7,4 +7,6 @@ module LibMec_Pics { modulepar charstring PICS_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones/"; + modulepar charstring PICS_ME_APP_Q_UE_IDENTITY_ID_URI := "/exampleAPI/ui/v2/"; + } // End of module LibMec_Pics diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 7f2d06bdc6a550749910f063de969d35df0caa42..470373072f832d04a1396f647571bb245848c788 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -1,3 +1,3 @@ module LibMec_Pixits { -} +} // End of module LibMec_Pixits diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index 32630d23f3857e9fd57939e50c4ba7496ec1325b..7603b8002c5fd6779bfef886f6b13d636c04d1ee 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -2,10 +2,12 @@ module LibItsHttp_JsonMessageBodyTypes { // LibMec/LocationAPI import from LocationAPI_TypesAndValues all; + // LibMec/UEidentityAPI + import from UEidentityAPI_TypesAndValues all; /** * This file volontary contains a trivial declaration of the type JsonBody. - * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the JsonBody typing. + * In accordance with your TTCN-3 module LibItsHttp_JSONTypes, you have to change the JsonBody typing. */ // TODO Add here your custom RFCs import @@ -13,6 +15,8 @@ module LibItsHttp_JsonMessageBodyTypes { // TODO Add here your custom variants UserInfo userInfo, ZoneInfo zoneInfo, + ProblemDetails problemDetails, + UeIdentityTagInfo ueIdentityTagInfo, universal charstring raw } with { variant "" diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index f2f7a9b2b6c20734d88c85d0fcbcf710ced3dc86..46bd1431d704bf0e0a991760fa1531c99874bc12 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -13,6 +13,9 @@ module LibItsHttp_JsonTemplates { // LibMec/LocationAPI import from LocationAPI_TypesAndValues all; import from LocationAPI_Templates all; + // LibMec/UEidentityAPI + import from UEidentityAPI_TypesAndValues all; + import from UEidentityAPI_Templates all; // TODO Add here your custom RFCs import @@ -31,29 +34,49 @@ module LibItsHttp_JsonTemplates { ) := { raw := p_raw } // End of template mw_json_body_raw + + group locarion_api { + + template (value) JsonBody m_body_json_user_info( + in template (value) UserInfo p_user_info + ) := { + userInfo := p_user_info + } // End of template m_body_json_user_info + + template (present) JsonBody mw_body_json_user_info( + template (present) UserInfo p_user_info := ? + ) := { + userInfo := p_user_info + } // End of template mw_body_json_user_info + + template (value) JsonBody m_body_json_zone_info( + in template (value) ZoneInfo p_zone_info + ) := { + zoneInfo := p_zone_info + } // End of template m_body_json_zone_info - template (value) JsonBody m_body_json_user_info( - in template (value) UserInfo p_user_info - ) := { - userInfo := p_user_info - } // End of template m_body_json_user_info - - template (present) JsonBody mw_body_json_user_info( - template (present) UserInfo p_user_info := ? - ) := { - userInfo := p_user_info - } // End of template mw_body_json_user_info - - template (value) JsonBody m_body_json_zone_info( - in template (value) ZoneInfo p_zone_info - ) := { - zoneInfo := p_zone_info - } // End of template m_body_json_zone_info - - template (present) JsonBody mw_body_json_zone_info( - template (present) ZoneInfo p_zone_info := ? + template (present) JsonBody mw_body_json_zone_info( + template (present) ZoneInfo p_zone_info := ? ) := { - zoneInfo := p_zone_info - } // End of template mw_body_json_zone_info + zoneInfo := p_zone_info + } // End of template mw_body_json_zone_info + + } // End of group locarion_api + + group ue_identity_api { + + template (present) JsonBody mw_body_json_ue_identity_tag_info( + template (present) UeIdentityTagInfo p_ueIdentityTagInfo := ? + ) := { + ueIdentityTagInfo := p_ueIdentityTagInfo + } // End of template mw_body_json_ue_identity_tags + + template (present) JsonBody mw_body_json_ue_problem_details( + template (present) ProblemDetails p_problemDetails := ? + ) := { + problemDetails := p_problemDetails + } // End of template mw_body_json_ue_problem_details + + } // End of group ue_identity_api } // End of module LibItsHttp_JsonTemplates