Skip to content

Proposing a New Network Function

Sagar Arora edited this page Aug 11, 2022 · 1 revision

Prerequisites

Clone OpenAPI specifications

$ git clone https://forge.3gpp.org/rep/all/5G_APIs.git -b REL-16

Make target directory for NF (e.g. LMF here)

$ cd 5G_APIs/ && mkdir lmf

Generate OpenAPI Modules for NF

  • openapi-generator-cli generate -i <openapi_spec> -g <select_generator> -o <target_directory>
  • Generator List
5G_APIs$ openapi-generator-cli generate -i TS29572_Nlmf_Location.yaml -g cpp-pistache-server -o lmf/
Did set selected version to 6.0.1
[main] INFO  o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] INFO  o.o.c.ignore.CodegenIgnoreProcessor - No .openapi-generator-ignore file found.
[main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: cpp-pistache-server (server)
:
:
[main] INFO  o.o.codegen.TemplateManager - writing file /tmp/5G_APIs/lmf/.openapi-generator-ignore
[main] INFO  o.o.codegen.TemplateManager - writing file /tmp/5G_APIs/lmf/.openapi-generator/VERSION
[main] INFO  o.o.codegen.TemplateManager - writing file /tmp/5G_APIs/lmf/.openapi-generator/FILES
################################################################################
# Thanks for using OpenAPI Generator.                                          #
# Please consider donation to help us maintain this project πŸ™                 #
# https://opencollective.com/openapi_generator/donate                          #
################################################################################

Create generic skeleton for OAI CN NF

$ cd ../
$ mkdir oai-cn5g-lmf
$ cd oai-cn5g-lmf && mkdir ci-scripts docker docs etc scripts src src/api-server src/common src/lmf_app src/oai_lmf build build/scripts
$ oai-cn5g-lmf$ wget https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nssf/-/raw/master/LICENSE?inline=false --output-document=LICENSE

Copy OpenAPI modules generated to NF directory

oai-cn5g-lmf$ cp -r ../5G_APIs/lmf/* src/api-server/

Preview

oai-cn5g-lmf$ tree -L 3
.
β”œβ”€β”€ build
β”‚Β Β  └── scripts
β”œβ”€β”€ ci-scripts
β”œβ”€β”€ docker
β”œβ”€β”€ docs
β”œβ”€β”€ etc
β”œβ”€β”€ LICENSE
β”œβ”€β”€ scripts
└── src
    β”œβ”€β”€ api-server
    β”‚Β Β  β”œβ”€β”€ api
    β”‚Β Β  β”œβ”€β”€ CMakeLists.txt
    β”‚Β Β  β”œβ”€β”€ impl
    β”‚Β Β  β”œβ”€β”€ main-api-server.cpp
    β”‚Β Β  β”œβ”€β”€ model
    β”‚Β Β  └── README.md
    β”œβ”€β”€ common
    β”œβ”€β”€ lmf_app
    └── oai_lmf

15 directories, 4 files

Manage namespace

//ToDo

Define sample API

//ToDo

Test sample API

//ToDo

  1. Home
  2. Configuration for Network Functions

Clone this wiki locally