# A Novel Radio Network Information Service (RNIS) to MEC Framework in B5G Networks
## 3 Our Proposed RNIS as a Service to MEC Framework in B5G Networks
### RNIS as a Service Implementation
The first resource, called RabInfo, is associated with the route /rni/v2/queries/rab_info/ <string:app_instance_id>, configured to handle POST requests. The second resource, PlmnInfo, is linked to the route /rni/v2/queries/plmn_info/<string:app_instance_id> also configured to handle POST requests. This structuring is common in web applications that follow the RESTful architectural style, allowing specific endpoints to be defined for various operations. ```
1
2 API=API(app)
3
4 API.add_resource(RabInfo, '/rni/v2/queries/rab_info/<string:'
5 app_instance_id>')
6 API.add_resource(PlmnInfo, '/rni/v2/queries/plmn_info/<string:'
7 app_instance_id>')
```  
Listing 2 represents a POST endpoint. When a POST request is made to the /mi/v2/queries/rab_info/ <string:app_instance_id> route, the RabInfo is triggered, receiving the data and passing it through the RabInfoModel. After verification and validation, this information is sent to the Emit, which is responsible for forwarding the information to the Broker. ```
1 classRabInfo(Resource):
3
4 defpost(self,app_instance_id):
5
6 data=request.get_json()
7
8 rab_objeto=RabInfoModel(app_instance_id, **data)
9
10 rab_JSON=rab_objeto.json()
11
12 Exchange.emit(rab_JSON,'rab')
13
14 returnrab_JSON, 200
```  
**Listing 1** Endpoint API. Illustrated in Listing 3 is an example of a Model. For each type of data, we have a corresponding Model with its characteristics and peculiarities (RabInfoModel, PlmnInfoModel, S1 BearerInfoModel, L2 MeasinfoModel). The constructor method _init_, when called automatically during the creation of a new object of the class, receives the parameters corresponding to that type of message; in this case, rab receives four parameters: app_instance_id, cell_user_info, request_id, and time_stamp. Each of these parameters is assigned to a corresponding attribute of the class instance, ensuring that the object is instantiated with specific values and thus has a consistent initial state. Each of these parameters received contains a sequence of information that makes them up, e.g., time_stamp: nano_seconds and seconds. In this way, we have several Models to validate and guarantee the standardization of the information. Within RabInfoModel itself, there is a method called setter time_stamp which in turn makes the appropriate call to check this data, thus calling the Model responsible for TimeStamp(Model). The setter time_stamp method is one of the verification methods responsible for validating and processing the value assigned to the time_stamp property. It checks that the value is not an empty string, creates a new TimeStamp object from the data provided and then converts this object to JSON before assigning it to the class's private _time_stamp property. The same happens with cell_user_info, which checks that the information has been passed correctly and calls the model responsible for validating each of its attributes (CellUEInfo(Model)). It then validates and returns them with confirmation that they can proceed with the information delivery flow. An example of the parameters received by CellUEInfo includes: associate_id, dl_gbr_data_volume_ue, dl_gbr_delay_ue, dl_gbr_dp_ue, dl_gbr_throughput_ue, dl_nongbr_data_volume_ue. ```
1 fromv2.models.base_model_importModel
2 fromv2.models.cell_user_infoimportCellUserInfo#noqa:F401,E501
3 fromv2.models.time_stampimportTimeStamp#noqa:F401,E501
4 fromv2 importutil
5
6 classRabInfoModel(Model):
7
8 def__init__(self,
9 app_instance_id:str,
10 cell_user_info:List[CellUserInfo],
11 request_id:str,
12 time_stamp:List[TimeStamp]):
13
14 self.app_instance_id=app_instance_id
15 self.plmn=plmn
16 self.time_stamp=time_stamp
17
18. 19
[EMAIL_ADDRESS]
21 deftime_stamp(self,time_stamp:List[TimeStamp]):
22
23 iftime_stamp==\"\":
24 raiseValueError(\"Invalidvaluefor'time_stamp',mustnotbe'None')
25
26 new_time_stamp=TimeStamp(**time_stamp)
27
28 new_time_stamp=new_time_stamp.json()
29
30 self._time_stamp=new_time_stamp
31. 32
33. ```  
**Listing 3** Class Model RabInfoModel.